Browse Source

Updated config and readme

Giulio 4 years ago
parent
commit
9a855289a1
7 changed files with 56 additions and 18 deletions
  1. 30 11
      README.md
  2. 0 2
      agent/config/api.ini
  3. 4 0
      agent/config/api.json
  4. 19 0
      agent/config/gsm.json
  5. 0 4
      agent/gsm.ini
  6. 0 1
      frontend/config/api.ini
  7. 3 0
      frontend/config/api.json

+ 30 - 11
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"
+}
 ```

+ 0 - 2
agent/config/api.ini

@@ -1,2 +0,0 @@
-https://sms.lsd.cat
-supersecretegakey1234123

+ 4 - 0
agent/config/api.json

@@ -0,0 +1,4 @@
+{
+   "url":"https://sms.lsd.cat",
+   "key":"supersecretegakey1234123"
+}

+ 19 - 0
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"
+   }
+]

+ 0 - 4
agent/gsm.ini

@@ -1,4 +0,0 @@
-/dev/ttyUSB0 +393409821322
-/dev/ttyUSB1 +443312123452
-/dev/ttyUSB2 +913446435634
-/dev/ttyUSB3 +12456345344

+ 0 - 1
frontend/config/api.ini

@@ -1 +0,0 @@
-supersecretegakey1234123

+ 3 - 0
frontend/config/api.json

@@ -0,0 +1,3 @@
+{
+   "key":"supersecretegakey1234123"
+}