Close

Code Fix!

A project log for ESPtank

A beginner project exploring the capabilities of the ESP8266 with a WiFi-controllable tank robot

benjamin-broceBenjamin Broce 04/20/2016 at 02:340 Comments

Success! After a long break from ESPtank for school and other projects, I stumbled across a great Sparkfun article that seemed like it would solve my aforementioned connectivity problem (the android device not being able to connect to the tank out of range of my home router - presumably because it was stuck trying to connect to the internet simultaneously).

According to the article, you need to make the following call in the Arduino code to lock the '8266 into station (WIFI_STA), access point (WIFI_AP - what I used for ESPtank), or combined (WIFI_STA_AP - default) mode:

WiFi.setMode([mode]);

This seems like it would fix the bug, but instead it threw a compiler error.

Hmm...

I looked around a little more, and found this page, also by Sparkfun, that has example code using this command instead (with the same parameters):

WiFi.mode([mode]);

I tried it out, and it worked!

[If someone at Sparkfun sees this, you might want to fix that first article... but thanks for the resources!]

Lesson learned - make sure you set your WiFi mode when writing in Arduino for the ESP8266!


I seem to have left this post in "Draft" mode for a while... sorry!

Video & wiring diagrams in a couple weeks (busy summer)!

Discussions