See the overall project Wiki for project details and schedule.
Custom Yocto image on Raspberry Pi acts as an Edge device, communicating with legacy hardware over UART. Tx/Rx communication is transmitted via MQTT pub/sub protocol to a cloud hosted broker. A seperate client, on a different network, running the Python GUI can transmit and receive messages from the legacy hardware.
This repository contains two applications:
- Desktop GUI application written in Python3 using Tkinter
- Embedded target application written in C using Paho
Example usage of the mqttify program:
usage: mqttify [-f serial_port] [-d]
-f, --file : a serial port device to read/write data to (required)
-d, --daemon : run this process as a daemon
example:
mqttify --file /dev/ttyAMA0 --daemon
The application for the embedded target contains a Makefile which will build the executable. Presence or absence of the TARGET_BUILD flag will change the location that the program expects a passwd.txt
file as follows:
- TARGET_BUILD is unset, passwd.txt is expected in the same directory that you are launching the executable from.
- TARGET_BUILD is set, passwd.txt is expected at
etc/mqttify/passwd.txt
.
The passwd.txt file should contain the following contents:
<username>
<password>
The embedded target application is included as a part of this custom Linux distribution which is built with Yocto for the Raspberry Pi 4B. Further details for the overall project are included in that repository.
I have provided a pipfile which outlines the dependencies. If you use pipenv
, then you can simply navigate to the location you have cloned this git repository and:
cd ./desktop-gui
pipenv install
pipenv shell
./mqttify-gui-app.py
If you don't use pipenv
, you can install the dependencies system-wide with pip: pip3 install paho-mqtt
. Then run with ./mqttify-gui-app.py
.