{"id":16241554,"url":"https://github.com/tve/mpy-mqttrepl","last_synced_at":"2026-05-08T13:32:46.411Z","repository":{"id":146951461,"uuid":"234490479","full_name":"tve/mpy-mqttrepl","owner":"tve","description":"MQTT Repl for MicroPython","archived":false,"fork":false,"pushed_at":"2020-01-20T00:11:57.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T09:52:52.563Z","etag":null,"topics":["micropython","micropython-esp32","mqtt"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-17T06:59:40.000Z","updated_at":"2024-06-06T11:33:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf06925b-ac99-474c-af2a-86ffdafc01b3","html_url":"https://github.com/tve/mpy-mqttrepl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tve/mpy-mqttrepl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2Fmpy-mqttrepl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2Fmpy-mqttrepl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2Fmpy-mqttrepl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2Fmpy-mqttrepl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tve","download_url":"https://codeload.github.com/tve/mpy-mqttrepl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tve%2Fmpy-mqttrepl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32782575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["micropython","micropython-esp32","mqtt"],"created_at":"2024-10-10T14:07:59.248Z","updated_at":"2026-05-08T13:32:46.394Z","avatar_url":"https://github.com/tve.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"MicroPython experiments with an MQTT-based Repl\n===============================================\n\nThis repo contains work in progress, it may or may not be useful to you...\n\nPrerequisites\n-------------\n- ESP32 with MicroPython v1.12 or newer, based on ESP-IDF 4.x\n- An MQTT server, configured for MQTTS using PSK cipher suites if desired\n- cli tools to publish messages and subscribe to topics, e.g. `mosquitto_pub`/`..._sub`\n\n`mqtt_as` (asyncio) based repl in callbacks\n-------------------------------------------\n\nThe `src` directory contains a proof of concept repl that uses *the awesome mqtt_as* by\nPeter Hinch from https://github.com/peterhinch/micropython-mqtt/blob/master/mqtt_as/mqtt_as.py.\nIt has been modified a bit and uses a slightly altered version of uasyncio (from the\nmicropython-lib) to allow for one-shot running of coroutines instead of `run_forever`.\n\nThe `src/mqrepl.py` \"main\" starts the MQTT connection and registers some callbacks such that\nthe MQTT client and the associated subscription keep running in the background, very similar to\nthe webrepl. When everything is set-up, mqrepl drops back into the repl prompt.\n\nCommands can be sent to the repl using the topic defined by `REPL_IN`, for example:\n\n```\n\u003e mosquitto_pub -h 192.168.0.14 --debug -p 8883 -u core --psk-identity core --psk bb000000000000000000000000000030 -t esp32/mqtest/repl/in -m \"print('hello')\n              \"\nClient mosq-QcEKHJzNtxQEMWtzzk sending CONNECT\nClient mosq-QcEKHJzNtxQEMWtzzk received CONNACK (0)\nClient mosq-QcEKHJzNtxQEMWtzzk sending PUBLISH (d0, q0, r0, m1, 'esp32/mqtest/repl/in', ... (15 bytes))\nClient mosq-QcEKHJzNtxQEMWtzzk sending DISCONNECT\n```\n\nThe esp32 will `eval` or `exec` the python expression/statement and send the reply back on the\ntopic defined by `REPL_OUT` in json form, for example:\n\n```\n\u003e mosquitto_sub -h 192.168.0.14 --debug -p 8883 -u core --psk-identity c\nore --psk bb5ec51f995a1c995eeccbdc47898530 -t esp32/mqtest/repl/out\nClient mosq-a32XHgSJkfXmVTLUkA sending CONNECT\nClient mosq-a32XHgSJkfXmVTLUkA received CONNACK (0)\nClient mosq-a32XHgSJkfXmVTLUkA sending SUBSCRIBE (Mid: 1, Topic: esp32/mqtest/repl/out, QoS: 0, Opti\nons: 0x00)\nClient mosq-a32XHgSJkfXmVTLUkA received SUBACK\nSubscribed (mid: 1): 0\nClient mosq-a32XHgSJkfXmVTLUkA sending PINGREQ\nClient mosq-a32XHgSJkfXmVTLUkA received PINGRESP\n...\nClient mosq-a32XHgSJkfXmVTLUkA received PUBLISH (d0, q0, r0, m0, 'esp32/mqtest/repl/out', ... (45 by\ntes))\n{\"r\":null,\"o\":\"hello\\r\\n\",\"e\":null,\"x\":False}\n```\nWhere `r` is the expression result, `o` is the output, and `e` is any exception printout.\n\nNote that the way the MQTT async loop is currently run is rather hackinsh and needs further work!\n\n`mqtt_simple` based repl\n------------------------\n\nThe `mqtt-simple` directory contains a callback-based repl experiment that uses  a slightly modified\nversion of `umqtt.simple` from the micropython-lib.\n\nasyncio repl experiment\n-----------------------\n\nThe asyncio directory contains a first repl experiment based on `mqtt_as`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftve%2Fmpy-mqttrepl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftve%2Fmpy-mqttrepl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftve%2Fmpy-mqttrepl/lists"}