Finally, after a few posts, and a lot of work, our testing device (ie our dev board and our ESP) can be a complete sender. As a reminder at first our device will receive images from our server but we also wanted it to be able to send data to another device. Since my last post here are the issue I faced and the solutions I found.
The first issue was to send the data to the other device once we got its topic. To ensure we send the correct amount of byte, I wrote a python script that played the role of our second device.… Read more
As I wrote in my previous posts, the ESP, the STM and the server were working together to receive images or animations depending of what the user wants. Now it’s time for the STM to become the sender.
We want the devices to be able to received images from the server but we also want to establish a connection between Touchs to send images from one to the other. On top of that at the end we want to have a communication between both devices in both ways. But as you may know chi va piano va sano. So first things firts, we implemented the emitting part for the first device.… Read more
So far, the ESP32 was able to receive images from the server through MQTT and transmit them to the STM32. It also could transmit animations but only if the animation was directly hardcoded. So what we wanted to do was to be able to transmit animations through MQTT just like images and also to find a way to chose if we want to receive an animation or an image.
First things first : the server side
The first step we did to go in this direction was to find a way to transmit animations.
We chose that, at least for now, the server will publish periodically on two topics.… Read more
As I already wrote on previous post, we implemented a MQTT communication to send data from the server to the ESP, we also implemented an UART communication to pass data from the ESP to the STM. Now it is time to go all the way : sending data from the server all the way to the STM.
To do so we had to make a choice: at which point will we encode the data in regard of the communication protocol between ESP and STM.
As a remainder, to be able to differentiate data from commands, the bytes that will contain data will always start with a 1 and then code the state of 7 marbles.… Read more
Now that the Hall effect sensor is working and while the coils are still being tested with the marbles, we started working on our WiFi module. As explained in our project’s presentation, we want our devices to be able to communicate through MQTT with a backend and with other Touch.
The WiFi module :
To do our test we took an ESP32 Wroom-32 Dev kit C. The main purpose of this module will be to connect to the WiFi, receive through MQTT the images that the box will display and then transmit them to the STM32. In some cases, the STM32 will send to the ESP the state of the box and it will have to transfert those data through MQTT.… Read more
One of the most critical part of the project will be the communication. Whether it is between the Touchs of with the backend we need our device to be able to communicate.
The communication challenge:
The first thing we had to do was to choose the protocol. As we wanted to allow both a communication with a backend and between devices, we chose the MQTT protocol. It has the advantages to be easy to use and to easily allow us to switch from listening to the server to listening an other device.
The first step: the broker:
In MQTT, all devices (may it be a server or an actual connected thing) are clients.… Read more