Search code examples
mqttesp8266micropython

umqtt.robust on Wemos


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 ?


Solution

  • 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)