ef8f13fa8dc37c091e2f4fc7b0e90d2bfe140a35
Board/NGS/NGS1128-DAT/NGS1128-DAT.md
| ... | ... | @@ -20,7 +20,7 @@ Lead out all the function pins |
| 20 | 20 | |
| 21 | 21 | - Driver: [[git]] simcom_driver |
| 22 | 22 | - chip documentation: [[git]] SIMCOM_SIM70X0 |
| 23 | -- [[MQTT]] |
|
| 23 | +- [[mqtt-dat]] |
|
| 24 | 24 | - [[NGS1128]] |
| 25 | 25 | - [[SIMCOM-AT]] |
| 26 | 26 | - [[SIMCOM-AT-GNSS]] |
Tech/mqtt-dat.md
| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | + |
|
| 2 | +# mqtt dat |
|
| 3 | + |
|
| 4 | +## arduino library |
|
| 5 | + |
|
| 6 | +- async-mqtt-client-master |
|
| 7 | + |
|
| 8 | +- PubSubClient |
|
| 9 | + - https://github.com/knolleary/pubsubclient |
|
| 10 | + - examples/mqtt_esp8266.ino |
|
| 11 | + |
|
| 12 | +- radiolib |
|
| 13 | + |
|
| 14 | + |
|
| 15 | +## MQTT broker on ubuntu |
|
| 16 | + |
|
| 17 | +sudo apt install -y mosquitto |
|
| 18 | + |
|
| 19 | +sudo systemctl status mosquitto |
|
| 20 | + |
|
| 21 | + |
|
| 22 | +- Stop the mosquitto service: |
|
| 23 | + - $ sudo systemctl stop mosquitto |
|
| 24 | +- Start the mosquitto service: |
|
| 25 | + - $ sudo systemctl start mosquitto |
|
| 26 | +- Restart the mosquitto service: |
|
| 27 | + - $ sudo systemctl restart mosquitto |
|
| 28 | + |
|
| 29 | +### Log file |
|
| 30 | +* cat /var/log/mosquitto/mosquitto.log |
|
| 31 | + |
|
| 32 | +## Conf Setup list |
|
| 33 | +allow_anonymous false // not allow anonymous |
|
| 34 | +password_file /etc/mosquitto/passwd // set password |
|
| 35 | + |
|
| 36 | +listener 1883 // set port 1883 public, or listener 1883 localhost for localhost only |
|
| 37 | + |
|
| 38 | +listener 1884 // set 1884 for wss |
|
| 39 | +protocol websockets |
|
| 40 | + |
|
| 41 | + |
|
| 42 | + |
|
| 43 | + |
|
| 44 | +## MQTT client |
|
| 45 | + |
|
| 46 | +sudo apt install -y mosquitto-clients |
|
| 47 | + |
|
| 48 | +sub: |
|
| 49 | +mosquitto_sub -t "test" |
|
| 50 | + |
|
| 51 | +pub: |
|
| 52 | +mosquitto_pub -m "ON" -t "test" |
|
| 53 | + |
|
| 54 | +A number of my IoT students make use of (the FREE plan with) BeeBotte for their remote MQTT broker. |
|
| 55 | + |
|
| 56 | +https://beebotte.com/ |
|
| 57 | +It's very easy to set up and works really well with Nod-RED. |
|
| 58 | + |
|
| 59 | + |
|
| 60 | + |
|
| 61 | +## web test |
|
| 62 | +- https://www.emqx.io/mqtt/mqtt-websocket-toolkit |
|
| ... | ... | \ No newline at end of file |
Tech/mqtt.md
| ... | ... | @@ -1,62 +0,0 @@ |
| 1 | - |
|
| 2 | - |
|
| 3 | - |
|
| 4 | -## arduino library |
|
| 5 | - |
|
| 6 | -- async-mqtt-client-master |
|
| 7 | - |
|
| 8 | -- PubSubClient |
|
| 9 | - - https://github.com/knolleary/pubsubclient |
|
| 10 | - - examples/mqtt_esp8266.ino |
|
| 11 | - |
|
| 12 | -- radiolib |
|
| 13 | - |
|
| 14 | - |
|
| 15 | -## MQTT broker on ubuntu |
|
| 16 | - |
|
| 17 | -sudo apt install -y mosquitto |
|
| 18 | - |
|
| 19 | -sudo systemctl status mosquitto |
|
| 20 | - |
|
| 21 | - |
|
| 22 | -- Stop the mosquitto service: |
|
| 23 | - - $ sudo systemctl stop mosquitto |
|
| 24 | -- Start the mosquitto service: |
|
| 25 | - - $ sudo systemctl start mosquitto |
|
| 26 | -- Restart the mosquitto service: |
|
| 27 | - - $ sudo systemctl restart mosquitto |
|
| 28 | - |
|
| 29 | -### Log file |
|
| 30 | -* cat /var/log/mosquitto/mosquitto.log |
|
| 31 | - |
|
| 32 | -## Conf Setup list |
|
| 33 | -allow_anonymous false // not allow anonymous |
|
| 34 | -password_file /etc/mosquitto/passwd // set password |
|
| 35 | - |
|
| 36 | -listener 1883 // set port 1883 public, or listener 1883 localhost for localhost only |
|
| 37 | - |
|
| 38 | -listener 1884 // set 1884 for wss |
|
| 39 | -protocol websockets |
|
| 40 | - |
|
| 41 | - |
|
| 42 | - |
|
| 43 | - |
|
| 44 | -## MQTT client |
|
| 45 | - |
|
| 46 | -sudo apt install -y mosquitto-clients |
|
| 47 | - |
|
| 48 | -sub: |
|
| 49 | -mosquitto_sub -t "test" |
|
| 50 | - |
|
| 51 | -pub: |
|
| 52 | -mosquitto_pub -m "ON" -t "test" |
|
| 53 | - |
|
| 54 | -A number of my IoT students make use of (the FREE plan with) BeeBotte for their remote MQTT broker. |
|
| 55 | - |
|
| 56 | -https://beebotte.com/ |
|
| 57 | -It's very easy to set up and works really well with Nod-RED. |
|
| 58 | - |
|
| 59 | - |
|
| 60 | - |
|
| 61 | -## web test |
|
| 62 | -- https://www.emqx.io/mqtt/mqtt-websocket-toolkit |
|
| ... | ... | \ No newline at end of file |