Presto as MQTT subscriber device

@SirFico Thank you for your asistance!

About the sequence.

The MQTT message is received by the mqtt_callback() function.

Then it is handled in a function called split_msg()

At the end of split_msg, the data of the message is copied to a record:

   record = {

        "topic": topic,
        "topicIdx": topicIdx,
        "t": uxTime,
        "rcvd": dtStr,
        "hd": head,
        "payload": payload
    }

converted into json and save to a json file on SD-Card.

Next the data from the message is displayed in a draw() function.

Btw: about the Presto fw v1.0. I just flashed it to my Presto.

@MikeB_50 Thank you Mike!

@SirFico I must say, since I changed the script into using hires and the more hires font, using vector.text() (and also after updating to fw v1.0, I don’t see the vertical artifact lines, in this moment.

Here is the Thonny Shell output of my latest version of the script (v9a):

>>> %Run -c $EDITOR_CONTENT

MPY: soft reboot
global(): error class object created. It is of class: <class 'ERR'>
file: "sys_broker.json" has been reset.
topicIdx_max = 7
BROKER = 192.168._.___
PORT = 1883
CLIENT_ID = b'PrestoMQTTClient'
PUBLISHER_ID0 = Feath
PUBLISHER_ID1 = PL2XLW
main(): Connecting to WiFi...
main(): WiFi connected.
NP_clear(): 🌈 ambient neopixels off
get_disp_color_idx(): pen_colorIdx set to: 3
setup(): disp_obj.disp_color_index = 3
setup(): Display hours wakeup: 7, gotosleep: 23
setup(): Connecting to MQTT local broker on port 1883
setup(): Not deleting log files, flag: "delete_logs" = False
setup(): Successfully connected to MQTT broker.
mqtt_callback(): $SYS topic_rcvd: "$SYS/broker/clients/connected", payloadStr: "2"
--------------------------------------------------

mqtt_callback(): Received a mqtt message on topic: "sensors/Feath/ambient", timestamp: 1757276033 = 2025-09-07T21:13:53+01:00
mqtt_callback(): length of received mqtt message: 256
split_msg(): header fields:
split_msg(): owner:        Feath
split_msg(): description:  Lab
split_msg(): device_class: BME280
split_msg(): state_class:  measurement
split_msg(): msgID:        1757276033
split_msg(): in ISO8601:   2025-09-07T21:13:53+01:00
clear_file_if_too_large(): received msg records on file: 42
split_msg(): 🧹 Not needed to cleanup messages history file
prep_and_save_record_to_sd(): Attempting to write to file: '/sd/msg_hist.json'
split_msg(): ✅ record saved to file on SD
loop(): MQTT message received
draw(): Temperature: 28.8 °C
draw(): Pressure: 1006.7 mB
draw(): Altitude:  79.7 m
draw(): Humidity:  51.6 %
--------------------------------------------------
mqtt_callback(): $SYS topic_rcvd: "$SYS/broker/clients/connected", payloadStr: "3"

Hi Buccaneers, I just added to this repo in src/Publisher2 a version V2. The MicroPython script of this version contains code, run on a Pimoroni Pico LiPo 2XL W, to display the text of a received (and forwarded) METAR onto a connected Lolin 2.13inch 3-Color e-Paper display of 250 x 122 pixels. Name of the script “metar_mqtt_epd.py”. script