Logging MQTT Sensor Data Using Python

In this project we will create a simple data logger that logs IOT sensor/device data in JSON format to a text log file. The project Consists of two main modules. A logger class module mlogger.py The logging script mqtt-data-logger.py It also has helper module commands.py  which gets and parses command line arguments. Note: There is also the Simple Python MQTT Topic Logger which logs data based on topic that may be more suitable for your project. Logger Class The class is implemented in a module called m_logger.py (message logger). It can be used for logging data from any source not

Continue reading

Simple Python MQTT Sensor Simulator

If you are trying to learn MQTT or are working on a MQTT prject then having access to real time data is very important. The aim of this project is to create a very simple two state binary sensor, that can be controlled externally using MQTT. The sensor could be used to simulate real world objects like lights, doors etc that have two states on or off, open or closed etc in IOT projects.

Continue reading