ESP8266 on Arduino Nano

Trying to get Arduino Nano to work with ESP8266 (ESP-01). The Nano won’t power the ESP8266 from it’s onboard 3.3V power like the Uno does. The red power light and blue comm light on the ESP board blink for a split second, then it goes dark. Many sources say you need a dedicated power supply or you risk damaging both the Arduino and ESP boards. These boards are cheap, so I’m trying everything. Even more sources say to be careful not to connect 5V to the ESP board. Well, this is what I’m doing. It is working so far, but I noticed the ESP board is pretty hot to the touch. It has been running my test program, which makes repeated HTTP requests as fast as the board can execute them, for about 30 minutes. In other words, it is taxing the ESP board pretty hard. That said, I’ve seen zero errors. While this is probably bad for the board, 5V could work for some applications. At least this way there are fewer components. I guess I’ll leave it running a while and see if it gets fried.

IMG_7100[1]

Connections:
ESP8266 <--> Nano
GND <--> GND
VCC <--> 5V
CH_PD <--> 5V
RX <--> D10
TX <--> D11

Using SoftwareSerial on pins 10/11.

/* SETUP WIFI - ESP8266 (ESP-01)

http://www.ebay.com/itm/221589414331?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

http://www.ebay.com/usr/worldchips?_trksid=p2047675.l2559

1
#include
SoftwareSerial softSerial(10, 11); // RX, TX
String WSSID = "xxxxxxxxxxxx";
String WPASS = "xxxxxxxxxxxx";
bool r;

void setup() {
/* SETUP SERIAL COMMUNICATION */
espSerialSetup();
delay(2000); // Without this delay, sometimes, the program will not start until Serial Monitor is connected
r = espSendCommand( "AT+CIFSR" , "OK" , 5000 );
if( !r ) {
r = espSendCommand( "AT+CWMODE=1" , "OK" , 5000 );
r = espSendCommand( "AT+CWJAP=\""+WSSID+"\",\""+WPASS+"\"" , "OK" , 15000 );
}
}

void loop(){

r = espSendCommand( "AT+CIPSTART=\"TCP\",\"108.59.11.102\",80" , "OK" , 5000 );
String getRequest = "GET /shiznic/ HTTP/1.1\r\nHost: www.rootpower.com\r\n";
int getRequestLength = getRequest.length() + 2; // add 2 because \r\n will be appended by SoftwareSerial.println().
r = espSendCommand( "AT+CIPSEND=" + String(getRequestLength) , "OK" , 5000 );
r = espSendCommand( getRequest , "+IPD" , 15000 );
//r = espSendCommand( getRequest , "world" , 15000 ); // page should respond with Hello, world.
if( !r ) {
Serial.println( "Something wrong...Attempting reset...");
espSendCommand( "AT+RST" , "ready" , 20000);
espSendCommand( "AT+CWMODE=1" , "OK" , 5000 );
espSendCommand( "AT+CWJAP=\""+WSSID+"\",\""+WPASS+"\"" , "OK" , 15000 );
}

delay(3000);

}

void espSerialSetup() {

// change baud rate so SoftwareSerial works better -- need a certain version of ESP for this to work and be retained after power cycle
// make sure Serial Monitor port speed is set to 9600
softSerial.begin(115200); // default baud rate for ESP8266
delay(1000);
softSerial.println("AT+CIOBAUD=9600");
delay(1000);
softSerial.begin(9600);
Serial.begin(9600);

}

bool espSendCommand(String cmd, String goodResponse, unsigned long timeout) {
Serial.println("espSendCommand( " + cmd + " , " + goodResponse + " , " + String(timeout) + " )" );
softSerial.println(cmd);
unsigned long tnow = millis();
unsigned long tstart = millis();
unsigned long execTime = 0;
String response = "";
char c;
while( true ) {
if( tnow > tstart + timeout ) {
Serial.println("espSendCommand: FAILED - Timeout exceeded " + String(timeout) + " seconds" );
if( response.length() > 0 ) {
Serial.println("espSendCommand: RESPONSE:");
Serial.println( response );
} else {
Serial.println("espSendCommand: NO RESPONSE");
}
return false;
}
c = softSerial.read();
if( c >= 0 ) {
response += String(c);
if( response.indexOf(goodResponse) >= 0 ) {

execTime = ( millis() - tstart );
Serial.println("espSendCommand: SUCCESS - Response time: " + String(execTime) + "ms");
Serial.println("espSendCommand: RESPONSE:");
Serial.println(response);
while(softSerial.available() > 0) {
Serial.write(softSerial.read());
}
return true;
}
}
tnow = millis();
}
}

ESP8266 ESP-12 Getting Started w/ Arduino Uno

Had trouble finding a complete guide to get my new ESP8266 / ESP-12 going. Lots of information out there but much conflicting info and most guides are missing something.

Here’s what worked for me with this particular ESP-12 board.

http://www.ebay.com/itm/281601716541?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

If the Ebay listing is dead, the seller name is tomyuen007.

Plugged in the Arduino and uploaded the BareMinimum sample sketch.

On the ESP12 board, connect GPIO15 to GND. Then connect GPIO0, GPIO2, and CH_PD to VCC.

I used a two tiny breadboards because of the awkward spacing of the pins on the board.

ESP12_arduino-2

Connected ESP TX to Arduino TX.
Connected ESP RX to Arduino RX.

Opened Arduino Serial Monitor and set line ending to “Both NL & CR” and set baud to 115200.

Connected ESP12 GND to Arduino GND
Connected ESP12 VCC to Arduino 3.3V (Many sources say you need a dedicated power supply, but I didn’t have one and this is working so far.)

The ESP12 booted up immediately and I got a “ready” message, preceded by some gibberish.

arudino_esp12

I tried every baud rate and only 115200 gave me the ready message. All other settings gave me only gibberish.

More to come…

AT+GMR
AT version:0.21.0.0
SDK version:0.9.5
OK

Was going to check Wi-Fi settings on my phone and use them to configure the ESP when I noticed it was set up as an access point by default with SSID: AP-THINKER_FE2B43

Connected with Windows and checked IP address: 192.168.4.3 with gateway 192.168.4.1

Tried HTTP browser connection to 192.168.4.1 but connection refused.

AT Commmands to get going…

AT+CWMODE=1 – This changed the mode from AP to Sta
OK

AT+CWLAP – Lists access points. Before setting CWMODE, this would return error
+CWLAP:(3,”cowabunga”,-68,”f8:35:dd:75:12:1b”,1)
+CWLAP:(0,”cowabunga_guest”,-69,”fa:35:dd:75:12:1c”,1)
+CWLAP:(2,”hauntedpants”,-92,”00:18:e7:e7:1d:2c”,2)
OK

AT+CWJAP=”cowabunga_guest”,””
OK

AT+CWJAP?
+CWJAP:”cowabunga_guest”
OK

AT+CIFSR=?
OK

AT+CIFSR
+CIFSR:STAIP,”192.168.1.43″
+CIFSR:STAMAC,”18:fe:34:fe:2b:43″
OK

AT+CIPSTART=”TCP”,”rootpower.com”,80
CONNECT
OK

Activity Logging

Setting up a system to prompt for a record of my activity each hour. This PHP scrip cron job will send an email to me each hour during my normal waking hours. My iPhone has push notifications enabled for email so the phone will buzz each time it needs an update and I will simply reply to the email. This way to don’t have to actively remember to record the information. After some, I’ll be able to analyze the data and see what it reveals. This is a pretty crude system, but the key thing for me is having the system actively prompt for the data in a way that makes it easy to respond. Another thought on tuning the system. I wear a Garmin Vivofit to track physical activity and sleep. If the Vivofit would actively report when “sleep” mode has initiated, an API call to Garmin Connect could be used to determine whether or not to send the activity prompt.

The email forwards to a Gmail account and the messages were initially going into SPAM.

activity_logging_cron_job

35 18,19,20,21,22,23,0,1,2,3,4,5,6,7,8,9 * * * /usr/local/bin/php /home/hunter92/activity_log_record_request.php

PHP script for cron job


Oregon Scientific Weather Station WMR86A & Arduino Data Logger

Oregon Scientific Backyard Pro Weather Station WMR86A

http://www.cabelas.com/product/Oregon-Scientific-WMR-A-Pro-Wireless-Weather-Station/1617669.uts

Rob Lakes (robwlakes) ArduinoWeatherOS

https://github.com/robwlakes/ArduinoWeatherOS

Notes so far…
Weather vane component needs to extend north from mounting pole. Don’t know of a way to calibrate it if mounting in this fashion is not possible.
Press Reset button in batter compartment of Display component once all sensor components are installed.
Wait about 2 minutes and time will sync up via radio signal.
There are no on/off switches. Once batteries are installed, they are active.
I was not able to simulate a wind speed. The anemometer may have to run consistently to register properly.

Garmin Vivofit – Quest for Raw Data

I’ve been trying like hell to get the most fundamental data possible from the Garmin Vivofit. I have had the device for about ten days and finally made some headway in the are of sleep data.

The device does not automatically detect sleep and I don’t want to have to push the button to initiate sleep mode. I just discovered that I can easily identify my sleep times by reviewing sleep on connect.garmin.com. I entered a default of 2:00 AM to 9:00 AM when I initially set up the device. I went back through each night since I started wearing the device and adjusted my sleep times. In some cases, I wasn’t sure of the time, so I just made an edit to include an umbrella of time, like 9:00 PM to 11:00 AM. And then I could see when the lower activity associated with my sleep started and stopped. Hovering over the line will show the exact time. After doing this, I exported the data for all ten days and calculated an average (which the Garmin Connect site does not do apparently).

More to come in other areas like heart rate…

Link to dcrainmaker.com – Greate product reviews in the realm of sports and activity tracking.

MeeGoPad Intel HDMI MiniPC Stick Notes

Power from USB port on my desktop PC w/ included microUSB cable.
Used generic HDMI to DVI adapter to plug into standard 17″ LCD monitor for testing.
You have to hold the power button on the unit for a couple seconds. Then the blue LED glows.

Intial boot-up. Had the screen turned off so missed any BIOS messages.
“Test Mode” in large gray letters appeared over Windows Desktop.
System automatically logs in as Administrator.
Lower right corner says Windows 8.1 with Bing Build 9600.

Plugged in wireless keyboard/touchpad RF receiver (Logitech K400r).
Screen resolution defaulted to 1280×1024 (on 17″ 4×3 screen).
Open Network and Sharing Center and was able to join my WiFi network no problem.
“Test Mode” large gray lettering remains superimposed “in front” of everything else on the screen. It is not a desktop background.

Reboot and “Test Mode” goes away. Could not get this to re-appear. Oh well.
System control panel says “Windows is not activated”, as expected.
Noticed some Chinese in Explorer menus. Used Region and Language control panels to change to United States and English.
Had to Reboot to get Intel HD Graphics Card menus to change to English.
Time Zone defaulted to Beijing.

Tried to “Activate Windows” and “Buy Key” in system control panel, but got an error: “Sorry, you can’t buy keys online in this country or region, but you can buy Windows from a retailer near you.” Changing Region control panel back to China had no effect.
Planning to install Ubuntu anyway. Just exploring the Windows options.

Some links…

Triple Install Ubuntu/Android/Windows – Ian Morrison

https://plus.google.com/u/0/+IanMORRISON/posts/8PJdZFRCybn?cfem=1

https://plus.google.com/+IanMORRISON/posts/JcYDGALYhy5

Ubuntu Bluetooth Drivers – Jud Christophe

https://drive.google.com/file/d/0Bxv1KnoXnzCXVVZYRTdycHlJZzQ/view?usp=sharing

Bios File – Jud Christophe

https://drive.google.com/file/d/0Bxv1KnoXnzCXTHlGVzZDY0dQLTQ/view

Bios Settings Video – Jeremy Naglich

Unboxing – GizChina

http://www.gizchina.com/2015/01/05/unboxing-meego-pad-t01/

Inserted MicroSD card. Going to try to get Ubuntu downloaded.

To be continued…

Ordered from MakeTheOne for $109.00 with premium shipping for $12.99, total $121.99.
Ordered on Jan 27, 2015 8:05 PM.
Shipping was FedEx International Priority service.
Delivery attempted Jan 30, 2015 10:27 AM, but I was not available.
Package and held at FedEx distribution facility and re-attempted next business day.
Recommend adding note requesting signature release.


2015-02-13

Started setting up the Windows system that shipped with the unit for home theater.
Installed the following software…
– VLC Media Player
– Combined Community Codec Pack
– Utorrent
– Google Chrome
– ClassicShell
– Notepad++
Added some bookmarks for online content…
bookmarks_2_13_15
System is now showing the “Test Mode” message again, all of a sudden. Found a video on how to get rid of it…https://www.youtube.com/watch?v=9_4xd0Rc_4c
Basically, open run sysprep and click Generalize with other settings defaulted, but this may wipe out all of the previous configuration, so gotta make notes first.