frame

MQTT: library mqtt seems installed correctly: check if it is also enabled

I've just installed Zerynth and am using it successfully on an esp8266 (mini web server works without hiccup - easiest install on an embedded device I had ever!).

Now I'm trying the MQTT example but am getting the following error on "import mqtt":

              library mqtt seems installed correctly: check if it is also enabled

MQTT (r1.0.0) shows up as installed package. It's also "enabled" (per package manager). Disabling and reenabling does not help. Neither uninstalling and reinstalling the package. The host is a mac, in case this matters.

Any suggestions for how to make this work?

Comments

  • Hello @"Bernhard Boser"  and thanks for the feedback!

    The new beta version of Zerynth (r2.0.0) should have solved this issue. However there is no support for esp8266 yet.
    So, a very quick and dirty solution is to download the mqtt.py from github and add it to your project. To avoid confusion, rename it to something like "local_mqtt.py" and use it in the project like this:

    import local_mqtt as mqtt

    Let me know if it solves your issue.

    Giacomo Baldi
    Zerynth Head of Software Development
  • mjm Member
    I had the same problem (OSX as well): uninstall, reinstall the mqtt library. 

    I did notice that the example code is incorrect (or obsolete). I had to change the imports to:
    from mqtt import mqtt
    from wireless import wifi
    from broadcom.bcm43362 import bcm43362 as wifi_driver

    Also, I initially had the wrong wifi driver enabled (because I changed from a Particle Core to Photon in the last minute), it compiled OK but did not run. Obvious of course, but an error message somewhere might have been nice.

    Finally, using a local MQTT server failed as well. Changing the server name (mymqtt.local) to the IP address fixed it. 

    I'd like to report these things to the library author, but don't know where. 

    HTH.

    Marcel

  • LorenzoRLorenzoR Member, Moderator
    Hello Marcel,

    mqtt.connect calls gethostbyname to get the IP address of your server, is your local server name registered to a DNS server?

    For what concerns reporting to the author, it's ok to post here on the forum :)
    Thank you
    Lorenzo Rizzello
    Zerynth Support Team

  • mjm Member
    @LorenzoR ;
    It is indeed a local server (say, my server.local). Usually programs have no trouble finding it by name, but maybe the micropython implementation of gethostbyname is limited?

    I'd really rather use a proper bug tracker for issues. Which forum is most appropriate for reporting bugs?
  • floydfloyd Member
    hi @mjm ;
    please use the https://community.zerynth.com/categories/troubleshooting forum for reporting bugs.
    we are reorganizing the forum categories and sections taking into account also your suggestions.
    thanks for you contribution
    D
    Daniele Mazzei
    Zerynth Chief System Architect
Sign In or Register to comment.

ZERYNTH Community

@ 2016 Zerynth.com, all rights reserved.