Sometimes you have this need to keep an eye on important processes in your organization. While many would say “we need an app.” I think sticking some really small to the wall makes even more sense. Especially when you see the low investment of time and materials. This can be an afternoon project with a max. investment of EUR 35 i materials.
Below you can find what you need but you need some knowledge around MQTT etc. You want this and have no knowledge? We can help.
What do you need?
Or shopping list contains:
The details
We are not diving into every configuration of every module but we will provide you with the broad overview on how to use this.
Setting up the MQTT broker on Elest.io
This time we picked elest.io, these guys have a great collection of managed Open Source services.
You need to create an account and after that you are ready to setup a Service or CI/CD pipeline, it fully depends on your needs. The easiest way to start is setting it up as a service. When you click Create a new service and then search for MQTT you will find EMQX MQTT. You can easily install it and configure it with users client etc.
After installation elest.io will provide you with a temporary login. Elest.io takes care of all updates etc. Try to run it on the cheapest server you can find (Hetzner).
M5 Stack AtomS3
Now that you have setup the MQTT broker it’s time you worry about the tiny screen called AtomS3.
This is a tiny microcontroller with a 0,85 inch screen and an ESP32 microcontroller. All can be programmed with an online environment called UI Flow 2.
Sometimes getting UI Flow 2 to work can be a pain, most of it has to do with your WIFI signal. Make sure to use a 2.4 GHZ channel.
After the configuration of UI Flow 2 and binding the device (all info on the M5stack site) you are ready to hook it up. Below UI Flow 2 diagram shows how to do it. What you want to do is Subscribing to a topic so that the tiny display can be updated all the time with information.
I took me a while to get it done, although M5stack has great hardware their documentation is not very detailed. The crucial point to get Subscribe working is using the MQTT apply for messaging in the loop. This is really needed to get it working. We highlighted it in red.
Some remarks from my side:
you cannot change WIFI credentials on the fly, for some reason UI Flow 2 does not support ESP Touch;
make sure to be nearby a good connection;
don’t get frustrated, in the end this can be useful for many projects where you need to keep an eye on stuff.
How to test it?
The easiest way to the the MQTT stuff is setting up a desktop client like MQTTX which can be downloaden here.
You need to do the following:
connect to the EMQX broker with the desktop client;
download the UI Flow 2 code to the AtomS3;
publish a message to topic demo.
If all works you should see the message in the bottom of the tiny screen.