Tuesday, December 30, 2014

IoT using ESP8266

Youtube tutorial on ESP8266

ESP8266 module wiki

ESP8266 connection esp. pull-up resistor

ESP8266 V3 setup


based on http://www.esp8266.com/viewtopic.php?f=13&t=475#
CH_PD          Pull-up
GPIO16/RST     Pull-up
GPIO15         Pull-down
GPIO2          Pull-up
GPIO0          Pull-up for normal or pull-down for bootloader mode.

Pull-up = resistor to VCC.
Pull-down = resistor to GND.

Its possible to wire GPIO directly but then its hard to use them in future if needed. My resistors is 10k right now.

more example on using ESP8266

some more example

webserver example

Another server example

AT commands

Saturday, October 18, 2014

Working with RTC with OpenCM9.04

RTC Grove D1307 & mini RTC DS3231
Both RTC modules use address 0x68 (default) for I2C exchange.

Modification is needed in the sample from SetTimeAndDisplay (arduino) by setting the following:

  1. // original function description deleted
  2. /****************************************************************************/
  3. #include <Wire.h>
  4. #include "DS1307.h"
  5. DS1307 clock;              //define a object of DS1307 class
  6. void setup()
  7. {
  8.  SerialUSB.begin();
  9.         Wire.begin(16,17);   //   specify the software defined I2C pins 16-SDA 17-SCL
  10.                                   // clock.begin(); comment out original begin() method otherwise
  11.                                   // pin21 (SDA) and pin20 (SCL) are declared in Wire
  12.  clock.fillByYMD(2014,10,18);//Jan 19,2013
  13.  clock.fillByHMS(15,15,30);//15:28 30"
  14.  clock.fillDayOfWeek(SAT);//Saturday
  15.  clock.setTime();//write time to the RTC chip
  16. }
  17. void loop()
  18. {
  19.  printTime();
  20. }
  21. /*Function: Display time on the serial monitor*/
  22. void printTime()
  23. {
  24.  clock.getTime();
  25.  SerialUSB.print(clock.hour, DEC);  // use SerialUSB class to print
  26.  SerialUSB.print(":");
  27.  SerialUSB.print(clock.minute, DEC);