Search found 2 matches

by Variomatic
Thu Mar 15, 2018 6:31 pm
Forum: ESP8266 boards
Topic: Poll a umqtt broker to test for connection.
Replies: 1
Views: 598

Poll a umqtt broker to test for connection.

I'm connecting to an MQTT broker umqtt.simple and am trying to create a loop that will catch a failed attempt to connect to the broker. Is there any way of finding out if I have a connection to the server, ideally I'd like to do something like this: while True: try: mqttc.connect() print("Connected ...
by Variomatic
Mon Mar 12, 2018 9:21 pm
Forum: ESP8266 boards
Topic: Nodemcu micropython wifi problems.
Replies: 1
Views: 653

Nodemcu micropython wifi problems.

I've flashed Micropython onto my Nodemcu v3 and am trying to connect the thing to WiFi but I've come across a problem. This is the code I'm using to try and connect it to Wifi: def do_connect(): sta_if = network.WLAN(network.STA_IF) if not sta_if.isconnected(): print('Connecting to network...') sta_...