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?


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 from github and add it to your project. To avoid confusion, rename it to something like “” and use it in the project like this:

import local_mqtt as mqtt
<span class="vanilla-mention-@"><br>Let me know if it solves your issue.<br><br></span>


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. 




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 :slight_smile:
Thank you


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?


hi @mjm 
please use the forum for reporting bugs.
we are reorganizing the forum categories and sections taking into account also your suggestions.
thanks for you contribution