Go Down

Topic: ESP8266 (Read 76467 times) previous topic - next topic

Paulware8

Oct 21, 2014, 07:09 am Last Edit: Oct 24, 2014, 05:38 am by Paulware
I'd like to start a forum Discussion on using the ESP8266.
I was able to create a simple http server with it using the Mega (for extra serial ports), and I had to make sure it had its own 3.3V power supply.  I created a github repo that has the source code, and will follow with some diagrams to show how it was connected.:  https://github.com/Paulware/ESP8266

robtillaart

What is the ESP8266?
Have a link to a datasheet or other info?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Chagrin

Datasheets for the ESP8266 are quite poor, but basically it's a microcontroller with WiFi with default firmware that will respond to "AT" style commands over serial. Modules are cheap ($5) and the range is fantastic -- hundreds of meters -- and of course that can be improved with better antennas.

oric_dan

I recently bought a couple from here, but not had a chance to try as yet. Scroll down the page for links to tech info,

http://www.ebay.com/itm/ESP8266-Serial-WIFI-Wireless-TransceiveR-Module-Send-Receive-LWIP-AP-STA-/251636525924?pt=LH_DefaultDomain_0&hash=item3a96b4ab64

Paulware8

#4
Oct 22, 2014, 07:01 am Last Edit: Oct 24, 2014, 03:28 am by Paulware
I added a UDP example: https://github.com/Paulware/ESP8266.  It is written for the mega since the ESP8166 needs commands over a fast serial port.

Basic theory of UDP operation:
  ESP8266 logs onto your local network (it will need SSID and password)
  Android device also logs on to local network and sends out a UDP broadcast (to 192.168.0.255 for example).  The message is "findkey" where key is a unique name of the device (i.e. garageDoor).
 
  All other ESP8266 on the local network will receive this message but only the unit with the matching key will respond.  This matching unit will respond: "CTS" (clear to send) to the android device.
 
  When the android device receives this message it now also has the ip address of the device.  All further commands will  be point to point from the android device to the specific ip address of the specific ESP8266 unit with the matching key.

  The unit can now process and respond to commands, like "open" or "readTemp".

  In the ESP8266UDP directory is also a udpServer.py file which can be used to simulate and android device (if you don't yet have one - The Kyocera Event can be purchased at Best Buy for $40)  to command the ESP8266. 


   Also, in this directory is an Android project written in .java/Eclipse which demonstrates basic connectivity. You can use this project as a skeleton to create your own Android App.

Paulware8

#5
Oct 24, 2014, 12:46 am Last Edit: Oct 24, 2014, 05:38 am by Paulware
I added a schematic and gerber .zip files for a shield.  It has not yet been verified, and I will not probably order it for a few weeks, but feel free to use it for your own purposes.

I added the testing android app in the google play store as a free app, the name is:
ESP8266 UDP COMMANDER

sudlud

Hey everyone,

Thanks alot for the demo files, I will try them as soon as I receive my radino WiFi.

did you hear about radino? They already merged the ESP8266 and an Arduino Micro into one single module. (www.radino.cc) and the whole thing runs on 3.3V.


They also provide a Arduino-support package on their website, e.g. containing a simple webserver example for the ESP8266. Maybe this will help someone with their first steps on ESP8266.

Paulware8

Radino looks good, this will be a DIY version at a fraction of the cost.

Paulware8

#8
Nov 19, 2014, 04:02 am Last Edit: Nov 19, 2014, 04:37 am by Paulware
I just found out there is an AT+CIOBAUD command which allows you to change the baud rate.
This will change the pcb design because previous posts I had read on this subject assumed a baud rate of 115200.  This forced me to connect D0 (Arduino RX) to ESP8266 TX (using a transistor) and D1 (Arduino Tx) to ESP8266 Rx (using a transistor).

  But now with the reduced baud rate we can use softserial to connect to ESP8266 rx/tx and save standard serial (D0,D1) for debugging.  I think this will make the final solution much more user friendly.

 


Chagrin

The Electrodragon Wiki on the ESP8266 mentions that the ability to change the baud rate is firmware dependent. FYI, YMMV, etc.

Erni

Another interesting thing:

A new firmvare acting like a LUA interpreter.
It makes it very easy to make for example a webserver on the ESP8266 itself.
And that is by the way the only way I have had any succes with this board.

http://www.esp8266.com/viewtopic.php?f=6&t=534

Paulware8

#11
Nov 24, 2014, 04:30 am Last Edit: Nov 26, 2014, 01:21 am by Paulware
That link doesn't work.  I initialize my ESP8266 as a UDP server.   I'll post a video soon

Erni

#12
Nov 24, 2014, 06:52 pm Last Edit: Nov 24, 2014, 07:05 pm by Erni
The esp8266  forum has been restructered

The LUA implementation is here:

www.esp8266.com

I have tried to use the LUA webserver with an ATtiny85.
The t85 does all the sensor reading and sends it to the esp8266 via seriel.
It works very well and very covenient because the t85 can run on the same 3.3V as the esp8266.

There is still a problem with the RAM usage but working on it
@Paulware
Which firmware do you use on the esp8266 ?


Paulware8

#13
Nov 26, 2014, 01:33 am Last Edit: Nov 26, 2014, 03:27 am by Paulware
I don't modify the firmware on the esp8266, I just use them as I get them from the vendor.  I believe that vendors ship them with firmware that allows them to respond to AT commands.

I created an Arduino program to store the SSID/Password in EEPROM on the atmega.  That way other users can use it without needing to change the source code.  My Arduino program allows me to set the SSID and password for my home network.  by typing in the Serial monitor: ssid mySSID, where mySSID is the ssid of my home router.  My Arduino program also allows me to set the password by typing in the Serial monitor: password myPassword, where myPassword is the password on your home router.   

The first step when I get an ESP8266 is to determine what baud rate the device is set to.  I do this by sending "AT" commands at various baud rates until it responds with "OK".  Once it responds with "OK", I know I have the correct baud rate, and I will be able to set its parameters.  First I set the baud rate to 19200.  Then I set the other parameters to configure it as a UDP server.  At that point I will be able to use it to fulfill a variety of functions such as a motor controller or a sensor.  After setting the baud rate,  I also set:   

  AT+CWMODE=3
  AT+CIPMUX=1
  AT+CIPSERVER=1,3333
  AT+CIPSTO=120

once this is done, the esp8266 will get an ip address assigned by my home router and listen to port 3333 for a command.   In this manner it can be used as a sensor or a device controller.

Paulware8

Here is a video of a rc car commanded by an android device, using the esp8266
http://youtu.be/Go8Tyr9nKlo

Go Up