From 3c9945364c294ab65c62c01447d00ebc980558bc Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 3 Oct 2020 12:19:13 +0200 Subject: tv ppp: add o2 config --- tv/2configs/ppp.nix | 34 +++++++++++++++++++++++++++++++++- tv/dummy_secrets/o2.pin | 1 + 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tv/dummy_secrets/o2.pin (limited to 'tv') diff --git a/tv/2configs/ppp.nix b/tv/2configs/ppp.nix index 02227343c..ecb17c3f8 100644 --- a/tv/2configs/ppp.nix +++ b/tv/2configs/ppp.nix @@ -1,2 +1,34 @@ -{ pkgs, ... }: { +{ pkgs, ... }: let + lib = import ; + cfg = { + pin = "@${toString }"; + ttys.ppp = "/dev/ttyACM0"; + }; +in { + environment.etc."ppp/peers/o2".text = /* sh */ '' + ${cfg.ttys.ppp} + 921600 + crtscts + defaultroute + holdoff 10 + lock + maxfail 0 + noauth + nodetach + noipdefault + passive + persist + usepeerdns + connect "${pkgs.ppp}/bin/chat ''${DEBUG+-v} -Ss -f ${pkgs.writeText "o2.chat" /* sh */ '' + ABORT "BUSY" + ABORT "NO CARRIER" + REPORT CONNECT + "*EMRDY: 1" + ATZ OK + AT+CFUN=1 OK + ${cfg.pin} TIMEOUT 2 ERROR-AT-OK + AT+CGDCONT=1,\042IP\042,\042internet\042 OK + ATDT*99***1# CONNECT + ''}" + ''; } diff --git a/tv/dummy_secrets/o2.pin b/tv/dummy_secrets/o2.pin new file mode 100644 index 000000000..53a3137cd --- /dev/null +++ b/tv/dummy_secrets/o2.pin @@ -0,0 +1 @@ +AT -- cgit v1.2.3