This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
technical:mqtt-hands-on [2022/06/22 05:47] admin [Predefined Commands] |
technical:mqtt-hands-on [2022/06/25 17:36] (current) admin |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== Background ===== | ===== Background ===== | ||
* Although the heartbeat system used in MESHdesk / APdesk allows for remote command execution there might be situations where you need the immediate command execution. | * Although the heartbeat system used in MESHdesk / APdesk allows for remote command execution there might be situations where you need the immediate command execution. | ||
- | * Security is a big thing where I stay and with this hands on lab we will see how to make use of the MQTT implementation to switch outdoor lights remotely on and off. | + | * Security is a big thing where I stay and with this hands on lab we will see how to make use of the MQTT implementation to switch outdoor lights remotely on and off using one of the mesh nodes' GPIOs |
* For this lab we have: | * For this lab we have: | ||
* MESHdesk managing a mesh network that has the following hardware | * MESHdesk managing a mesh network that has the following hardware | ||
Line 13: | Line 13: | ||
* One will be installed at the **driveway**. | * One will be installed at the **driveway**. | ||
* One will be installed at the **backyard**. | * One will be installed at the **backyard**. | ||
- | | + | {{: |
+ | |||
+ | <WRAP center round tip> | ||
+ | | ||
+ | * In this mesh network we have **Xiaomi** which are Mediatek based and currently sold in many places. | ||
+ | * We also have **Dragino** which are Atheros based and have been on the market for more than a decade. | ||
+ | |||
+ | </WRAP> | ||
===== GPIO Pins of Dragino MS14 ===== | ===== GPIO Pins of Dragino MS14 ===== | ||
Line 32: | Line 40: | ||
===== GPIO Helper Scripts ===== | ===== GPIO Helper Scripts ===== | ||
* The latest version of the MESHdesk firmware includes the following folder **/ | * The latest version of the MESHdesk firmware includes the following folder **/ | ||
- | * There we will keep handy scripts for GPIO management. | + | * There we will keep helper |
* The following is currently there: | * The following is currently there: | ||
* / | * / | ||
Line 38: | Line 46: | ||
* If we want to set GPIO 18 on the Dragino we can issue the following **/ | * If we want to set GPIO 18 on the Dragino we can issue the following **/ | ||
* To clear it **/ | * To clear it **/ | ||
- | * If we want to flash (on-off) GPIO 18 a couple of times. **/ | + | * If we want to flash (on-off) GPIO 18 a couple of times: **/ |
* The default on-off transition is with one second intervals. There is an optional parameter where you can set the interval in seconds. | * The default on-off transition is with one second intervals. There is an optional parameter where you can set the interval in seconds. | ||
* / | * / | ||
Line 52: | Line 60: | ||
* We added the following commands for our three lights. | * We added the following commands for our three lights. | ||
{{: | {{: | ||
- | * Note that we did not make those commands available to sub-providers. This way we can keep certain predefined commands private to an access provider. | + | * Note that we did not make those commands available to sub-providers. This way we can keep certain predefined commands |
+ | * These commands can now be used when defining schedules e.g. if you want to set the lights on and off on certain times or when you want to send the command to the mesh node or access point immediately. | ||
+ | |||
+ | Since this is a page about hands on work we end with a demonstration video showing things in action. | ||
+ | |||
+ | ===== In action video ===== | ||
+ | {{youtube> | ||