From 9a855289a16964e131e2554887bb781433aefb40 Mon Sep 17 00:00:00 2001 From: Giulio Date: Tue, 16 Jul 2019 14:13:42 +0200 Subject: [PATCH] Updated config and readme --- README.md | 41 +++++++++++++++++++++++++++++----------- agent/config/api.ini | 2 -- agent/config/api.json | 4 ++++ agent/config/gsm.json | 19 +++++++++++++++++++ agent/gsm.ini | 4 ---- frontend/config/api.ini | 1 - frontend/config/api.json | 3 +++ 7 files changed, 56 insertions(+), 18 deletions(-) delete mode 100644 agent/config/api.ini create mode 100644 agent/config/api.json create mode 100644 agent/config/gsm.json delete mode 100644 agent/gsm.ini delete mode 100644 frontend/config/api.ini create mode 100644 frontend/config/api.json diff --git a/README.md b/README.md index 5c1d6a7..c1580f6 100644 --- a/README.md +++ b/README.md @@ -27,26 +27,45 @@ The NanoPI Neo2 is used for controlling the GSM modules. Any other device which The code is written in python and simply opens a serial connection with any modem to check for incoming messages. When messages are found, the agent will send a put request with the message's sender and text to the web fronted which can be either hosted on the same machine or elsewhere ## Config -Numbers needs to be specified because most of the times they aren't written on the sim card. Sim cards may be hotswapped, but if this config isn't updated the wrong receiving number will be displayed on the frontend. +Numbers needs to be specified because most of the times they aren't written on the sim card. Sim cards may be hotswapped, but if this config isn't updated the wrong receiving number will be displayed on the frontend. `imei` is optional and if specified it will cause the agent to run ```AT+EMGR=1,7,"imei"``` on the target modem. -*agent/config/gsm.ini* +*agent/config/gsm.json* ``` -/dev/ttyUSB0 +393409821322 -/dev/ttyUSB1 +443312123452 -/dev/ttyUSB2 +913446435634 -/dev/ttyUSB3 +12456345344 +[ + { + "dev":"/dev/ttyUSB0", + "msisdn":"+393409821322", + "imei":"990000862471854" + }, + { + "dev":"/dev/ttyUSB1", + "msisdn":"+443312123452" + }, + { + "dev":"/dev/ttyUSB2", + "msisdn":"+913446435634" + }, + { + "dev":"/dev/ttyUSB3", + "msisdn":"+12456345344" + } +] ``` Hostname and secret key used for updating the frontend. May as well be http://127.0.0.1 -*agent/config/api.ini* +*agent/config/api.json* ``` -https://sms.lsd.cat -supersecretegakey1234123 +{ + "url":"https://sms.lsd.cat", + "key":"supersecretegakey1234123" +} ``` -*frontend/config/api.ini* +*frontend/config/api.json* ``` -supersecretegakey1234123 +{ + "key":"supersecretegakey1234123" +} ``` \ No newline at end of file diff --git a/agent/config/api.ini b/agent/config/api.ini deleted file mode 100644 index 86e8b37..0000000 --- a/agent/config/api.ini +++ /dev/null @@ -1,2 +0,0 @@ -https://sms.lsd.cat -supersecretegakey1234123 diff --git a/agent/config/api.json b/agent/config/api.json new file mode 100644 index 0000000..8652093 --- /dev/null +++ b/agent/config/api.json @@ -0,0 +1,4 @@ +{ + "url":"https://sms.lsd.cat", + "key":"supersecretegakey1234123" +} \ No newline at end of file diff --git a/agent/config/gsm.json b/agent/config/gsm.json new file mode 100644 index 0000000..bc0f418 --- /dev/null +++ b/agent/config/gsm.json @@ -0,0 +1,19 @@ +[ + { + "dev":"/dev/ttyUSB0", + "msisdn":"+393409821322", + "imei":"990000862471854" + }, + { + "dev":"/dev/ttyUSB1", + "msisdn":"+443312123452" + }, + { + "dev":"/dev/ttyUSB2", + "msisdn":"+913446435634" + }, + { + "dev":"/dev/ttyUSB3", + "msisdn":"+12456345344" + } +] \ No newline at end of file diff --git a/agent/gsm.ini b/agent/gsm.ini deleted file mode 100644 index f53b075..0000000 --- a/agent/gsm.ini +++ /dev/null @@ -1,4 +0,0 @@ -/dev/ttyUSB0 +393409821322 -/dev/ttyUSB1 +443312123452 -/dev/ttyUSB2 +913446435634 -/dev/ttyUSB3 +12456345344 diff --git a/frontend/config/api.ini b/frontend/config/api.ini deleted file mode 100644 index a7b40c8..0000000 --- a/frontend/config/api.ini +++ /dev/null @@ -1 +0,0 @@ -supersecretegakey1234123 diff --git a/frontend/config/api.json b/frontend/config/api.json new file mode 100644 index 0000000..98fcfb0 --- /dev/null +++ b/frontend/config/api.json @@ -0,0 +1,3 @@ +{ + "key":"supersecretegakey1234123" +} \ No newline at end of file