ESP8266/Ideas: Difference between revisions

From Playful Exploration
Jump to navigation Jump to search
(Section 'Connecting ESP8266 to Raspberry Pi' got its own page)
Line 15: Line 15:


<htmlet>ESP8266-DiagramDraft02</htmlet>
<htmlet>ESP8266-DiagramDraft02</htmlet>
== Connecting ESP8266 to Raspberry Pi ==
These were my steps, but your specific setup may vary.
Turn off aLaMode (don’t know if this is necessary)
Connect Tx, Rx, GND directly to GPIO pins
Connect VCC, CH_PD, to 3v3
Device is accessible via /dev/ttyS0 on 9600 baud. Used Arduino IDE serial monitor.
Used a variety of AT commands. Verified that I could connect to its Access Point (open wifi)
Connected it to home wifi network
Pinged repeatedly. Power off/on time is < 1 second
____________
Flashing ESP from RPi using NODEMCU firmware
Steps:
<ol>
<li>Ensure /dev/ttyS0 port is a functioning serial port</li>
This may already be setup. Mine was configured when installing aLaMode ArduinoIDE support.
<li>Install python library pyserial (used by firmware uploader tool)</li>
sudo pip install serial
<li>Baud rate. This presented a problem the first time around. But the nodemcu firmware uploader tool is open source so I was able to figure out the problem myself. Here’s the code that prevented the firmware from uploading to my ESP:</li>
#Default baudrate. The ROM auto-bauds, so we can use more or less whatever we want.
ESP_ROM_BAUD = 115200
(Might want to check the assumption on this one.)
My ESP has the original firmware installed and does not auto-sense baud rate like some of the later versions do. The NODEMCU tool uses 115200, so I had to change the baud rate from 9600 (default) to 115200.
AT+CIOBAUD=115200
<li>Start a new clone of nodemcu-firmware from git</li>
sudo git clone https://github.com/nodemcu/nodemcu-firmware
Or if this is already done update the repo (from nodemcu-firmware folder)
sudo git pull
<li>If necessary, change directory to the nodemcu-firmware project</li>
cd /nodemcu-firmware/
<li>Put ESP8266 into flash mode by connecting GPIO-0 to ground and then apply power (or power cycle)
Note: connecting GND and GPIO0 to different grounds on RPi (pins 6 and 14) did not register as GPIO0=low (went into some sort of non responsive mode). Therefore, GND and GPIO0 should use a common ground (be directly connected)</li>
<li>Run uploader specifying the serial port and firmware that was included in the git clone (from the nodemcu-firmware root folder):</li>
sudo tools/esptool.py --port /dev/ttyS0 write_flash 0x00000 pre_build/latest/nodemcu_latest.bin
Success!
Connecting...
Erasing flash...
Writing at 0x00060a00... (100 %)
Leaving...
</ol>
The ESP is now ready to be configured for lua scripting. I’ll be taking advantage of MQTT for sending simple messages around my home.

Revision as of 02:11, 18 May 2016


working with Windows

Driver for FTDI interface

Applications to program the ESP8266

NODElua

ESP8266 as an Arudino device

Options

image/svg+xml DHT 11 100 uFCap as close to board as possible Software configured:GPIO,SPI,I2C orSerial Temperatur and Humidity LED control 220ohm TFT Display Barometric Preasure BMP180 low-power-schottky diode- drops voltage to 3.3V- protects from reverse poling- avoids voltage regulator USB to Serialto unbrick + - + Qty 3 1.2 V Rechargable + Qty 2 1.5 V Alkaline + - power switch + Power options Device options/examples AMS1117-3.3 USB or4.8V-15V -RXTX+ -data+ -on/off+ -??+ -???+