Lab 11: IoTempower
In this lab, install and use the IoT Framework IoTempower.
Refer to IoTempower's main repository.
This lab needs a Linux installation with a working network connection that exposes (not blocks and eventually forwards) the ports 1880, 1883, 8001, and 8266 (this one as UDP and TCP) inside the local network your computer is connected to. If the first part of Lab 10 was successful, you should face no major problems in this lab.
If you use WSL 2, there could be problems with accessing the over the air update (OTA) function. Therefore we suggest using WSL 1 instead. A native Linux or virtual machine with bridged network should have no problems. You should also test if you can access the serial port from your Linux machine - this should be (apart from maybe some permission problems) work out of the box in native Linux and should also work ok in WSL 1 (in a virtual machine you have to forward/pass-through usb devices to the machine). If you are successful with WSL 2, both with networking and also flashing via serial ports on the host Windows machine, please share your journey and let us consider giving extrapoints for that.
We also highly encourage you to use the lab WiFi router in this lab or your own cell phone hotspot (mciot, ask for password your instructor).
Please scroll down for a second and take a look at the last task to get an idea where all your work will lead today. You will finish this lab with a full fledged access control system.
1. Installing IoTempower
Follow the IoTempower installation manual and do all subtasks (1-5) described there.
2. Exploring IoTempower Services and Commands
- Study about tool support in IoTempower - Which commands are there, write down your first idea what they do and if or where you could use them (some of them give you extra information, when you call them with help)
- Start the documentation server (
iot doc serve
). Attention, the search does not work as it is a local webserver without CGI support (extra credit for good suggestion/PR to make the python webserver do CGI). Open "Commands" and search how to use the rfid reader, PWM, a servo motor, ultrasonic distance sensor (RCWL-1601), and a single rgb led (you probably don't even need Google here, but if you are interested about more, feel free to find some more information about the hardware you are actually using) - note the example code you intend to use for both as well as some important remarks about wiring. - Start the mqtt broker from IoTempower. It will complain about IP-Address settings. These will later (in next task) be derived automatically, but for now type the following before starting the broker and mqtt tools:
export IOTEMPOWER_MQTT_HOST={your-ip-address_here}
and show that it works with usingmqtt_listen
andmqtt_send
- Start your own Node-RED service (as in Lab 10) and make it listen to a mqtt topic and display values on a chart in the dashboard. Show that it is connected to the mqtt broker from IoTempower sending several values with
mqtt_send
to that topic. - Optional: write a script (in Windows you might have to use powershell) that opens and starts all necessary services (maybe even detects the correct IP addresses and puts them into system.conf or iotempower.conf) with just one command - Extrapoint for sharing your solution to this point
3. First Node
Follow the First Node manual and do all subtasks. For the step "Next deployments" connect the node to external USB power as suggested and show that the deploy step still works.
4. Second Node
Follow the manual here and do all subtasks.