• Stars
    star
    555
  • Rank 80,213 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.

Introduction

MQTT is an easily used networking protocol designed for IOT (internet of things) applications. It is well suited for controlling hardware devices and for reading sensors across a local network or the internet.

It is a means of communicating between multiple clients. A single server, also known as a broker, manages the network. Clients may include ESP8266, ESP32 and Pyboard D modules and other networked computers. Typical server hardware is a Raspberry Pi or other small Linux machine which may be left running 24/7. Public brokers also exist.

An effective PC client and server is mosquitto.

This repository

This contains two separate projects:

  1. A "resilient" asynchronous non-blocking MQTT driver.
  2. A means of using a cheap ESP8266 module to bring MQTT to MicroPython platforms which lack a WiFi interface. This is now obsolescent.

1. The "resilient" driver

This is an alternative to the official driver. It has been tested on the following platforms.

  1. ESP8266
  2. ESP32, ESP32-S2 and ESP32-S3
  3. Pyboard D
  4. Arduino Nano Connect
  5. Raspberry Pi Pico W

The principal features of this driver are:

  1. Non-blocking operation for applications using uasyncio.
  2. Automatic recovery from WiFi and broker outages.
  3. True qos == 1 operation with retransmission.
  4. Improved WiFi range because of its tolerance of poor connectivity.

It has the drawback of increased code size which is an issue on the ESP8266. Run as frozen bytecode it uses about 50% of the RAM on the ESP8266. On ESP32 and Pyboard D it may be run as a standard Python module.

mqtt_as documentation.

2. MQTT bridge for generic MicroPython targets

This is obsolescent. It dates from a time when the only WiFi capable MicroPython target was the ESP8266. For all new applications one of the many WiFi-capable targets should be used with mqtt_as.

This comprises an ESP8266 firmware image and a MicroPython driver. The target hardware is linked to an ESP8266 running the firmware image using a 5-wire interface. The driver runs on the target which can then access MQTT. The driver is non-blocking and is designed for applications using uasyncio.

This library is in the bridge directory and is documented

here

It works and is supported, but its days are numbered unless someone reports a definite use case.

More Repositories

1

micropython-async

Application of uasyncio to hardware interfaces. Tutorial and code.
Python
714
star
2

micropython-nano-gui

A lightweight MicroPython GUI library for display drivers based on framebuf class
Python
459
star
3

micropython-samples

Assorted code ideas, unofficial MP FAQ, plus index to my other repositories.
Python
443
star
4

micropython-font-to-py

A Python 3 utility to convert fonts to Python source capable of being frozen as bytecode
Python
370
star
5

micropython_ir

Nonblocking device drivers to receive from IR remotes and for IR "blaster" apps.
Python
239
star
6

micropython-micro-gui

A lightweight MicroPython GUI library for display drivers based on framebuf, allows input via pushbuttons. See also micropython-touch.
Python
237
star
7

micropython-iot

An approach to designing IOT applications using ESP8266, ESP32 or Pyboard D endpoints
Python
86
star
8

micropython-tft-gui

Simple GUI for Pyboard and TFT touch panel displays
Python
85
star
9

micropython-fourier

Fast Fourier transform in MicroPython's inline ARM assembler.
Python
76
star
10

micropython_eeprom

MicroPython device drivers for memory chips (EEPROM, FRAM, Flash, SPIRAM)
Python
70
star
11

micropython-filters

Digital filters impemented in MicroPython's inline ARM Thumb assembler (e.g. Pyboard, RP2).
Python
64
star
12

micropython_remote

Capture and replay 433MHz remote control codes. Control remote switched power adaptors.
Python
64
star
13

micropython-epaper

Driver for 2.7 inch Adafruit and Embedded Artists e-paper displays
Python
60
star
14

micropython-radio

Simple way to use an nRF24L01 radio to exchange arbitrary Python objects between two Pyboards
Python
52
star
15

micropython-micropower

Support for building ultra low power systems based on the Pyboard (1.x and D series).
Python
44
star
16

micropython-lcd160cr-gui

Touch GUI for the official MicroPython LCD display
Python
28
star
17

micropython-monitor

Display the behaviour of a realtime program with a scope or logic analyser.
Python
28
star
18

micropython-msgpack

MessagePack serialisation library optimised for MicroPython
Python
26
star
19

micropython_data_to_py

A Python3 utility to convert an arbitrary binary file to Python source for storage in Flash
Python
26
star
20

micropython-vs1053

Synchronous and asynchronous drivers for VS1053b MP3/FLAC player
Python
25
star
21

micropython-touch

A GUI for touch panel displays.
Python
18
star
22

micropython-amg88xx

Driver for Grid-EYE thermal infra red array sensor (Adafruit 3538)
Python
18
star
23

micropython_ra8875

MicroPython device driver and nano-GUI for RA8875 based displays
Python
9
star