Saturday, February 28, 2015

Arduino Library for ESP8266

There are many ESP8266 libraries, but I cannot find the one that for me, so I made it from scratch. It is simple library that the object is small sensor client, so many function is omitting. The following is the function list.

  • Scan
  • MAC address API
  • AP connection (of course)
  • only TCP client socket read / write

The memory footprint is a pro of this library. My sensor node with this library has the following memory foot print.

Sketch uses 19,934 bytes (64%) of program storage space. Maximum is 30,720 bytes.
Global variables use 1,030 bytes (50%) of dynamic memory, leaving 1,018 bytes for local variables. Maximum is 2,048 bytes.

Adafruit CC3000 version of the sensor node has the following foot print. :

Sketch uses 29,406 bytes (95%) of program storage space. Maximum is 30,720 bytes.
Global variables use 1,311 bytes (64%) of dynamic memory, leaving 737 bytes for local variables. Maximum is 2,048 bytes.

Still there are many problems due to firmware version and timing issue of the response. However, I hope this may be used.

The firmware version and HW that I used is :
Firmware version : AT version: SDK version:0.9.5
Aduino pro mini
ESP8266MOD from Ai-thinker

This library is designed to used with AltSoftSerial with some patch included.

The source code :

Happy Arduino Life ~

The following is public member function list. :
wl_status_t begin(char * ssid = NULL, char * password = NULL, byte * mac = NULL);
wl_status_t status(void);
bool connect(char * host, unsigned int port);
bool isConnected(void);
void disconnect(void);
void print(char * buffer);
void print(const __FlashStringHelper *ifsh);
void readLoop(void);
void setTimeout(long timeout);
byte readBytes(char* buffer, byte buffer_size);
bool startScan(void);
bool scanEntry(char * ssid, char * rssi, byte *security);
void getMac(byte mac[6]);

Wednesday, February 25, 2015

A GUI for MS Windows to setup Arduino Board

I openned the source code in Github. You may build the application using Visual Studio 2013 Community edition. (Visual C++ MFC Dialog based)

Funtionality :
  • Communication with server to create an account
  • Find UART port for Arduino
  • Communicate with Arduino through UART for setup
  • Specify SSID and password
  • Scan through Arduino device if the functionality is supported
 ToDo :
  • More general application framework (?)
  • Add sample UART output of my sensor node Arduino board

Sunday, February 22, 2015

RSSI value of Adafruit CC3000

I don't know if I made a mistake, but CC3000 library returns RSSI value as positive value in scanning. It looks like the correct dBm value is -128 + returned_value.

I posted a question to Adafruit forum as the following. :

Saturday, February 21, 2015

Test Acccount for sensor output

The test account is running for sensor output processing. (The sensor is at my home.. -_-;)  pinebud /22222222

MS Windows GUI utility to setup the sensor node

We made a Windows application to setup the sensor node.

HI-LINK RM04 WiFi module driver for Arduino Uno

We published Arduino library for HI-LINK RM04 WiFi module with Aruino Uno board. Uno board provides just one UART for PC communication, so we used AltSoftSerial library to use software serial port to communicate with RM04 module. Because of the limited memory of Uno, the library only provides web client functionality. Even scan function was removed from the original driver.

Original driver from Chunlinhan :
Modified smaller driver :

Adafruit CC3000 has a bug getting DNS server

We identified a bug with Adafruit CC3000 WiFi module. The module does not update DNS server entry from DHCP server properly.

Following is the result with my home WiFi AP.
IP Addr:

Following is the result with my iPhone WiFi tethering
IP Addr:

Adafruit support team said there seems to be a glitch in the firmware to save DNS server entry for some time.

The following seems to be the workaround.

while (!cc3000.connectToAP(ssid, passwd, WLAN_SECURITY)) {
Serial.println(F("Connection Failed!"));

Link to the bug reporting post :