This a very primitive module to demonstrate the flexibility of node-red.
Here node-red flow executes on an edge IOT device to get battery status
Here the edge device used is an Android Mobile. The status is informed to a raspberry-pi where Mycroft an open source assistant is deployed.
Node-red is low level flow based programming tool that can be programmed using a browser.
Mycroft is open source voice assistant that can be deployed in variety of devices.
Communication to mycroft is established through its Messagebus i.e. through a WebSocket port
To make an android mobile capable of running node red and get some data, we need Termux, Termux API and related packages.
- Follow links 1 and 2 and install Termux, Termux API and related packages
- Install node-red on Android by following link 3
- Decide the device to deploy mycroft and follow link 4 or 5
- After deploying mycroft, get the IP Address of the device
- From this repo, copy the raw text of the file 'MobileFlow.txt'
- Open node-red console module either in the same device's browser or different device's browser connected in the same network through the link http://localhost:1880 or http://<IP_Address_Of_Edge_Device>:1880/
- In the browser working palette, find menu option. Click Import. In the dialog box, select clipboard option and paste the clipboard contents.
- Double click WebSocket node and modify IP_Address_Of_Mycroft_Deployed_Device to the one obtained in step 3. If same device. put 'localhost'
- Click Deploy
- When deployed, the WebSocket node should say 'Connected'. Else, the flow need to be verified
- Adjust the threshold of battery in Switch node to the level you need. Now it is 70.
- Redeploy and observe that after the mobile battery reaches below the threshold level mycroft instructs to plug the charger.