2

I am trying to install micropython-umqtt.robust on my Wemos D1 mini. The way i tried this is as follow.
I use the Thonny editor

  1. I have connected the wemos to the internet.
  2. in wrepl type:

    import upip

    upip.install('micropython-umqtt.simple')
    I get the folowing error: Installing to: /lib/ Error installing 'micropython-umqtt.simple': Package not found, packages may be partially installed

    upip.install('micropython-umqtt.robust')
    I get the folowing error: Error installing 'micropython-umqtt.robust': Package not found, packages may be partially installed

Can umqtt be installed on Wemos D1 mini ? if yes how do I do this ?

Tracy
  • 43
  • 5

2 Answers2

2

Thanks for your help Reilly, The way I solved it is as follow. With a bit more understanding of mqtt and micropython I found that the only thing that happens when you try to install umqtt simple and umqtt robust,is that it makes in de lib directory of your wemos a new directory umqtt. Inside this directory it installs two files robust.py and simple.py. While trying to install them I kept having error messages. But I found a GitHub page for these two files, so I copied these files. Made the umqtt directory within the lib directory and in this umqtt directory I pasted the two copied files. Now I can use mqtt on my wemos.

Tracy
  • 43
  • 5
0

I think the MicroPython build available from micropython.org already bundles MQTT so no need to install it with upip. Try this directly from the REPL:

from umqtt.robust import MQTTClient

or

from umqtt.simple import MQTTClient

and start using it from there

mqtt = MQTTClient(id, server, user, password)

multipolygon
  • 2,194
  • 2
  • 19
  • 23
  • umqtt is not included by default on all of the MicroPython builds, so this may not work (for example, it is not included in the ESP32-C3 MicroPython distribution, and these imports fail) – Andy Piper Feb 02 '22 at 21:58