Arduino Forum

Topics => Home Automation and Networked Objects => Topic started by: Paulware8 on Oct 21, 2014, 07:09 am

Title: ESP8266
Post by: Paulware8 on Oct 21, 2014, 07:09 am
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 (https://github.com/Paulware/ESP8266)
Title: Re: ESP8266
Post by: robtillaart on Oct 21, 2014, 04:51 pm
What is the ESP8266?
Have a link to a datasheet or other info?
Title: Re: ESP8266
Post by: Chagrin on Oct 21, 2014, 10:54 pm
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.
Title: Re: ESP8266
Post by: oric_dan on Oct 22, 2014, 04:38 am
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
Title: Re: ESP8266
Post by: Paulware8 on Oct 22, 2014, 07:01 am
I added a UDP example: https://github.com/Paulware/ESP8266 (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.
Title: Re: ESP8266
Post by: Paulware8 on Oct 24, 2014, 12:46 am
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
Title: Re: ESP8266
Post by: sudlud on Nov 01, 2014, 01:14 am
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.
Title: Re: ESP8266
Post by: Paulware8 on Nov 07, 2014, 05:44 am
Radino looks good, this will be a DIY version at a fraction of the cost.
Title: Re: ESP8266
Post by: Paulware8 on Nov 19, 2014, 04:02 am
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.

 

Title: Re: ESP8266
Post by: Chagrin on Nov 19, 2014, 06:42 am
The Electrodragon Wiki on the ESP8266 (http://www.electrodragon.com/w/Wi07c) mentions that the ability to change the baud rate is firmware dependent. FYI, YMMV, etc.
Title: Re: ESP8266
Post by: Erni on Nov 19, 2014, 09:15 pm
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
Title: Re: ESP8266
Post by: Paulware8 on Nov 24, 2014, 04:30 am
That link doesn't work.  I initialize my ESP8266 as a UDP server.   I'll post a video soon
Title: Re: ESP8266
Post by: Erni on Nov 24, 2014, 06:52 pm
The esp8266  forum has been restructered

The LUA implementation is here:

www.esp8266.com (http://www.esp8266.com/viewforum.php?f=17&sid=ba6122237726eeb760e0d48e89634608)

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 ?

Title: Re: ESP8266
Post by: Paulware8 on Nov 26, 2014, 01:33 am
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.
Title: Re: ESP8266
Post by: Paulware8 on Nov 26, 2014, 04:56 am
Here is a video of a rc car commanded by an android device, using the esp8266
http://youtu.be/Go8Tyr9nKlo
Title: Re: ESP8266
Post by: rogerClark on Nov 29, 2014, 09:56 pm
Hey guys.

Coming late to the party....

I now have 3 of these, and I have downloaded and installed the sdk etc into a Linux VM etc.

But I find the documentation is really thin on the ground and I'm not sure how I even upload the results of the SDK compile into the device.

Are there any good tutorials about how you upload things like the LUA binaries.
And also compiling modified versions of the main source code.

I,e I'd like a version that has a lower default baud rate, as I'd need to use software serial, so 115200 is too fast.



I also think that this, thread is would be better off in the Microcontrollers section, as this device is a fully fledged Microcontroller as it supports SPI, etc.

I think it would get more exposure if it was moved.


Title: Re: ESP8266
Post by: westfw on Nov 29, 2014, 11:22 pm
My ESP8266's came with a 9600bps default speed (which took me a while to find!) and firmware that supports a new "AT+CIOBAUD" command for permanently changing the speed, as described here:
http://www.electrodragon.com/w/Wi07c#Updates

I'm also a bit frustrated by the state of the documentation (and I guess the implementation as well.)  It feels ... primitive.  Not that that's necessarily bad, since my general impression of most wireless modules is that they're horribly over-specified and bloated.   It will be interesting to see what happens.
Title: Re: ESP8266
Post by: rogerClark on Nov 30, 2014, 05:43 am
@westfw

Mine came working at 115200, but I udpated to the newer firmware just now and it seems OK

However one thing that went very wrong was the CPUpdate command, it ended up spitting out reems of jibberish characters and the only way to reset it seemed to be to upload the firmware again

I have installed a VM with Lununtu preconfigued with the toolchain and SDK, but I'm not entirely sure where to start writing my own firmware, as information is thin on the ground.

If I understand it correctly, It seems that its possible to upload the system software separately from the application software.

The builds that I did in the VM using the SDK example, seems to generate 2 files, both of which, (I think) need to be uploaded.

However I've not got as far as that yet

Title: Re: ESP8266
Post by: Erni on Nov 30, 2014, 12:01 pm
Quote
Are there any good tutorials about how you upload things like the LUA binaries.
This is how I did it:
Grab the binari here

https://github.com/nodemcu/nodemcu-firmware

Upload to the esp8266 (GPI00 connected to ground),
Rx/tx connected to a 3.3V FTDI serial/usb converter

I used  ESP Flash Download Tool, see the picture
Title: Re: ESP8266
Post by: Erni on Nov 30, 2014, 12:11 pm
A Lua webserver rtunning on the Esp8266 (Thanks to gerardwr from esp8266.com)

Code: [Select]

if(t==nil) then
  t=12
end
srv=net.createServer(net.TCP) srv:listen(80,function(conn)
    conn:on("receive",function(conn,payload) print(payload)
    conn:send("HTTP/1.1 200 OK\n\n")
    conn:send("<html><body>")
    conn:send("<h1>Erni's ESP8266</h1><BR>")
    conn:send("TEMP : " .. t .. "<BR>")
    conn:send("NODE.HEAP : " .. node.heap() .. "<BR>")
    conn:send("TMR.NOW : " .. tmr.now() .. "<BR>")
    conn:send("</html></body>")
    conn:on("sent",function(conn) conn:close() end)
  end)
end)



The idea is to test an update of the variable t, that is shown in the page.
I do this from an ATtiny 85 via Serial:
Code: [Select]

  Serial.print("t=");
  Serial.println(count);


FYI
There are lots of info on the ESP8266 forum:
http://www.esp8266.com/
Among other things a new SDK released friday
Title: Re: ESP8266
Post by: rogerClark on Nov 30, 2014, 08:31 pm
I'm having mixed results.

I managed to update the AT firmware to v.9.2 which works fine, and tried LUA
But LUA kept rebooting every 5 seconds.

Also I can only upload via the old XCOM util, nothing else seems to work correctly for me.

I am powering from 5v via a LM1117T 1amp regulator, and people have suggested I need a capacitor, to remove supply voltage fluctuations.
However I have not had time to check if this is the problem


I can't seem to upload via the python util, esptool.py, even the AT firmware only gets to 98% then fails.

People have also suggested that I need to pull some gpio lines to 3.3v through 1k resistors, as currently they are just floating. But other tutorials I have read, don't seem to need this.


Also, the build process in the Lubuntu vm is not that clear.

E.g. Why is source code in a folder called app

Why does the build process produce multiple binaries

If all binaries need to be uploaded, what addresses do the binaries need to be uploaded to?


As far as I can see, there is severe lack of documentation

I guess its early days, but at the moment I don't think I have time to figure out how to use this device.
Title: Re: ESP8266
Post by: Paulware8 on Dec 10, 2014, 03:35 am
I definitely recommend a cap across the 3.3V output and ground, but I haven't tried any firmware updates.
Title: Re: ESP8266
Post by: rogerClark on Dec 10, 2014, 12:07 pm
I've been doing some work with this device for a commercial prototype (as I had some handy)

And I have got the build and upload process working fairly well

There is a VirtualBox image on Espressif's own site

http://bbs.espressif.com/viewtopic.php?f=5&t=2

and I have downloaded the latest SDK 0.9.3 from the www.esp8266.com which contains some examples

Unfortunately the API doc on www.esp8266.com is for 0.9.1 (though some claim is for 0.9.2) its definitely not for 0.9.3 as there some new functions and also changes to existing function arguments etc


I've still not found the docs that describe why the main code appears to be in user_init() and why there is a drivers folder

Or quite why most code seems to be flashed in separate blocks, often 0x00000 and 0x40000

I have posted a question about all of this to esp8266.com


The device is supposed to have an ADC on pin 6 TOUT, but on my board it doesnt go anywhere, so I've been trying to solder to the chip, but so far even though the wire appears to be attached I'm not getting any decent readings when I call system_adc_read();   
This is an undocumented (as yet) new feature only in 0.9.3

Its definitely an interesting device, but whether its worth developing on, is a different matter.

i.e unless the documentation gets a lot better etc

Title: Re: ESP8266
Post by: westfw on Dec 11, 2014, 08:25 am
Electrodragon has (some?) docs for 9.2.2: http://www.electrodragon.com/w/Wi07c#Updates (http://www.electrodragon.com/w/Wi07c#Updates)

The way that info is scattered around, I can't tell whether groups are competing or cooperating :-(

Title: Re: ESP8266
Post by: rogerClark on Dec 11, 2014, 08:55 pm
@westfw

As far as i can see, The stuff in ElectroDragon appears mainly to be about the AT firmware version 0.9.2 rather than the SDK .

But I agree, information is scattered a around a lot. The esp8266.com forum is not that active, e.g. After 3 days no one replied to my question about the basics of using the code from the SDK lib, e.g why they have a user folder and a separate driver folder, and why there is no main() function.

I can guess that like the Arduino, main() is in a library can calls user_init(), and I suspect the driver folder files could equally well be put in the user folder.

But this lack of core knowledge makes building for this platform quite challenging.

Since my last posting, I have managed to get the ADC to work, but I had to solder a wire directly onto the esp8266, which was quite difficult and is not very robust, due to the small surface area for the solder.
Hence I have used hot glue to hold the wire in place. It's messy but it works ;-)

There is a new undocumented API call to read the ADC which supersedes the previous way to access the ADC and seems to reliably read values between 0 and 1V

However I still have a lot of work ahead of me, to send the ADC value to a web service at regular intervals.
This is because there all the SDK provides is basically tcp socket level functionality.

I guess sooner or later someone wil wrap this into a class perhaps, but no one seems to have done it yet.

I have also ordered some ESP-12 variants, which are breakout modules which run all the GPIO pins and adc etc, to the edge of the module. $4 each on Aliexpress, but goodness knows how long they will take to arrive. Definitely not before Christmas

Edit.

I did try to get the PC tool chain working the other day, using Cygwin , following instructions on the web, but gave up as I had multiple issues. But I think in the near future someone will get a reliable PC tool chain working
Title: Re: ESP8266
Post by: westfw on Dec 12, 2014, 04:20 am
Here's a link with many of the available variants pictured and linked:
http://www.aliexpress.com/item/ESP8266-serial-WIFI-industry-milepost-type-ESP-12/32240399719.html (http://www.aliexpress.com/item/ESP8266-serial-WIFI-industry-milepost-type-ESP-12/32240399719.html)
(http://esp8266.ru/wp-content/uploads/2014/11/esp8266-espXX.jpg)
Title: Re: ESP8266
Post by: rogerClark on Dec 12, 2014, 09:39 pm
Hi @westfw

I now have 3 x ESP-07 and. 4 x ESP-12 on order from separate suppliers, eBay and aliexpress, so I will update the forum when they arrive.


I've been doing some general experimentation in the code examples, that people have put in GitHub, and its interesting to see how people copy from examples without really knowing why they have added various bits of code.

E.g. I couldn't figure out why some calls to the OS messaging were being made in one example. Or even why an empty system callback function was in the code.

But I've realised that as there is no comprehensive documentation, that all people are doing is copying big chunks of code, often whole files, from the examples to their code, and you end up with redundant code which just serves to confuse ;-)


I did seem to uncover some things that don't seem to be documented, e.g if you create a new process callback function and then call the API to set it to get called by the OS, it doesn't seem to get called with system events e.g. IDLE unless you make an initial call to send an OS message to tasks of the same priority.

I suspect that the code that sends the message has been put in, as this is a known feature by the manufacturer, and may be a workaround.

Anyway, I will post more later...
Title: Re: ESP8266
Post by: westfw on Dec 13, 2014, 09:34 am
My "working" ESP-01 seems to have died.  Minutes ago it was doing fine, and I was trying to get "transparent mode" working, or seeing whether it had some of the other AT commands from previous networking products.  Then it hung up, and now it's drawing nearly 1A from the power supply, and not sending any test to the serial port at all :-(

(My, what poorly commented source code!  Sigh.)
Title: Re: ESP8266
Post by: rogerClark on Dec 13, 2014, 12:21 pm
@westfw

Umm, that doesn't sound good.

Have you tried reflashing it ?

Any idea what you could have done to cause it to start drawing an amp?

My ESPis still going OK, and I have another 2 on standby.

Actually.I though I had ESP-03's but I think I have 3 off ESP-01.
I've got ESP-03's on order.


I've really not been doing anything groundbreaking, just modifying the http server so that it always switches to AP mode, and I've modified the CGI for the index page so that it can show the ADC value on that page.

I need to wire in another push button onto the onlin free GPIO line left on my ESP-01, which is GPIO2 so that I can get the firmware to go into AP mode if this button is pressed (at GND) when the firmware starts.

i.e I want to be able to set the SSID and connection params to my network using a web UI and then reboot the device to use those params.

I'm sure someone must have done this before, but I"ve not seen any code for it.




Title: Re: ESP8266
Post by: Paulware8 on Jan 01, 2015, 12:49 am
Today I updated my github project: https://github.com/Paulware/ESP8266 (https://github.com/Paulware/ESP8266)

I received the pcb back from China for a small footprint (2 in / 1.25 in), which connects an atmega328 to an ESP8266 running at 9600 baud on D11/D12.
The eagle schematic for this pcb is located in the Schematics/ESP8266Tiny directory.
I created an arduino sketch with supporting files located in the ESP8266UDP_CommCheck directory.

The Arduino project has a serial menu so you can set ssid/password from the Arduino IDE.  Ssid and password are stored in EEPROM as well as the unique key which identifies this particular network node.  The unit will respond to a udp broadcast from the network master, which could be done from a raspberry pi or an android device.

This device can make a very nice sensor for temperature/water or allow you to drive relays.



Title: Re: ESP8266
Post by: rxpc on Jan 01, 2015, 08:45 pm
Hi everyone, looks like you guys have done some great work on this new chip already, does anyone know if the ESP8266 offers power management features?

Happy New Year!
Title: Re: ESP8266
Post by: rogerClark on Jan 01, 2015, 09:14 pm
AFIK

 The ESP8266 has 2 low power modes, but I have to tried either.

I'm not sure if the AT command set supports either, but as the AT firmware is open source, its quite possible to enhance and recompile and reflash the device.

In fact, its almost impossible to use the device in the first place without reflashing it, because there is no way to know what firmware it comes with from China.

Of course if you buy a board from PaulWare he would put the correct firmware in th esp8266 I presume ;-)

Anyway, back to power modes.

Deep sleep seems to be the most used method, and the API function causes deep sleep for a predefined length of time.

Theoretically you can also do wake on interrupt, but I've not seen any code that demonstrates how to do that.

From what I recall, on wake from deep sleep is virtually the same as power cycling the device, I.e I don't think internal ram vars are retained, but it is possible to store stuff in flash albeit with a limited number of write cycles.

I think there may be another less drastic low power mode, but I have not investigated it, so is could be wrong about its existence. Note there is a lot of conflicting information out there about the ESP8266

So take everything you read with a pinch of salt.
Title: Re: ESP8266
Post by: rogerClark on Jan 01, 2015, 09:17 pm
Paul

Btw have you seem the new 0.1 in pitch esp8266 modules that are appearing on eBay recently?

Not exactly Arduino compatible, but they at least plug into a breadboard
Title: Re: ESP8266
Post by: Paulware8 on Jan 02, 2015, 02:32 am
I've only used the ESP-01, and used the firmware that the vendors have provided.
Can you post a link to the ebay modules?
thanks
Title: Re: ESP8266
Post by: rxpc on Jan 02, 2015, 04:44 am
After reading through these posts, I became interested in these chips. I've seen the ESP-01's on Ebay for about $2.70 a piece. I might check these out...

http://www.ebay.com/itm/2-69-each-ESP8266-ESP-01-5x-Simple-Serial-WIFIArrive-1-10-BizDays-/281470224472?pt=LH_DefaultDomain_0&hash=item4188eec858
Title: Re: ESP8266
Post by: rogerClark on Jan 06, 2015, 07:24 am
IMHO ESP-01's are quite limited unless you are need absolutely the smallest device.

I think there is only one usable GPIO line, unless you use RX and TX serial lines as GPIO

A better bet is the ESP-03 or even better the ESP-12.

I have all 3 types and only the ESP-12 has the analog input line to a pin on the PCB and also its the only one that has GPIO16 to the PCB, and GPIO16 is needed if you want to use the onboard deep sleep mode without needing an external processor to control this device.

If you are just buying for testing, an even better option is the 0.1 inch pitch boards which have recently become available.

I thought these 0.1 pitch boards, which will plug into a breadboard were on ebay, but now that I've looked I can't see them, but perhaps they are only on ebay.com or another ebay site, ie. not on my local ebay.com.au


Take a look on www.esp8266.com in the general discussion  forum, you can probably find a link in there is you are interested.




Title: Re: ESP8266
Post by: Paulware8 on Jan 07, 2015, 12:20 am
Or you could use the atmega328 for gpio (like an arduino), and use the esp8266 for network traffic.
I connect them together in a small footprint (1.5 inc * 2 inch) pcb, and use the Arduino ide for programming.

My eagle schematic (using 3.3V regulator) is located in the github directory: https://github.com/Paulware/ESP8266/tree/master/Schematics/ESP8266Tiny.

For this purpose the ESP-01 is adequate.
Title: Re: ESP8266
Post by: rxpc on Jan 07, 2015, 05:36 pm
Ahh, great, thank you guys for the information.  I mainly wanted to just run some tests with one of these chips.  Right now all my sensor nodes use RFM12B's with an attiny85.  All the nodes work great and the power saving features of the both these chips is very good, coin batteries last a long time(over a year now).

While my sensor nodes are small, I wish I could get them even smaller, I have a plant water level sensor, but I used an old walwart housing for it.  All the components fit snug, but it's very noticeable next to the plant.

I was hoping to miniaturize the nodes I already have, with comparable power saving features and possibly using less components.
Title: Re: ESP8266
Post by: oroboss on Jan 07, 2015, 06:12 pm
I am not sure ... can be ethernet shield replaced with this ESP8266?
Title: Re: ESP8266
Post by: Paulware8 on Jan 07, 2015, 11:55 pm
Basically the esp8266 provides the capability of a wifi shield.

Some differences are:
 ESP8266 protocol is serial: Whatever you send to its serial line is interpreted as AT commands.
 Since the normal serial line is also used to flash an Arduino, I think you should either use a MEGA (which has more than one serial port) or use soft serial to communicate with the ESP8266.  One caveat is that soft serial does not work at the higher baud rates.  I've had best result with the lowest baud rate (9600).

There is a shield schematic in https://github.com/Paulware/ESP8266/tree/master/Schematics/ESP8266Shield (https://github.com/Paulware/ESP8266/tree/master/Schematics/ESP8266Shield) that could be a replacement for an ethernet shield, but it would give you the additional wifi capability and would need AT commands to talk on the network.

No sensor is complete without a watchdog guarding against system lock-ups.  I've had trouble using atmega328's internal hardware watchdog, so I will try to create one using a 555 timer.  This will be similiar to the project: https://github.com/mattbornski/Arduino-Watchdog-Circuit (https://github.com/mattbornski/Arduino-Watchdog-Circuit), but I think I will use an npn transistor to ground the trigger line.  Attached is a .jpg diagram of the idea.


Title: Re: ESP8266
Post by: flagtrax on Feb 07, 2015, 06:03 pm
Hi all, I don't know if anyone else has come across the documentation for the AT commands, and their returned values, but I came across a document translated from Chinese to German, to English by
bafeigum on the hackaday blog. (thank you bafeigum!) Good information for newbies getting started, as well as great reference material.
Title: Re: ESP8266
Post by: flagtrax on Feb 10, 2015, 04:04 am
Well, you guy's are definitely way ahead of me for sure. Seems I spend more time searching for information than anything. I'm posting some of what I find in an effort to be helpful to those just picking up on this interesting module. I have been able to send commands through it to the UNO, described in a tutorial on the AllaboutEE site. That was the good news. The bad news is that the desired result, in this case clicking a button on an html page to turn on an LED has a tremendous lag. Also it seems that if a command is sent to quickly behind a previous one things get backlogged. It may take minutes to clear out. I'm not sure where all that is happening, but it definitely builds a case for programming the ESP for use on its own. In that regard, I came across a youtube video that helps understanding that concept. In case one hasn't seen it.

https://www.youtube.com/watch?v=pWo-ErpVZC4#t=64
Title: Re: ESP8266
Post by: rogerClark on Feb 10, 2015, 04:12 am
flagtrax

I'm not using this myself, but I'd recommend you take a look at the lua firmware, it can operate as a basic web server and you can still communicate to the Arduino via Serial , but you'd need to write your own command parser in lua

Title: Re: ESP8266
Post by: Chagrin on Feb 10, 2015, 06:43 am
I'm not using this myself, but I'd recommend you take a look at the lua firmware, it can operate as a basic web server and you can still communicate to the Arduino via Serial , but you'd need to write your own command parser in lua
The word I assume you're looking for is "NodeMCU" (link to firmware (https://github.com/nodemcu/nodemcu-firmware/tree/master/pre_build)) and yeah I really recommend it as well. I wouldn't say it's required to spend a lot of learning time with lua though; in my case I just set it to act as a Wifi-to-serial bridge using some example programs I grabbed from the esp8266.com forums. I don't need an additional speck of lua code in my Arduino sketch after that initial setup.
Title: Re: ESP8266
Post by: rogerClark on Feb 10, 2015, 07:40 am
Quote
The word I assume you're looking for is "NodeMCU" (link to firmware)
Yes ;-)
Title: Re: ESP8266
Post by: bojankoce on Feb 20, 2015, 01:01 am


Hey guys.

I use ESP8266 module and Arduino UNO to control 40W light bulb via simple relay (5V input, 10A/250V output). In my first iteration of the project, I used LED diode instead of a light bulb. Everything was DC and everything worked fine! By the way, I give power supply to the ESP8266 module through 3.3V pin on the Arduino Uno board.

However, when I replace LED with a 40W light bulb supplied by AC, troubles appear! I eventually can ON/OFF light bulb just one or two times and everything just stop. It seems to me that the presence of the AC supplied wires introduces some noise that makes ESP8266 module confused and frozen.
I just wanted to hear from you about your experience with the ESP8266 module around AC wires. Did you encounter any trouble ? Is there anything I'm missing all the time ?

Thank you in advance for your time and effort.

Sincerely,
Bojan.
Title: Re: ESP8266
Post by: oxijin on Feb 20, 2015, 03:22 am
There's a new ESP8266 Arduino WiFi Shield available at www.8266.rocks.  Lots of information including examples, schematics, instructions and tutorial videos are available here.  http://www.8266.rocks/#!freeboarddweetexample/c3vb (http://www.8266.rocks/#!freeboarddweetexample/c3vb)

(http://static.wixstatic.com/media/cbd0d3_179400f99bb84894a69908d86d9884ff.png_512)

Title: Re: ESP8266
Post by: Simpson_Jr on Feb 20, 2015, 12:58 pm
Looks quite nice,  I like the possibility of using it as either shield/standalone board, with the freedom to choose every pin you like.  It's a pity only 2 types of modules can be used.

Unfortunately I won't be buying an 8266 soon, my wife won't even allow me to visit Ebay for more as 5 minutes a day, because of our bank account :(

Anyway, I have been creating an Eagle Cadsoft library for modules 1 - 12 though plus 2 DW- modules.

Feel free to use it any way you like...
Title: Re: ESP8266
Post by: PSG_Guru on Feb 20, 2015, 05:07 pm
Hello,
    Simplest way to send message from an Android app using ESP8266 to Arduino Mega? I would deeply appreciate help in terms of the Connection of the app and the ESP8266 ; and sending data, to light an led on pin 13 of Mega2560.
Thanks
Title: Re: ESP8266
Post by: rogerClark on Feb 20, 2015, 09:38 pm
What do you mean by

Arduino app
Title: Re: ESP8266
Post by: PSG_Guru on Feb 21, 2015, 05:24 am
What do you mean by

Arduino app
Sir,
   Its ANDROID app.
Title: Re: ESP8266
Post by: rogerClark on Feb 21, 2015, 05:36 am
OK.

Which "Android App" , there are so many of them ;-)
Title: Re: ESP8266
Post by: PSG_Guru on Feb 23, 2015, 08:10 pm
We made an app suggested by
http://allaboutee.com/2015/01/20/esp8266-android-application-for-arduino-pin-control/
But, issue is, it ain't working for us. So thought of sharing and getting some help form the forum.
i just wanna know Can I 'Send data, like a button press on an APP saying 'GO', which is read by the arduino Mega, via ESP8266, and send it to a particular PWM pin, say pin #2 on MEGA, to be read by other hardware connected to that particular PWM pin (#2)'
Thanks
Title: Re: ESP8266
Post by: rogerClark on Feb 24, 2015, 12:42 am
Quote
i just wanna know Can I 'Send data, like a button press on an APP saying 'GO', which is read by the arduino Mega, via ESP8266, and send it to a particular PWM pin, say pin #2 on MEGA, to be read by other hardware connected to that particular PWM pin (#2)'
Yes. This is technically feasible
Title: Simplest way to send message from Android App to Mega.
Post by: Paulware8 on Mar 03, 2015, 02:14 am
  Sorry this is off -topic, but I have found the simplest way to communicate from Android to Mega or Arduino is using bluetooth and MIT App Inventor 2.
Title: Re: ESP8266
Post by: electricalhobbyist on Mar 04, 2015, 03:44 pm
ESP8266 can work stand alone. Can switch on and off devices. I have seen it here. might as well help. http://thinkingparts.blogspot.com/2015/02/home-automation-lan-based-stand-alone.html
Title: Re: ESP8266
Post by: trackerj on Mar 04, 2015, 07:34 pm
ESP8266 can work stand alone. Can switch on and off devices. I have seen it here. might as well help. http://thinkingparts.blogspot.com/2015/02/home-automation-lan-based-stand-alone.html
If you want it standalone, take a look also here:
http://esp8266-projects.blogspot.com/2015/03/esp8266-cbdb-web-power-switch-for-mains.html

It still looks more stable using ESP8266 Module as WIFI only module and run the Main Application on a separate MCU, but for small apps it's quite stable already :)
Title: Re: ESP8266
Post by: EasyIoT on Mar 06, 2015, 09:18 am
Here are some useful tutorials for ESP8266 and Arduino:


ESP8266 temperature and humidity sensor (http://iot-playground.com/15-esp8266-wifi-temperature-and-humidity-sensor)

ESP8266 relay switch (http://iot-playground.com/16-esp8266-wifi-relay-switch)

ESP8266 water leak (rain, soil moisture) sensor (http://iot-playground.com/18-esp8266-wifi-leak-rain-soil-moisture-sensor)

ESP8266 air pressure and weather forecast sensor (http://iot-playground.com/21-esp8266-wifi-air-pressure-and-weather-forecast-sensor)

ESP8266 real time clock display (http://iot-playground.com/23-esp8266-wifi-real-time-clock-display)

ESP8266 LED dimmer (http://iot-playground.com/2-uncategorised/28-esp8266-wifi-led-dimmer)

ESP8266 touch screen thermostat (http://iot-playground.com/2-uncategorised/31-esp8266-wifi-touch-screen-thermostat)


It uses EasyIoT server (windows or Raspberry) with nice Web interface. It also supports SMS control, native app (comming soon), data logging and automation functions.

(http://iot-playground.com/images/articles/001/23-12-2014_0-23-29.png)

(http://iot-playground.com/images/articles/004/dimmer.png)
Title: Re: ESP8266
Post by: impeham on Mar 28, 2015, 01:10 am
see attached pics for this pins and serial monitor screenshots.

i just got the ESP8266 module from here:

http://www.ebay.com/itm/ESP8266-Serial-WIFI-Wireless-Transceiver-Module-Send-Receive-LWIP-AP-STA-arduino-/181583935325?pt=LH_DefaultDomain_3&hash=item2a473ef75d

I wired it up:
RX to arduino's pin 3
TX to arduino's pin 2
VCC + CH_PD to 3.3v input (not related to arduino)
GND (black) to ground

Using the following arduino code:

--------
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2,3);

void setup()
{
  mySerial.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}
--------
The wifi red led is working, and I'm trying to send commands to it using the serial monitor (it is set to 9600 baud and carriage return mode).
When I send the command, I can see the WIFI's blue light flickering (I'm sending AT+GMR to display its firmware version) - seems that it is getting the transmission, but the serial monitor displays strange characters and not the expected result (happens for any AT command I send).

I want to test it with AT commands before I code an arduino app for it.


What am I missing here?

Title: Re: ESP8266
Post by: rogerClark on Mar 28, 2015, 06:50 am
Hey Guys

I'm not sure if any of your have seen this new thread


http://forum.arduino.cc/index.php?topic=311117.new#new (http://forum.arduino.cc/index.php?topic=311117.new#new)

This is compiling code straight onto the ESP8266 using the Arduino IDE.

You can get an installer exe from the guys website, which puts the files in the Windows Programs (x86) folder, or the technically better approach for Arduino 1.6.x (which is now the current release of the Arduino SW) is to copy the files into use hardware folder in the normal Arduino folder e.g. where the libraries folder is

So I've forked the repo and built a version for 1.6.x  

https://github.com/rogerclarkmelbourne/arduinesp


Note. Looking at the current code it seems to be based on some older version of the Arduino, I'm not even sure its Arduino 1.0 as the Hardware Serial class is not derived from the Stream class as it is in Arduino 1.0

However it does work !


Edit

Someone just told me about another Arduino to ESP8266 build
https://github.com/esp8266/Arduino (https://github.com/esp8266/Arduino)
Title: Re: ESP8266
Post by: impeham on Mar 28, 2015, 10:44 am
i looked at the example here:

http://www.arduinesp.com/getting-started/

it is working, but i found a very strange thing happening - the Wifi module responds ok only if its VCC/GND pins connected to 5v and GND of the USB to UART adapter.

if i try a different power source (batteries/other power outlet) i get strange output text from it.

i compared the voltages/amp of the USB and my other sources and made sure they are the same and still - with USB as power sources output of WIFI in serial monitor is ok while with other it isn't.

why is that?

second issue i'm now having is not being able to upload code it even though using it from the serial monitor with AT commands works fine.

this is the output i'm getting when trying to upload this (empty) sketch:

------
void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

------
output:

Sketch uses 26,726 bytes (13%) of program storage space. Maximum is 200,000 bytes.
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm cmd: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_sync failed
error: espcomm_open failed
Title: Re: ESP8266
Post by: pYro_65 on Apr 04, 2015, 05:46 pm
Wow, I have to say these chips seems pretty impressive.
Just bought four of the ESP-12's, Should make a nice little sensor network.

I started reading about these modules after seeing a kick-starter project using them, so many possibilities.

Roger, your core for the IDE seems popular, good work. Will have to try it once the boards arrive.
Title: Re: ESP8266
Post by: rogerClark on Apr 04, 2015, 10:21 pm
Guys

My version does work, "out of the box" on 1.6.1

However I have been discussing things with the main developer at esp8266.com ( Ivan in St Petersburg ), and apparently the version of the Xtensa compiler I'm using, in the repo, has some issues due to the way it was compiled.

If you have issues with mine, there is another and potentially better repo that does the same thing, by a Canadian guy call Sampreet Mistry, which uses the compiler binaries compiled by Ivan.

However I'm not sure whether Sampreets version works on 1.6.1. Though it appears to be ok on 1.6.3

There is some strange issue with paths to gcc helper dll's which cause issues with Ivan's version of the compiler

I've been trying to track down precisely what's going on with this, for the last 3 days, with no luck, except 1.6.3 doesn't seem to have this issue- so it could be a path environment bug in the IDE.

I know this thread was about arduinesp.com, but unless the OP has updated his version from the master copy at  GitHub.com/esp8266/Arduino I'd recommend you either download Ivan's specially modified version of the IDE from GitHub or use my version of it, or probably even better use sampreets version.


But getting back to the point.

Yes. The are amazing devices, I have several versions including the one you mentioned
Title: Re: ESP8266
Post by: veseo on Apr 10, 2015, 11:47 am
I added a UDP example: https://github.com/Paulware/ESP8266 (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.
Hi Paul,

this looks a nice way to start the communication, but it won't work out of a LAN. Is there a way to start a communication from outside a LAN?

Dario.
Title: Re: ESP8266
Post by: pYro_65 on Apr 10, 2015, 02:00 pm
An ESP8266 can be put into access point mode. Other wifi devices can connect to it!

It seems to have support for direct Wifi too, but the API might not be up to date with all the chip features yet.
Title: Re: ESP8266
Post by: impeham on Apr 13, 2015, 09:36 pm
I got an ESP8266 module and after upgrading its firmware with the arduino IDE (burn bootloader) I connected it successfully to an arduino uno 3 using the following sketch:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);

void setup() {
  // put your setup code here, to run once:
  mySerial.begin(115200);
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read()); 
}

I am able to send AT commands from serial successfully through the arduino to the module and get the output.

When I try to do the same with an arduino nano, connecting it to pins D2 and D3 with the same sketch, it doesn't work. I am using the same power for the wifi module (external from the arduino's) and just move the 2 RX,TX pins from the uno to the nano.

When I try to send any command, the serial light in the nano blinks but not the ESP's one. It's like there is a communication problem between them.

I tried to upload the sketch to the nano with different speeds (9600 and 19200) and still the same behavior. If I power off/power on the ESP while the arduino serial monitor is open, I get funny looking characters and a short blue led blink and that's it.

Any ideas?
Title: Re: ESP8266
Post by: CrossRoads on Apr 13, 2015, 09:53 pm
How are you powering the ESP8266?
Title: Re: ESP8266
Post by: impeham on Apr 14, 2015, 02:38 am
using a Voltage Regulator board connected to 12v power source (the output of the regulator is 3.5v). i don't think this is related to power since i am not changing the power source at all - only the (RX,TX) pins from the uno to the nano - the other wires are not changed, and it is working well when connected to the uno.
Title: Re: ESP8266
Post by: rogerClark on Apr 14, 2015, 03:32 am
Are you using some sort of voltage level translators between the Nano and the ESP8266 for the TX line from the Nano ?

e.g. resistor divider network?

Also. You could try disconnecting the esp8266 and connect the software serial pins together and do a loopback test, to prove you don't have a software problem

Title: Re: ESP8266
Post by: mcnobby on May 01, 2015, 08:23 pm
Hi All, just looking into this grand little beast as part of my ongoing wireless doodling !!

I see you are all discussing these boards, do they all do different things ? (the ESP-08, ESP-03 numbers I mean)

Is THIS (http://www.ebay.co.uk/itm/161679922119) any good to get me started ?

I just want to connect to my Wifi and run a '328 as a server

I see chat about downloading code onto the processor and run them standalone, is that right ?

Regards Bob
Title: Re: ESP8266
Post by: pYro_65 on May 02, 2015, 01:22 am
Might as well go with one that exposes more pins of the ESP8266 IC like ESP-12.
There are even newer ones out that expose the SPI connection too (somewhere, only seen pictures).

Here is one with an adapter board for example: http://www.ebay.co.uk/itm/ESP8266-Esp-12-Remote-Serial-Port-WIFI-Transceiver-Wireless-Module-IO-adapter-/131499974902?pt=LH_DefaultDomain_3&hash=item1e9e0260f6 (http://www.ebay.co.uk/itm/ESP8266-Esp-12-Remote-Serial-Port-WIFI-Transceiver-Wireless-Module-IO-adapter-/131499974902?pt=LH_DefaultDomain_3&hash=item1e9e0260f6)


An Arduino can talk to it via Serial using AT commands, and yes, you can replace the firmware with your own, and use it by itself. There has been an Arduino core (http://www.esp8266.com/viewforum.php?f=25) ported to it (so you can use digitalRead/digitalWrite/...).

The ESP8266 will probably make a better server by itself (https://github.com/esp8266/Arduino/blob/esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino (https://github.com/esp8266/Arduino/blob/esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino) / https://github.com/israellot/esp-ginx (https://github.com/israellot/esp-ginx)) than a 328 with 2K of ram. A 328 could be used to add lots of IO to the ESP.
Title: Re: ESP8266
Post by: mcnobby on May 02, 2015, 08:30 am
Cheers Pyro - is the ESP8266 run on an AVRthen ?
Title: Re: ESP8266
Post by: rogerClark on May 02, 2015, 10:42 am
@mcnobby

Use this

https://github.com/sandeepmistry/esp8266-Arduino/

it works the same as Arduino_STM32 ie its just hardware files

Title: Re: ESP8266
Post by: mcnobby on May 02, 2015, 11:52 am
@Roger, I havent got any hardware as yet, China - ya know !

I will probably start with just getting it going via serial first, then maybe move on to 'what else can this jigger do ?'

But before all of that, I am hardwiring with ethernet

:)
Title: Re: ESP8266
Post by: lightaiyee on May 20, 2015, 07:47 am

I would like to have a ESP8266 firmware that allows the module to switch between SoftAP and WiFi client.

ESP8266 module receives an AT command AT+SoftAP. ESP8266 module becomes an Access Point so that other WiFi clients can connect to it and send configuration settings.

ESP8266 module receives an AT command AT+WifiClient. ESP8266 module becomes a normal WiFi client that can connect to an Access Point.

May I ask if this is possible with ESP8266?
Title: Re: ESP8266
Post by: rogerClark on May 20, 2015, 07:57 am
The ESP8266 can act as both AP or client, but I think it may need to reboot when you change from AP to client

I wrote an IoT device which starts as an AP and runs a web server to allow configuration, and after config is complete, it reboots and connects as a client

However I didnt do this using AT commands, I did it in code.


Now that the ESP8266 Dev team have made Arduino "cores" file for the ESP8266, you may find its better to write code to do this in the Arduino IDE rather than trying to use the AT commands

Title: Re: ESP8266
Post by: killerspec on May 24, 2015, 02:07 pm
HI all

I am new to the ESP range and have the ESP-01. I have a ttl programmer and have the set it up to converse with the Arduino IDE. I have selected the comms port in my case comms port 3 and set carriage return to 115200. When I plug in my ttl programmer I am getting a windows driver message which says Microsoft Serial Mouse failed.

Any ideas on what maybe the issue here?

Matt
Title: Re: ESP8266
Post by: pYro_65 on May 28, 2015, 11:51 pm
@killerspec, is this still a problem.

You could open your device manager and delete the drivers for it, then re-installing them should fix it. Mine never showed up as a mouse, but did require a manual install as the automatic install failed.
Title: Re: ESP8266
Post by: killerspec on May 31, 2015, 04:37 am
@killerspec, is this still a problem.

You could open your device manager and delete the drivers for it, then re-installing them should fix it. Mine never showed up as a mouse, but did require a manual install as the automatic install failed.
Thanks a million will try this in the morning.
Title: Re: ESP8266
Post by: baranbaran on Jun 07, 2015, 09:26 am
it will be great if you do that....good luck
Title: Re: ESP8266
Post by: impeham on Jul 02, 2015, 12:51 am
i've attached a word document to show the output i got from the serial monitor - the following is copied from it to whoever don't have a doc reader:

I'm using ESP8266 03 with baud rate of 9600:

First - connecting the ESP to the PC's usb using Power source/pins of ESP not changed - only TX/RX now connect through "CP2102 USB 2.0 to TTL UART 6PIN Module Serial Converter" (the power source is the USB's 3v output):
AT and AT+GMR commands looks ok.

Next - try to connect to access point, command:
AT+CWJAP="ssid","somepassword"
The ssid and password are printed correctly (they are false - that's why the error)

Next - ESP power source stays the same, only TX and RX are moved to pins 2 and 3 of the arduino nano - the serial monitor is now connected to the arduino nano, and the code on the nano is just printing the output of one another - this is the code uploaded to the nano:

---
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
}

void loop() {
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}
---

AT and AT+GMR looks ok, Trying to connect to the access point, command:
AT+CWJAP="ssid","somepassword"
results with bad characters and it won't succeed to connect (even if ssid and password were correct - I verified in the router).
   
The question is - why does it behave differently? Why through the nano some sent characters are being passed incorrectly and is there a way to fix that?
Title: Re: ESP8266
Post by: gelraen on Jul 22, 2015, 10:47 pm
Shameless plug:

JavaScript interpreter for ESP8266 - https://github.com/cesanta/smart.js
Supports I2C (bit-banging on any GPIOs) and SPI (hardware). Also there's simple HTTP client and rudimentary cloud support.
Title: Re: ESP8266
Post by: JimDrew on Jul 29, 2015, 04:33 am
Does anyone have an example of using the WPS features that were recently added to the library?

Such as:

ESP8266WiFiClass::beginWPSConfig(void)

Title: Re: ESP8266
Post by: electricalhobbyist on Aug 08, 2015, 11:42 am
I hope this one helps, Controlling Appliance and Lights.
1. Stand alone ESP8266-12E wifi Module
2. Arduino and ENC28J60 ethernet module

I was able to control my lights and water pump where ever i am for three months already now, i can also monitor my power consumption thru internet. here is the link guys. The design is great.
Title: Re: ESP8266
Post by: electricalhobbyist on Aug 08, 2015, 11:43 am
I hope this one helps, Controlling Appliance and Lights.
1. Stand alone ESP8266-12E wifi Module
2. Arduino and ENC28J60 ethernet module

I was able to control my lights and water pump where ever i am for three months already now, i can also monitor my power consumption thru internet. here is the link guys. The design is great.
Heres the link guys. I really hope it helps a lot.
http://thinkingparts.blogspot.com/2015/08/home-automation-controlling-home.html
Title: Re: ESP8266
Post by: rhiakath on Aug 16, 2015, 02:27 am
Hi there. I just acquired an esp8266, to connect to my atmega328p and am trying to configure it, but am currently unable to do anything with it.

I am currently using it connected to a raspberry pi, since it's easier to debug.

When i plug it in, using baud 115200, 8N1, i get a whole lot of garbage, followed by this:

Ai-Thinker Technology Co. Ltd.

invalid


I've seen in other places that this is not a reason to worry about, but i should be getting some useful info instead of that garbage, right?

also, after that, every command i type, only returns error. every single one.

I also am in doubt if this is properly connected. I've connected ground, tx and rx, and then CH_PD and VCC to 3.3V.

I've tried with gpio0 to low and 2 high. also both low.
also tried with reset high.

It always does the same. What can i do?
Thanks.
Title: Re: ESP8266
Post by: rogerClark on Aug 17, 2015, 03:52 am
From what I've read the initial garbled text is sent at a strange baud rate of 74880 during bootup

What it sends after that is entirely dependant on what firmware is loaded into the ESP8266

Title: Re: ESP8266
Post by: rhiakath on Aug 18, 2015, 09:41 pm
ok, what about the constant error reply?

and are my connections ok? I've seen people do very different connections on these.
Title: Re: ESP8266
Post by: Erni on Aug 20, 2015, 10:03 am
Quote
are my connections ok?
It depends on which module you have, there are more than 10 different variants.

If it is an ESP8266-01 you can see the connections here:

http://esp8266basic.com/flashing-instructions/
Title: Re: ESP8266
Post by: gunjalshah on Sep 09, 2015, 07:28 am
I want to interface esp8266 to a controller to just connect to a network and open a webpage to check if its working. Can anybody provide me how to do it?
Title: Re: ESP8266
Post by: Erni on Sep 09, 2015, 03:49 pm
If you use LUA, you could make a simple webserver like this:

http://ernstc.dk/arduino/esp8266.html (http://ernstc.dk/arduino/esp8266.html)

Code: [Select]
if(t==nil) then
  t=12
end
srv=net.createServer(net.TCP) srv:listen(80,function(conn)
    conn:on("receive",function(conn,payload) print(payload)
    conn:send("HTTP/1.1 200 OK\n\n")
    conn:send("<html><body>")
    conn:send("<h1>Erni's ESP8266</h1><BR>")
    conn:send("TEMP : " .. t .. "<BR>")
    conn:send("NODE.HEAP : " .. node.heap() .. "<BR>")
    conn:send("TMR.NOW : " .. tmr.now() .. "<BR>")
    conn:send("</html></body>")
    conn:on("sent",function(conn) conn:close() end)
  end)
end)
Title: Re: ESP8266
Post by: sapan on Sep 18, 2015, 09:44 am
Hello Team,

I am having Issue while connecting ESP8266 with Arduino Mega. It always says "Module have no response."

Please check and correct me if I am wrong anywhere.

 I am using below code and and wiring diagram is on this URL: http://3.bp.blogspot.com/-u7cLC4-x72c/VVGGVWfPmrI/AAAAAAAAci0/RYynhrWZQ38/s1600/wiringDiagram.png



//#include <SoftwareSerial.h>
   //use mega Serial 2 for serial monitor; Serial 1 on pins 19 (RX) and 18 (TX);// Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX).
   #define SSID "SopraSteria"
   #define PASS "1234567890"
   #define DST_IP "220.181.111.85" //baidu.com
   //SoftwareSerial dbgSerial(10, 11); // RX, TX
   void setup()
   {
     // Open serial communications and wait for port to open:
     //serial 2 is to esp8266
     Serial2.begin(115200);//9600 (mine), 57600, 115200
     Serial2.setTimeout(2000);
   
     //serial 0 is to usb
     Serial.begin(115200);
     
         
     while(!Serial);
     while(!Serial2);
     
     //dbgSerial.begin(9600); //can't be faster than 19200 for softserial
     //dbgSerial.println("ESP8266 Demo");
     Serial.println("ESP8266 Demo on Mega2560");
   
    while(Serial2.available()>0)
    Serial2.read();
     
     delay(1000);
       //test if the module is ready
     Serial2.println("AT+RST");
     //delay(1000);
     //delay(1000);
     Serial.println("Resetting module");
     Serial2.flush();
     
     //if(Serial2.find("ready"))
     if(Serial2.find("Ready")||Serial2.find("ready"))
     {
       //dbgSerial.println("Module is ready");
       Serial.println("Module is ready");
     }
     else
     {
       //dbgSerial.println("Module have no response.");
       Serial.println("Module have no response.");
       //while(1);
     }
     delay(1000);
     //connect to the wifi
     boolean connected=false;
     for(int i=0;i<5;i++)
     {
       if(connectWiFi())
       {
         connected = true;
         break;
       }
     }
     if (!connected){
      //while(1);
      Serial.println("Not Connected.");
     }
     delay(1000);
     //print the ip addr
     
   Serial2.println("AT+CIFSR");
     Serial.println("ip address:");
     while (Serial2.available())
     Serial.write(Serial2.read());
   
   
     //set the single connection mode
     Serial2.println("AT+CIPMUX=0");
   }
   void loop()
   {
    connectWiFi();
     String cmd = "AT+CIPSTART=\"TCP\",\"";
     cmd += DST_IP;
     cmd += "\",80";
     Serial2.println(cmd);
     Serial.println(cmd);
     Serial.println(cmd);
     if(Serial2.find("Error")) return;
     cmd = "GET / HTTP/1.0\r\n\r\n";
     Serial2.print("AT+CIPSEND=");
     Serial2.println(cmd.length());
     if(Serial2.find(">"))
     {
       //dbgSerial.print(">");
       Serial.print(">");
       }else
       {
         Serial2.println("AT+CIPCLOSE");
         //dbgSerial.println("connect timeout");
         Serial.println("connect timeout");
         delay(1000);
         return;
       }
       Serial2.print(cmd);
       delay(2000);
       //Serial.find("+IPD");
       while (Serial2.available())
       {
         char c = Serial2.read();
         //dbgSerial.write(c);
         Serial.write(c);
         //if(c=='\r') dbgSerial.print('\n');
         if(c=='\r') Serial.print('\n');
       }
       //dbgSerial.println("====");
       Serial.println("====");
       delay(1000);
     }
     boolean connectWiFi()
     {
       Serial2.println("AT+CWMODE=1");
       String cmd="AT+CWJAP=\"";
       cmd+=SSID;
       cmd+="\",\"";
       cmd+=PASS;
       cmd+="\"";
       //dbgSerial.println(cmd);
       Serial2.println(cmd);
       Serial.println(cmd);
       delay(2000);
       if(Serial2.find("OK"))
       {
         //dbgSerial.println("OK, Connected to WiFi.");
         Serial.println("OK, Connected to WiFi.");
         return true;
         }else
         {
           //dbgSerial.println("Can not connect to the WiFi.");
           Serial.println("Can not connect to the WiFi.");
           return false;
         }
       }
Title: Re: ESP8266
Post by: jtheires on Sep 19, 2015, 08:52 pm
rogerClark,
Would you mind sharing how your AP mode ESP8266 works? I see in post #75 in this discussion that you are doing something close to what I want to do...
Have a local network (AP mode?) established by the ESP, which then serves a web page.
Thanks,
James
Title: Re: ESP8266
Post by: cyberteen on Dec 07, 2015, 06:56 pm
Hi guys,
I have this ESP8266-12 Test board, like the one in this link: http://blog.squix.ch/2015/01/esp8266-test-board-review.html
I have been playing it for the past one week. All long, i was using the firmware 0.9.2.2 using ESP_flasher tool.
I wanted to upgrade to the latest one, found in the expressif github page: https://github.com/espressif/ESP8266_AT/tree/master/bin
But while downloading the third file: esp_init_data_default.bin, at the address ,0x7C000, I got a floating point division error.
Still i continued to flash the last file, blank.bin on address 0x7E000. After that I've been encountering this weird problem:
I am powering the module with 3 AA batteries, which has about 3.4V now.  But when i power the esp8266, the voltage shows 2.9v and is constantly decreasing, ultimately the power leds keep on dimming until the board gets fully switched off.
If I take out one battery for about 5 mins, and put it back, it again glows brightly slowly losing voltage until it again shuts down.
While it is powered up, I am still able to flash firmwares to it, but i get only garbage at some random baud rates.
I dont know what to do now. All my connections are correct, and I could very well use the ESP. I dont know whats causing the problem now.!
Please help me out.
Title: Re: ESP8266
Post by: cyberteen on Dec 08, 2015, 01:42 pm
Replaced the board with a fresh set of batteries. Its working good now!
Since this happened right after flashing the new firmware, I got freaked out! Maybe I should switch to rechargeable AA batteries or use a 5V DC adapter and regulate it to 3.3 V.
Title: Re: ESP8266
Post by: twim on Dec 11, 2015, 11:14 pm
Hi all,
I'm worked the last few night for an ambitious project. Build a cheap WiFi shield for the Arduino boards using the ESP8266 module.
I want to use the standard ESP firmware and I have a programming model similar to the Ethernet/WiFi libraries so I can reuse existing code.

(http://cdn.instructables.com/FSQ/F72H/IHS3QT3B/FSQF72HIHS3QT3B.MEDIUM.jpg)

Here are some links:


Let me know if you find it useful or if you have problems making it.
Title: Re: ESP8266
Post by: rrwiyatn on Jan 10, 2016, 09:03 am
Hi guys,

I just bought an ESP8266-01. I hooked it up with my UNO but it does not work. I've spent hours try to fix it, but still can't make it work. Here's how I hook it up:

1) Vin from UNO --> 3.3V regulator --> ESP8266 VCC
2) UNO Rx --> ESP8266 Rx (i tried Rx to tx still doesnt work)
3) UNO Tx --> ESP8266 Tx
4) ESP8266 CHPD --> VCC (3.3V)

I flashed in an empty sketch to my UNO (bare min). When I opened the serial terminal from Arduino IDE, it seems that it doesnt detect anything. I've already tried it with different baud rate and tried both "Carriage Return" and "Both NL&CR". Whenever I send "AT" it won't respond back.

Also, when I power the UNO, the blue light on the ESP8266 is constantly on. I saw some tutorials on youtube and it seems that it should only blink once after being powered. Anyone know what it means if the blue light is constantly on?

Thank you!

R
Title: Re: ESP8266
Post by: uanas1989 on Jan 23, 2016, 05:46 pm
you can test iot based project(Home automation,Relay controll) using the app  https://play.google.com/store/apps/details?id=info.example.infosolution.arduinoespwificontroller&hl=en
Title: Re: ESP8266
Post by: alvinjaison on Feb 16, 2016, 08:11 pm
How to Send data from esp8266 to localhost server using arduino mega
Title: Re: ESP8266
Post by: TBBB on Feb 27, 2016, 08:39 am
I want to use ESP8266 like bluetooth.In this way i want to provide data exchange  between arduino and android phone .I dont found  sample program.Can i help me :) thanks a lot.
Title: Re: ESP8266
Post by: AthulPavithran on Mar 12, 2016, 05:53 am
I am using ESP8266 module.Any one know how set the module with a static IP ?. Is it possible or not?
Looking for replay....
Title: Re: ESP8266
Post by: AthulPavithran on Mar 12, 2016, 06:14 am
Does ESP8266 module able to set with static IP while connecting to network?
Title: Re: ESP8266
Post by: Clemens on Mar 12, 2016, 06:11 pm
Have a look at this thread with an code example at the end:
http://www.esp8266.com/viewtopic.php?f=6&t=3522
Title: Re: ESP8266
Post by: ester on Mar 20, 2016, 12:46 pm
Please use voltage divider because esp8266 use 3.3V and you transmite from arduino 5V.
If you use adator in one line with the bulb, when the bulb on, the adaptor voltage rise more then 5V.
It can burn your esp8266.
It happend to me when I try using remote switch that use adaptor the same line with the bulb. The capasitor exploded.
So use separate line between  adaptor and bulb, and use voltage divider.
Title: Re: ESP8266
Post by: Mjolinor on Mar 20, 2016, 12:59 pm

I think I killed my ESP12.

I have been messing with it for a few weeks and have added servos, a DHT11 and an OLED. All was going well. I wanted to update a web page with the temperature and humidity so went looking through the examples for one that sounded like it would update without reloading the whole page.

I opened WebUpdater.ino, that sounded hopeful and I stuck it on the ESP. I got two buttons so I clicked them and one popped up a load file box which I duly selected any old file from.

One dead ESP later. Seems a bit daft to me to include examples with no warning or indication of what they do. Of course it's easy with hindsight to go and Google the thing and see what it is but this isn't normally something one would do when browsing examples provided for using and learning.

Anyhow, the problem is there, is there a solution other than replacing the ESP?
Title: Re: ESP8266
Post by: Harikishore on Mar 20, 2016, 01:47 pm
Hey guys,
               I'm getting an error on this code for esp8266.
             
               Here is the code

               
Code: [Select]

#include "ESP8266WiFi.h"
// WiFi parameters
const char* ssid = "hari1234";
const char* password = "hari1234";
void setup(void)
{
// Start Serial
Serial.begin(115200);
// Connect to WiFi
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
// Print the IP address
Serial.println(WiFi.localIP());
}
void loop() {
}


 
         I'm supposed to get "Wifi Connected" and "IP address" but i'm getting some garbage data.Here is the screenshot of my serial monitor.Please Help.







(http://i67.tinypic.com/m7bygz.png)
Title: Re: ESP8266
Post by: spetyo on Jun 12, 2016, 07:34 pm
Arduino uno esp8266 connect with blynk app

https://www.youtube.com/watch?v=_A8iyLPsGAw (https://www.youtube.com/watch?v=_A8iyLPsGAw)
Title: Re: ESP8266
Post by: mahesh2000 on Jul 02, 2016, 06:26 pm
is there a low-cost BLE or Bluetooth SoC alternative to the ESP8266? I'm making a commercial device and I want to reduce form factor. My device is battery operated and I'd like to run it off CR2032 coin cell(s) for 4-5 years. Right now, my esp8266 device uses 3xAA batteries or one CR123a. Thanks!!
Title: Re: ESP8266
Post by: ieee488 on Jul 02, 2016, 09:15 pm
is there a low-cost BLE or Bluetooth SoC alternative to the ESP8266? I'm making a commercial device and I want to reduce form factor. My device is battery operated and I'd like to run it off CR2032 coin cell(s) for 4-5 years. Right now, my esp8266 device uses 3xAA batteries or one CR123a. Thanks!!
ESP8266 is wifi.

Bluetooth is Bluetooth.

Do you understand the difference between the two?


Title: Re: ESP8266
Post by: Whandall on Jul 02, 2016, 09:55 pm
is there a low-cost BLE or Bluetooth SoC alternative to the ESP8266?
The ESP32 (http://esp32.com/) will support Bluetooth IIRC.
Title: Re: ESP8266
Post by: ieee488 on Jul 02, 2016, 11:49 pm

The ESP32 (http://esp32.com/) will support Bluetooth IIRC.
Hopefully it will "reduce form factor". 


Title: Re: ESP8266
Post by: JoaoLopesF on Aug 29, 2016, 07:09 pm
Hi,

I just made an Arduino library for ESP8266:

- RemoteDebug, an Arduino library to remote debug over telnet connection.

Use Print commands like Serial and see it with telnet client.
First debug for Arduino with debug levels that I saw.

Please access: https://github.com/JoaoLopesF/RemoteDebug

Or access this video thats shows 3 nodes of ESP8266 been debugging at same time!
https://youtu.be/lOo-MAD8gPo

Suggestions, issues and contributions are welcome.

Regards

Joao Lopes
Title: Re: ESP8266
Post by: herbeysoft on Sep 24, 2016, 08:50 am
please what is the best solution for esp8226 with Arduino error..
such as espcomm syn_failed
Title: Re: ESP8266
Post by: Harikishore on Sep 25, 2016, 11:01 am
please what is the best solution for esp8226 with Arduino error..
such as espcomm syn_failed
Did you select esptool as programmer.

http://www.whatimade.today/esp8266-easiest-way-to-program-so-far/ (http://www.whatimade.today/esp8266-easiest-way-to-program-so-far/)
Title: Re: ESP8266
Post by: tduggan63 on Feb 17, 2017, 09:32 pm
I have tried to connect ESP8266 (version 12) module to Arduino Uno. I have wired it as follows:
Arduino --- ESP8266
RX        --- TX
TX        --- RX
3.3V     --- VCC ; CH_PD ; GPIO 2
GND     --- GND ;  GPIO15


When I type AT into serial monitor on Arduino IDE, I get no response.
I want to use this module as an Arduino Shield with the Arduino to connect to iOS App, but cannot simply get it to connect and respond to Arduino.

Looking for urgent replies,

Regards,

Tara
Title: Re: ESP8266
Post by: mistergreen on Feb 17, 2017, 09:46 pm
I have tried to connect ESP8266 (version 12) module to Arduino Uno. I have wired it as follows:
Arduino --- ESP8266
RX        --- TX
TX        --- RX
3.3V     --- VCC ; CH_PD ; GPIO 2
GND     --- GND ;  GPIO15


When I type AT into serial monitor on Arduino IDE, I get no response.
I want to use this module as an Arduino Shield with the Arduino to connect to iOS App, but cannot simply get it to connect and respond to Arduino.

Google the setup before running.

Looking for urgent replies,

Regards,

Tara
You might have killed your esp8266.
The Arduino UNO Serial is sending out 5V signals into your esp8266. YOU need a logic converter to convert the 5V to 3.3v signal.
 
Title: Re: ESP8266
Post by: westfw on Feb 18, 2017, 12:49 am
Quote
When I type AT into serial monitor on Arduino IDE, I get no response.
What Serial speeds have you tried?   Apparently different vendors have shipped ESP8266 modules with different default speeds.  Try all the standard speeds between 9600 and 115200...
(Also, be careful of your line endings...)

Title: Re: ESP8266
Post by: HeySammy on Mar 22, 2017, 05:51 pm
Hey Guys,

need some help over here,

I am using ESP8266 01 (black edition) and Arduino mega 2560. Now, I just want to transfer data from arduino mega to thingspeak using esp8266 module.

Connection which I have found through internet I have implemented that in ARDUINO UNO board and it works completeley fine BUT, if that same connection I m doing in ARDUINO MEGA 2560 board then it is showing me the below errors:

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Please help me out....Thank you in advance...
Title: Re: ESP8266
Post by: habanero on Mar 23, 2017, 03:05 am
Ditto on connecting the ESP8266 to an Arduino properly. You need to both level-shift the signals AND provide a proper 3.3v power supply as the Arduino's 3.3v pin doesn't provide enough current to properly power the ESP8266. There are now daughterboards for the ESP8266 that do both. I've seen them on eBay for a buck or so. I built my own a while back. Nothing complicated but it has to be done for it to work.

Btw, I'm still communicating with my ESP8266 using standard Serial commands. Is there a decent, reliable library for it at this point, analogous to ones for Ethernet or WiFi shields? I basically wrote my own, in the form of functions to open and close a TCP connection, send an HTTP command, etc., but a standard library would be nice.
Title: Re: ESP8266
Post by: sanglems on Mar 29, 2017, 09:21 am
Facing similar issue with my ESP8266-01 with Arduino UNO R3.

I can't sent the AT command as I am getting loop of FatalException(0) as below as soon as I connect to ESP8266 module: (Can't make out what does this mean)

Fatal exception 0(IllegalInstructionCause):
epc1=0x40201364, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000 ets
Jan 8 2013,rst cause:2,
boot mode:(3,6) load 0x40100000,
len 1856,
room 16 tail 0
chksum 0x63
load 0x3ffe8000,
len 776,
room 8 tail 0
chksum 0x02
load 0x3ffe8310,
len 552,
room 8 tail 0
chksum 0x79
csum 0x79
2nd boot version : 1.5
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 8Mbit(512KB+512KB)
 jump to run
user1 @ 1000

Following are my ESP8266 connection details:
1. Vcc - 3.3v external supply (GND connected to GND of 3.3v and GND of 5v of Arduino)
2. CH_PD - 3.3v
3. GPIO0 - Tried keeping 3.3v (Same Error)
                                    disconnected (Same Error)
                                     GND (Same Error)--(Just tried. I know this will be the programming mode)
4. Rx - Rx of Arduino UNO via voltage divider
5. Tx - Tx of Arduino
    (Tried with exchanging Rx and TX)
6. RST - Disconnected (Same Error)
             3.3v (Same Error)
             (Used the GND pulse to reset the ESP8266)

I also tried connecting RESET of Arduino UNO to GND with no success ;( .

I checked the output with all the baud rates keeping "Both NL & CR" option selected. For baud rate 115200 I am getting the above exception. For rest it showing some garbage values.

I have uploaded bareMinimum example in the Arduino UNO to start with.

Any suggestion, pointer will be really appreciated.

Is my module damaged? Never used it with anything other than 3.3v though.

Thanks.
Title: Re: ESP8266
Post by: mateusguedes17 on Apr 24, 2017, 11:34 pm

Hello I'm doing a project to recognize ssid of the model 5 esp8266, inside it has a menu with some bus lines would like to make a third button to call the string ssid cuff can help me

#include <Wire.h>
#include <LiquidCrystal_I2C.h>


//**entrada dos pinos Digital Pwm**

#define butUp 10  //Pino
#define butDown 9    //Pino
#define butSetar  8 

int id ;

void changeMenu();
void dispMenu();

String SSAID ;
 

void SalvLiCent();
void CletCent();
void VillCamIICent();
void BenBentCentJaci();
void EusGCent();

// *** Variáveis Globais ***

String ssid [5];

ssid
ssid [1] = "{ac@U}"
ssid [2] = "{h82c0U}"
ssid [3] = "{B1AU0}"
ssid [4] = "{]02@U}"


char menu = 0x01;
char seta = 0x00;
boolean t_butUp, t_butDown, t_butSetar;

// --- Hardware do LCD ---
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

// *** Configurações Iniciais ***

void setup() {
  lcd.begin(16, 2);

  for (char i = 9; i < 13; i++) pinMode(i, INPUT_PULLUP);

  t_butUp   = 0x00;
  t_butDown = 0x00;

}

// ** Loop Infinito ***
void loop() {


  changeMenu();
  dispMenu();

 

}

void espset {

  while (true){
 
  if (ESP.available()){
  Serial.write(ESP.read());
  }
 
  if (Serial.available()){
  ESP.write(Serial.read());
  }
}

// *** Desenvolvimento das Funções Auxiliares ***

void changeMenu()
{

  if (!digitalRead(butUp))   t_butUp   = 0x01;        //Botão up pressionado seta flag
  if (!digitalRead(butDown)) t_butDown = 0x01;        //Botão down pressionado seta flag

  if (digitalRead(butUp) && t_butUp)                  //Botão up solto e flag setada
  {
    t_butUp = 0x00;                                   //Limpa flag

    lcd.clear();                                      //Limpa display
    menu++;                                           //Incrementa menu

    if (menu > 0x05) menu = 0x01;                     //Se menu maior que 3, volta a ser 1

  }

  if (digitalRead(butDown) && t_butDown)              //Botão Down solto e flag setada
  { //Sim...
    t_butDown = 0x00;                                //Limpa flag

    lcd.clear();                                     //Limpa display
    menu--;                                          //Decrementa menu

    if (menu < 0x01) menu = 0x05;                    //Se menu menor que 1, volta a ser 3 (PODE ADD MAIS PAGINAS)


    changeMenu();
    dispMenu();

  }

}

void dispMenu() //Mostra o menu atual
{

  switch (menu)
  {
    case 0x01:
      SalvLiCent();
      break;

    case 0x02:
      CletCent();
      break;

    case 0x03:
      VillCamIICent();
      break;

    case 0x04:
      BenBentCentJaci();
      break;

    case 0x05:
      EusGCent();
      break;

  }

  SSAID = ssid [id];
  pinMode(RST, OUTPUT);
  digitalWrite(RST, LOW);
  delay(300);
  digitalWrite(RST, HIGH);
 
  }

}

void SalvLiCent()  //Linha Ponta verdade (menu1)
{
  id = 0;
  lcd.setCursor(0, 1);
  lcd.print("SALVADOR LIRA/CENTRO");
  lcd.scrollDisplayLeft();
  delay(150);

}

void  CletCent()  //Linhda Cruz das almas (menu2)
{
  id = 1;
  lcd.setCursor(0, 1);
  lcd.print("CLETO MARQUES LUZ/CENTRO");
  lcd.scrollDisplayLeft();
  delay(150);

}


void VillCamIICent()   //Linhda Centro (menu3)
{
  id = 2;
  lcd.setCursor(0, 1);
  lcd.print("VILLAGE CAMPESTRE II / CENTRO");
  lcd.scrollDisplayLeft();
  delay(150);

}

void  BenBentCentJaci() {
  id = 3;
  lcd.setCursor(0, 1);
  lcd.print("B. BENTES/CENTRO/JACINTINHO");
  lcd.scrollDisplayLeft();
  delay(150);

}

void EusGCent() {
  id = 4;
  lcd.setCursor(0, 1);
  lcd.print("EUSTAQUIO GOMES/CENTRO");
  lcd.scrollDisplayLeft();
  delay(150);

}

void butSetar (){

  if (!digitalRead (butSetar)) t_butSetar = 0x01;

  if(digitalRead (butSetar) && t_butSetar){

    t_butSetar = 0x00

    seta ++;

    if (seta > 2) sete = 0x01;

    switch (seta){

      case 0x01:
      digitalWrite( SSAID [id], HIGH)
      break;
    }
  }
   
}
Title: Re: ESP8266
Post by: mohitz27 on May 03, 2017, 05:23 pm
Kindly follow the steps as given in the blog post..!
Hope it helps you..

http://hackshaders.blogspot.in/2017/05/how-to-blink-led-using-esp8266-arduino.html
Title: Re: ESP8266
Post by: LMI1 on May 30, 2017, 12:31 am
Do you know a 8266 based module for linking two controllers via a serial bus? Wireless serial cable.

I am testing two ESP-01 modules but linking is difficult with them. What I know a web server and suitable request are needed. Something simpler for raw data would be enough.
Title: Re: ESP8266
Post by: Abhijeet8919 on Jul 06, 2017, 01:17 pm
Hello Guyz, I am working on ESP01 wifi project with Arduino IDE 1.8.2. but whenever i tried to work on ESP8266.h it gives me error like

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Ive already install ESP8266 Generic Board.

Please give me advice. Thank you.
Title: Re: ESP8266
Post by: alisystem on Aug 14, 2017, 09:41 am
there are some codes available on "github.com/esp8266/Arduino/" . I made the code work by modifying it a little but the main problem is that it Exchange data only once ,the server closes the connection when a one data exchanged .i want a continues TCP socket connection (send/receive )

this is my code :

#include <ESP8266WiFi.h>

   const char *ssid = "ESPaliAP";
   const char *password = "12345678hamed";

   WiFiServer server(21);


   char incomingPacket[255];
   char  replyPacekt[] = "Hi there! Got the message :-)";



// the setup function runs once when you press reset or power the board
void setup() {
   pinMode(2, OUTPUT);
     digitalWrite(2, 1);
        delay(1000);
    Serial.begin(115200);
    Serial.println();
    Serial.print("Configuring access point...");
  WiFi.disconnect();
  delay(100);
 WiFi.mode(WIFI_STA);
    // You can remove the password parameter if you want the AP to be open.
    WiFi.softAP(ssid, password);

    IPAddress myIP = WiFi.softAPIP();
    Serial.print("AP IP address: ");
    Serial.println(myIP);

// Start the server
  server.begin();
  Serial.println("Server started");

  // Print the IP address
  Serial.println(WiFi.localIP());
}





void loop()

 {


   // Check if a client has connected
 WiFiClient client = server.available();
  if (!client) {
    return;
  }

  // Wait until the client sends some data
  Serial.println("new client");
  while(!client.available()){
    delay(1);
  }

  // Read the first line of the request
  String req = client.readStringUntil('\r');
  Serial.println(req);
 client.flush();

  // Match the request
  int val;
  if (req.indexOf("/gpio/0") != -1)
    val = 1;
  else if (req.indexOf("/gpio/1") != -1)
    val = 0;
  else {
    Serial.println("invalid request");
    client.stop();
    return;
  }

  // Set GPIO2 according to the request
  digitalWrite(2, val);

  client.flush();

  // Prepare the response
  String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>\r\nGPIO is now ";
  s += (val)?"high":"low";
  s += "</html>\n";

  // Send the response to the client
  client.print(s);
  delay(1);
  Serial.println("Client disonnected");

  // The client will actually be disconnected
// when the function returns and 'client' object is detroyed



}
Title: Re: ESP8266
Post by: Akorede on Dec 19, 2017, 01:26 pm
Hi guys
I'm currently working on a project that involves sending and receiving text via wifi. I'm using esp8266 01 for this. I've done my basic settings, everything seems cool with AT commands. I even used it as a webserver. But the problem lies in getting http get response. Whenever I receive anything with space and some characters, mt response will have + sign and some %c ....characters. I know they are the ascii equivalent of the sent characters. PLease guys, how may I remove those unwanted characters? I tried to use esp8266Wifi library, but installing it has never been successful, getting all sort of errors (like functional.h, queue.h, etc). Please guy assist me. Thanks
Title: Re: ESP8266
Post by: mistergreen on Feb 09, 2018, 03:01 am
http response is usually url encoded. You need to url decode. Use this
https://github.com/zenmanenergy/ESP8266-Arduino-Examples/blob/master/helloWorld_urlencoded/urlencode.ino
 (https://github.com/zenmanenergy/ESP8266-Arduino-Examples/blob/master/helloWorld_urlencoded/urlencode.ino)
Title: Re: ESP8266
Post by: JonMiles on Feb 09, 2018, 10:02 pm
Hi All,

I am having real problems access the AT commands.

I have the following set up between a nano and the ESP-8266:

GND------->GND
VCC-------->+3.3v
CH_PD---->+3.3v
TX--------->RX
RX--------->tx

I am using the flowing code as a serial through:
Code: [Select]
#include <SoftwareSerial.h>
SoftwareSerial softSerial(2, 3); // RX, TX

void setup()
{
  uint32_t baud = 9600;
  Serial.begin(baud);
  softSerial.begin(baud);
  Serial.print("SETUP!! @");
  Serial.println(baud);
}

void loop()
{
    while(softSerial.available() > 0)
    {
      char a = softSerial.read();
      if(a == '\0')
        continue;
      if(a != '\r' && a != '\n' && (a < 32))
        continue;
      Serial.print(a);
    }
   
    while(Serial.available() > 0)
    {
      char a = Serial.read();
      Serial.write(a);
      softSerial.write(a);
    }
}


When i send AT the blue led flashes once very quickly on the ESP-8266 but i get no response back.

I have tried various baud rates but to no avail.

I have been searching for day on the web, but to no avail, anyone see what I am missing?

thanks in advance
Title: Re: ESP8266
Post by: ieee488 on Feb 09, 2018, 11:23 pm
Hi All,

I am having real problems access the AT commands.

I have the following set up between a nano and the ESP-8266:

GND------->GND
VCC-------->+3.3v
CH_PD---->+3.3v
TX--------->RX
RX--------->tx

I am using the flowing code as a serial through:
Code: [Select]
#include <SoftwareSerial.h>
SoftwareSerial softSerial(2, 3); // RX, TX

void setup()
{
  uint32_t baud = 9600;
  Serial.begin(baud);
  softSerial.begin(baud);
  Serial.print("SETUP!! @");
  Serial.println(baud);
}

void loop()
{
    while(softSerial.available() > 0)
    {
      char a = softSerial.read();
      if(a == '\0')
        continue;
      if(a != '\r' && a != '\n' && (a < 32))
        continue;
      Serial.print(a);
    }
   
    while(Serial.available() > 0)
    {
      char a = Serial.read();
      Serial.write(a);
      softSerial.write(a);
    }
}


When i send AT the blue led flashes once very quickly on the ESP-8266 but i get no response back.

I have tried various baud rates but to no avail.

I have been searching for day on the web, but to no avail, anyone see what I am missing?

thanks in advance
Start your own thread so that your problem will get the attention it needs.

You shouldn't hijack someone else's thread.



Title: Re: ESP8266
Post by: JonMiles on Feb 09, 2018, 11:27 pm
I thought this was a thread all about the esp8266. It even says that in the first post.......
Title: Re: ESP8266
Post by: ieee488 on Feb 10, 2018, 03:21 am
I thought this was a thread all about the esp8266. It even says that in the first post.......
You'll notice that the other topics have nothing to do with your problem.

If you want your post to be noticed, create your own thread.

If you don't care, then that is fine too.

Title: Re: ESP8266
Post by: rbright on Feb 10, 2018, 06:33 am
For AT Commands don't assume the logical approach of UNO TX to ESP RX... Try TX to TX and RX to RX.

Also understand contents of the following link: https://arduino.stackexchange.com/questions/18575/send-at-commands-to-esp8266-from-arduino-uno-via-a-softwareserial-port

Enjoy... 
Title: Re: ESP8266
Post by: JonMiles on Feb 10, 2018, 08:03 am
I have tried both TX to TX and TX to RX.

With TX to TX there is no blue led flash on the ESP8266.  Also i am using softwareserial so not using the same tx and rx pins as the usb connection
Title: Re: ESP8266
Post by: zoomx on Feb 10, 2018, 08:54 am
Try 115200 baud instead of 9600.
Title: Re: ESP8266
Post by: JonMiles on Feb 10, 2018, 09:12 am
Have tried that too. I have tried each of the baud rates at least once on the off chance.
Title: Re: ESP8266
Post by: westfw on Feb 10, 2018, 11:22 am
Quote
I have the following set up between a nano and the ESP-8266:

VCC-------->+3.3v
If that's ESP8266 VCC to Nano 3.3V, be aware that the nano 3.3V regulator is not powerful enough to power an ESP8266.

If that's Nano VCC (5V!) to ESP8266 3.3V, that's just wrong and has probably fried your ESP.

Title: Re: ESP8266
Post by: JonMiles on Feb 10, 2018, 01:16 pm
If that's ESP8266 VCC to Nano 3.3V, be aware that the nano 3.3V regulator is not powerful enough to power an ESP8266.

If that's Nano VCC (5V!) to ESP8266 3.3V, that's just wrong and has probably fried your ESP.


No, i had heard of those issues before. It id 3.3v external power. Not power from the nano. I have double checked and it is supplying 3.3v. We 3.28v but close enough.
Title: Re: ESP8266
Post by: boelle on Mar 27, 2018, 11:06 pm
Hi

can anyone help me with a "small" project?

i want to create an thermostat for an electrical heating control.

i found almost what i wanted in this code here: https://github.com/mharizanov/ESP8266_Relay_Board

the only thing missing is a push button that allows to override the normal target temp to something else for a set period of time


its intended for a flat where an autism person lives along with the care taking staff


the last group (staff) has a very bad habbit of messing with the panels and it tages ages to set the dials etc as the other flats give of heat too

my plan was using the firmware above and then if the staff should feel cold they can push a button to get extra heat for say 15 mins
Title: Re: ESP8266
Post by: jerryk1234 on Jul 15, 2018, 09:09 pm
Hello,

   I'm working on a little IOT project, nothing complicated.  I settled on the arduino system for my nodemcu cards because it was just more stable than trying to program them with Lua.  I am minimally familiar with C++, but have some years of professional-level embedded programming experience in C.

  Does anybody know how to get access to the sub-os world of the processor?  I'm specifically talking about processor registers and physical memory.  Even more specifically, at the moment, the stack pointer.

  I'd like to apply a few simple tests to the stack pointer to help with reliability.  I understand that the esp has
a small 4K stack.  C, in general, is a stack-intensive language.  4K seems like enough for a little IOT project, but...

  At the top of the main loop, the stack pointer should always be the same value.  If it changes, it means that
  somewhere, a push was not matched by a pop, or a call not matched by a return.

  I'd like to set some words near the end of the stack to a magic number.  If that number changes, we're close to blowing the stack.

  The ideal thing would be a way to embed snippets of assembly language....



Title: Re: ESP8266
Post by: westfw on Jul 16, 2018, 12:16 am
(This probably deserves to be a new topic.)


Quote
The ideal thing would be a way to embed snippets of assembly language....
esp8266 uses gcc, so it has the same sort of inline assembly language capabilities as all the other gcc variants.
The core CPU is a  Tensilica Xtensa lx106 MCU, which you can find documentation for.

Note that the ESP8266 is a multi-tasking system, with the arduino-like loop() being one of the tasks.  I would not be surprised if there were multiple stacks...
Title: Re: ESP8266
Post by: Ben_Tan on Jan 16, 2019, 02:58 am
Hi:

I am trying to receive from a device that uses 802.11b protocol but not transmitting in standard WiFi channels/frequencies. Any idea if we could manipulate esp8266 or any standard WiFi cardto do so?

Ben
Title: Re: ESP8266
Post by: zoomx on Jan 16, 2019, 09:39 am
I just read this some days ago
https://hackaday.com/2019/01/04/underclocking-the-esp8266-leads-to-wifi-weirdness/ (https://hackaday.com/2019/01/04/underclocking-the-esp8266-leads-to-wifi-weirdness/)
Title: ESP8266 (Lolin ESP12), FastLED and onboard led
Post by: SergeS on Feb 26, 2019, 06:05 am
I have some project with WS2811 led strip, running with FastLED library. Strip is controlling by D8 pin (ESP8266 ESP-12 Lolin). Everything is working fine, but since i have added analogWrite(...) to control brightness of on-board led (pin D4) - all effects are corrupted. What could be the problem? PWM on D4 is somehow related to bit-banging on D8? Common interrupts/timers? How to solve?