My Python Working Notes

Most Python programming books cover the basics of python programming but don’t always deal very much with practical implementation and usage. As someone who is relatively new to python I come across lot’s of things that are probably obvious for an experienced programmer but not so obvious when you are just starting out.

Continue reading

MQTT Brokers and Cloud Hosting Guide

In order to use MQTT you require an MQTT broker. The broker (server) is the central hub of an MQTT network as shown in the diagram below.. When it comes to choosing an MQTT broker you have three main options: Use your Own Locally Installed Broker/Server Use a Cloud Based Sever or Virtual Server Use a Shared Server Application

Continue reading

Creating an IOT or MQTT Dashboard Using Thingsboard

Thingsboard is an open source IOT platform for data visualization. It is available for download and installation on your own hardware or as an online service for demonstration purposes. In this tutorial we will configure a simple Dashboard to display data from sensors using MQTT and Python.

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

Understanding MQTT QOS Levels- Part 1

MQTT provides 3 QOS levels- QOS 0 – Once (not guaranteed) QOS 1 – At Least Once (guaranteed) QOS 2 – Only Once (guaranteed) The QOS levels are a way of guaranteeing message delivery and they  refer to the connection between a broker and a client. In this two part tutorial we will look in detail at the message flow when publishing using all three QOS levels. We also look at the advantages and disadvantages of using the various levels

Continue reading

Paho Python MQTT Client – Understanding Callbacks

Callbacks are functions that are called in response to an event. The events and callbacks for the Paho MQTT client are as follows: Event Connection acknowledged Triggers the on_connect callback Event Disconnection acknowledged Triggers the on_disconnect callback Event Subscription acknowledged Triggers the  on_subscribe callback Event Un-subscription acknowledged Triggers the  on_unsubscribe callback Event Publish acknowledged Triggers the on_publish callback Event Message Received Triggers the on_message callback Event Log information available Triggers the on_log callback

Continue reading

Configure a Mosquitto Bridge With SSL Encryption

It is very likely that a bridged connection between two brokers will be encrypted. The Mosquitto broker (server) provides two methods of using SSL encryption on a bridged connection Certificate encryption PSK encryption In this tutorial we will be configuring a secure bridged connection using both methods. If you are new to certificates then you should read this tutorial on SSL encryption and certificates before continuing.

Continue reading

Guide to IOT Networking and Messaging Protocols

The Internet of things (IOT) will utilize the existing networking infrastructure, technologies and protocols currently used in homes/offices and on the Internet, and will introduce many more. The purpose of this tutorial is to give you a quick overview of what networking and application protocols are likely to be used to build the IOT.

Continue reading