ESP8266 crib sheet - nodebots/london GitHub Wiki

Prequisites

Hardware

  1. esp8266 module
  2. 3.3V FTDI FT232RL USB to TTL Serial Converter - example

Pinout

pinout

Wiring

  • Vcc = 3.3V (needs around 300-400mA peak)
  • Gnd = -ve ground
  • CH_PD = 3.3v (solder a 1k resistor to Vcc)
  • TXD = Tx data connect to Rx on FTDI/Serial/Arduino
  • RXD = Rx data connect to Tx of FTDI/Serial/Arduino

Upgrading the firmware

  1. Use esp-vagrant to create a build environment

  2. Clone ESP2866-transparent-bridge

  3. Update /user/config_wifi.h with your WiFi settings

  4. The default Makefile doesn't work - use this one instead to compile the firmware

     make
    
  5. Connect GPI0 to ground to enable firmware update mode

  6. Flash ROM

     make flash
    
  7. Flash Arduino with StandardFirmata set to 115200 baud (do a find/replace for 57600 in the sketch)

  8. Connect to Arduino:

  • Vcc = 3.3V (needs around 300-400mA peak)
  • Gnd = -ve ground
  • TXD = Rx
  • RXD = Tx
  1. Run Johnny-Five:
var net = require('net');
var five = require('johnny-five');
var firmata = require('firmata');

var options = {
  host: '192.168.1.88',  // find your host somehow
  port: 23  // default is telnet port
};

var client = net.connect(options, function() { //'connect' listener
  console.log('connected to server!');

  var socketClient = this;

  //we can use the socketClient instead of a serial port as our transport
  var io = new firmata.Board(socketClient);

  io.once('ready', function(){
    console.log('io ready');
    io.isReady = true;

    var board = new five.Board({io: io, repl: true});

    board.on('ready', function(){
      console.log('five ready');

      //Full Johnny-Five support here:
      var led = new five.Led(13);
      led.blink();
    });
  });
});

Links