12 063
правки
(Новая страница: «The first time we connect from the controller to the server manually: <pre>ssh remote@vpn.mydomain.com </pre>») |
|||
(не показано 15 промежуточных версий этого же участника) | |||
Строка 312: | Строка 312: | ||
<pre>ssh remote@vpn.mydomain.com </pre> | <pre>ssh remote@vpn.mydomain.com </pre> | ||
On the controller, create a file <code>\etc\systemd\system\autossh.service</code> to run it <code>autossh</code> as a service: | |||
Строка 335: | Строка 335: | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
</pre> | </pre> | ||
Add service to autorun on the controller | |||
<pre>systemctl enable autossh.service</pre> | <pre>systemctl enable autossh.service</pre> | ||
After starting the service, we can connect to the controller on the server using the command | |||
<pre>ssh 127.0.0.1 -p 62001</pre> | <pre>ssh 127.0.0.1 -p 62001</pre> | ||
== | == Data transfer from controller to the cloud == | ||
To send MQTT messages from the controller to the cloud service, the MQTT bridge is used, the configuration of which is configured on the controller in the file <code>\mnt\data\etc\mosquito\conf.d\bridge.conf</code> | |||
<pre> | <pre> | ||
connection wb_devices_cloud.wb_A7ZO7UCC | connection wb_devices_cloud.wb_A7ZO7UCC | ||
Строка 359: | Строка 359: | ||
</pre> | </pre> | ||
Then run the command | |||
<pre> | <pre> | ||
Строка 366: | Строка 366: | ||
If you want to transfer data to multiple servers at the same time, create multiple <code>connection</code>partitions. | |||
== | == Possible GPRS connection problems == | ||
There can be several possible reasons for the lack of GPRS connection. | |||
* | * The paid traffic limit has ended. | ||
* | * Low voltage, poor contact to the antenna. | ||
* | * SIM cards of some operators are designed only for 4G-network, 3G-connection to install them will not work. | ||
* | * Check if the SIM card is inserted correctly into the slot. | ||
* | * The SIM card may not be working. | ||
* | * Your data plan does not include packet data. | ||
Before you go to your personal account and call the provider, you can perform a number of simple checks. | |||
Run the command | |||
<pre>gammu networkinfo</pre> | <pre>gammu networkinfo</pre> | ||
Строка 396: | Строка 396: | ||
</pre> | </pre> | ||
It is important that the controller is connected to the packet data network <pre>(GPRS : attached)</pre> and GPRS connection is established. | |||
Then evaluate the signal strength in minicom with <code>AT+CSQ</code> | |||
You will get the result as <code>13.99</code> | |||
The first digit shows the signal strength: > 9 — satisfactory, > 14 — good, > 19 — excellent. Low and unstable CSQ values mean that the antenna is poorly positioned, carelessly connected, radio placement is unfavorable. | |||
If both checks are passed, but there is no connection, contact your provider (check in your personal account), you can check the SIM card in your smartphone. |
правки