The goals for today is to
- reading temperature, humidity, and CO2 level.
- posting readings on Adafruit.io.
- update the design as I update the code.
2. fix leaks.
Connecting to WiFi
As I mentioned in a previous post, I’m using a Sparkfun ESP8266 WiFi Shield.
Sparkfun notes this here: Watch out! When you’re programming your Arduino (assuming it’s an ATmeg328P-based ‘duino), make sure the UART select switch is slid over towards the “SW” position. If it’s set to “HW”, all of those bits and bytes being programmed into the Arduino will also be sent over towards the ESP8266 — there’s a chance the spurious data might put the ESP8266 into an unknown (though recoverable) state.
I’m following along Sparkfun’s tutorial starting with downloading and installing their Arduino Library. The tutorial points to the ESP8266_Shield_Demo as a reference point for programming. So I try out the sample code…and…and…BUMMER. The shield doesn’t initialize. Now what?
Looking in SparkFunESP8266.h:
#define ESP8266_SW_RX9// ESP8266 UART0 RXI goes to Arduino pin 9
#define ESP8266_SW_TX8// ESP8266 UART0 TXO goes to Arduino pin 8
static SoftwareSerial swSerial(ESP8266_SW_TX, ESP8266_SW_RX);
bool begin(unsigned long baudRate = 9600, esp8266_serial_port serialPort = ESP8266_SOFTWARE_SERIAL);
and in SparkFunESP8266.cpp:
bool ESP8266Class::begin(unsigned long baudRate, esp8266_serial_port serialPort)
_baud = baudRate;
if (serialPort == ESP8266_SOFTWARE_SERIAL)
_serial = &swSerial;
else if (serialPort == ESP8266_HARDWARE_SERIAL)
_serial = &Serial;
After littering the code with Serial.println()s, I found the failure is in test(). Sending the test AT command failed. I’m going to try to manually send AT commands using CoolTerm. I discussed CoolTerm in this post.
Thank you for contacting Sparkfun Technical Support
SparkFun Electronics | Jan 14, 2017 02:53PM MST
Hi, Thank you for submitting your Technical Support request with us.
…and so I anxiously await expert advice from SparkFun’s technical support instead of spending more time banging my head. I guess my goal of connecting to Adafruit.io will not happen today. Not a surprise. Connecting shields together can turn into a slog.
Slowly making progress waiting for the glue to dry…