Esp8266 - workshop 1 – internet button error

Greetings, I’m trying to run the first workshop but I get this error every time.

Arduino: 1.8.12 (Windows Store (Windows 10), Board: “Generic ESP8266 Module, 80 MHz, Flash, nodemcu, 26 MHz, 40MHz, QIO, 4M (1M SPIFFS), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200”

C:\Users\nicol\Desktop\sketch_mar11a\sketch_mar11a.ino: In function ‘void loop()’:

sketch_mar11a:111:38: error: ‘class MQTTClient’ has no member named ‘state’



exit status 1
‘class MQTTClient’ has no member named ‘state’

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.


We have recently published an update to the Losant Arduino library. So, you won’t be able to call that state method. My recommendation would be to remove that line entirely. Since it’s only printing the value, it shouldn’t affect the functionality of your code.

And just to provide some more info to help you along your journey to get the best help:

If you’re having trouble connecting to Losant or with the Losant Platform, this forum is the best place.

If you’re having trouble with the losant-mqtt-arduino library, you should make an issue in GitHub.

If you’re having troubles getting your code to work, id recommend: