3209 views|5 replies

1w

Posts

25

Resources
The OP
 

MQBoard - MicroPython microframework for managing MQTT [Copy link]

 This post was last edited by dcexpert on 2020-6-24 09:02

About the Author :

My projects are on the infrastructure side, with microcontrollers that work for a long time somewhere, sometimes a decade. At the same time, a lot of these projects are experimental in nature, and I keep tweaking them even after they are "deployed" and "in production". So I need a robust framework that allows me to remotely see what's happening on the board, sometimes perform interactive troubleshooting, and update software. And have high reliability, so that even if I make a mistake, I won't lose connection to the board or management rights. In this context, MQBoard is needed.

MQBoard contains the following:
  • MQTT client library using the new uasyncio, handling disconnects and retransmissions, and supporting the data rates required for OTA upgrades (1.5MB transfers...)
  • A set of python files to boot a board, provide safe mode on errors, log via MQTT, provide REPL access and launch modular applications
  • An MQ REPL task that provides access to the flash file system, REPL and OTA and upgrades over MQTT
  • Similar to pyboard.py file, plus OTA update, log viewing and file synchronization
  • A simple blinky demo application
Right now MQBoard only works on esp32. I want to make it work on PYBD but don't have the time yet. It doesn't run on esp8266 because there is not enough memory.

All content

is designed for the following systems:

  • Running in some remote location and need to be managed from remote, i.e. without plugging them into a USB port on some computer
  • Use a single encrypted connection, specifically the MQTT connection to the broker.

By using a single connection, only one set of TLS buffers is required (20KB per connection!), and there are no certificates to maintain. There are also no open ports for attackers to target.

The above goals make the following features desirable:

  • Everything must be designed to remain operational 24x7 and recover from failures.
  • REPL Access: Ability to access the repl on the board over MQTT in order to run diagnostics, perform upgrades, or troubleshoot.
  • OTA updates: Ability to send MicroPython firmware updates over MQTT.
  • Modules: Ability to easily add or update functional modules with minimal impact on existing modules.
  • Ideally, remote logging would be everything printed to a serial console via MQTT.
  • Log the crash to some local persistent storage so that the crash can be analyzed remotely after a board reset.
  • A watchdog timer and safe mode after consecutive crashes to ensure the board is always up and accessible via MQTT even if the application behaves abnormally.

Currently, all of these features are implemented, except for crash logging to local storage.

Issues

The main issue is low power operation. Power is not currently considered, and in particular boot time is not optimized to achieve periodic wake-up operation from the battery. OTA firmware upgrades and safe mode are not currently integrated, which means that OTA upgrades require more attention and thought than they should. The mqtt_async implementation attempts to be compatible with Peter Hinch's, and it is time to deprecate mqtt_as so that the board/mqtt.py functionality can be integrated directly , so that the management of Wifi can be separated.

Project Repository

游客,如果您要查看本帖隐藏内容请回复

Latest reply

6666666666666666666666......   Details Published on 2021-6-20 23:03
 
 

4

Posts

0

Resources
2
 
Want to see
 
 
 

96

Posts

0

Resources
3
 

Return again

 
 
 

10

Posts

0

Resources
4
 
Is it usable?
 
 
 

3

Posts

0

Resources
5
 

have a look

 
 
 

1

Posts

0

Resources
6
 

6666666666666666666666......

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list