Updated config and readme

This commit is contained in:
Giulio 2019-07-16 14:13:42 +02:00
parent a564faf762
commit 9a855289a1
7 changed files with 56 additions and 18 deletions

View File

@ -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"
}
```

View File

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

4
agent/config/api.json Normal file
View File

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

19
agent/config/gsm.json Normal file
View File

@ -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"
}
]

View File

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

View File

@ -1 +0,0 @@
supersecretegakey1234123

3
frontend/config/api.json Normal file
View File

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