begin by installing these packages as :
apt update
apt upgrade
apt install git cmake make g++ autoconf automake libtool curl unzip python python-dev python-pip python3 python3-dev python3-pip mosquitto mosquitto-dev libmosquittopp-dev arduino
install protocol buffers from source
git clone https://github.com/protocolbuffers/protobuf.git
//
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure --prefix=/usr
make
make check
make install
ldconfig # refresh shared library cache.
then within python install:
pip install python3-protobuf protobuf paho-mqtt
pip3 install python3-protobuf protobuf paho-mqtt
cd /
git clone https://github.com/Kelvin-Weksa/Mqtt_Protobuf.git
cd Mqtt_Protobuf
git submodule init
git submodule update
mkdir build #the build folder MUST be named 'build'
cd build/
cmake ..
make
./cpp/cpp broker_ip subscribe_to publish_to
python3 ../python/paho_mqtt.py broker_ip subscribe_to publish_to
./../arduino-cli compile --fqbn esp8266:esp8266:generic ../Mqtt_Protobuf_Sketch/
./../arduino-cli upload -p /dev/ttyUSB0 --fqbn esp8266:esp8266:generic ../Mqtt_Protobuf_Sketch/ && stty -F /dev/ttyUSB0 raw 115200 && cat /dev/ttyUSB0
change as appropriate see arduino-cli
docker run -it --device=/dev/ttyUSB0 --device=/dev/ttyACM0 --net=host kelvinwekesa/debian-mosquitto:final
-
build: this is where the built application and generated files are located it MUST be named "build"
-
cpp: c++ program to subscribe and publish messages
-
examples: collection of working code snippets not related to our project
-
fmt: 3rd party libraly, unmodified
-
messages: CMakefile to build protobuf and generate c++ code
-
messages_embedded: CMakefile to build protobuf and generate arduino code
-
Mqtt_Protobuf_Sketch: Arduono code to subscribe and publish messages
-
MQTT_Publish: example code from recomended starter projec, unmodified
-
MQTT_Subscribe: example code from recomended starter project, unmodified
-
nanopb: 3rd party library, unmodified
-
protobuf_examples: example protobuf tutorial, not related to our project
-
python: Python script to subscribe and publish messages
-...