Require umqtt.simple2

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Require umqtt.simple2

Post by MMliam » Thu Nov 18, 2021 2:03 pm

I need to utilize umqtt.simple2 for an application in an ESP-01S 1MB.

According to https://pypi.org/project/micropython-umqtt.simple2/ this module is included since version 1.12. However, I've installed esp8266-1m-20210902-v1.17.bin into the ESP-01S, and the result for help('modules') is:
__main__ inisetup ucryptolib usocket
_boot lwip uctypes ussl
_onewire machine uerrno ustruct
_webrepl math uhashlib usys
apa102 micropython uheapq utime
btree neopixel uio utimeq
builtins network ujson uwebsocket
dht ntptime uos uzlib
ds18x20 onewire upip webrepl
esp port_diag upip_utarfile webrepl_setup
flashbdev uarray urandom websocket_helper
framebuf ubinascii ure
gc ucollections uselect

Apparently "umqtt.simple2" is not included. I've downloaded umqtt.simple2 to my PC from GitHub.
The question is how to merge it with the existing microPython flashed on to the ESP-01S. From what I've read I should be able to import it, however I've also read that the order of the import is important to avoid conflicts the following should be executed first:
import sys
sys.path.reverse()

followed by:
import upip
upip.install("micropython-umqtt.simple2")

Should I replace "micropython-umqtt.simple2" with the path to the module on my PC?
Is this the proper way to install the MQTT functionality into the ESP-01S.

Any help would be appreciated.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Require umqtt.simple2

Post by pythoncoder » Fri Nov 19, 2021 10:03 am

upip installs directly to your device so after running it you should be able to access the module. I'm not aware of anyone in here using that version, however, so support may be limited.

I think the original version may be absent on your build to conserve space.
Peter Hinch
Index to my micropython libraries.

MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

Re: Require umqtt.simple2

Post by MMliam » Sat Nov 20, 2021 3:06 am

pythoncoder,

Thanks for the reply. I gave up on the so called "umqtt.simple2" got everything working with "imqtt.simple". I had wanted to load the module via internet connection, I was hoping to load it from a local file, but it kept throwing an error. (still investigating that)

Right now I have an MQTT Broker & Client running under Node-RED.
The Broker on Node-RED is only for test purposes, will probably switch to Mosquitto, but right now it's working well.
I have a client each on two Windows 10 PC.s running MQTTBox
and now umqtt running on an ESP-01S.

Not too bad for someone who just started using this stuff about a week ago :D
Although in truth, this are all just toy applications right now; I've got a bit more to learn before I can turn them into practical applications.

Post Reply