Home Page Forums Tinylab Share your TinyLab projects Reply To: Share your TinyLab projects

#209

AndreN
Member

I haven’t tried the mqtt project since I’d have to reflash the ESP8266 and lose the AT firmware (I assume). I was concerned I would have trouble getting the AT firmware back on later. I really should buy a second ESP8266 so I could have one with AT and one I could flash with whatever.

In any case, did you see and follow the instructions inside the code for building the project?

” To install the ESP8266 board, (using Arduino 1.6.4+):
– Add the following 3rd party board manager under “File -> Preferences -> Additional Boards Manager URLs”:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
– Open the “Tools -> Board -> Board Manager” and click install for the ESP8266″
– Select your ESP8266 in “Tools -> Board”

After that, I tried to compile and discovered I needed the following library:

https://github.com/knolleary/pubsubclient

 

After that, I ran into compile errors due to “setup_wifi” and “callback” not being forward-declared. Not sure why the sample code author didn’t run into that. To fix that, I added the following to mqtt_esp.ino before the setup() function:

void setup_wifi();
void callback(char* topic, byte* payload, unsigned int length);

 

With those declarations, I was able to compile the project.