Skip to content

Ramonmelod/elevator-mqtt-monitor

Repository files navigation

MQTT project

logo python logo mosquitto

Used Technologies:

  • Eclipse-Mosquitto MQTT broker
  • Python

Author

Mqqt basic implementation

  • Info: This project is under construction and compose.yml is not ready yet

Instructions:

Installing dependencies and running MQTT broker on docker

  • To install dependencies run: pip install -r requirements.txt

  • Before running moquitto on docker erase: password_file /mosquitto/config/pass from the file mosquitto.conf then run the comand bellow mapping the path for your file mosquitto.config on your computer.

  • for downloading mosquito run: docker run --name mosquitto -it -p 1883:1883 -p 9001:9001 -v ~/Projects/elevator-mqtt-monitor/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto (check the path to the file mosquitto.conf on your computer) ( this command will downloand the lastest eclipse-mosquitto version)

  • After running mosquitto on docker access the shell from the mosquitto container by the command: sudo docker exec -it

  • Inside your container run the following commad for defining a User and a Password: mosquitto_passwd -c /mosquitto/config/pass

  • Stop the conainer and rewrite inside the file mosquitto.conf: password_file /mosquitto/config/pass

installing Mosquitto broker on your ubuntu

  • After running: sudo apt-get update -y && sudo apt-get upgrade -y

run the comands bellow: sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install mosquitto sudo apt-get install mosquitto-clients

  • After the instalation of the mosquito and mosquitto-clients on your ubuntu you can test your broker running on the docker container by running the comands bellow:
  • mosquitto_sub -t "test"
  • mosquitto_pub -m "Mensagem" -t "test"

Setting a virtual environment for python:

  • To set a virtual environment for python run the command:
  python -m venv environment_name

then:

  source environment_name/bin/activate

Using a Esp32 to monitor a sign

  • the file esp32publisher.py shell be used as code for micropython on a esp32
  • this project uses the uses: ESP32_GENERIC-20240222-v1.22.2. You can try other version of micropython, but risks of unexpected behavior are always possible

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages