ESP8266

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

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

i looked at the example here:

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

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.

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 - esp8266/Arduino: ESP8266 core for 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

Paulware:
I added a UDP example: GitHub - Paulware/ESP8266: All things related to ESP8266 low cost device. 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.

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.

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?

How are you powering the ESP8266?

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.

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

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 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

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

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 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 / GitHub - israellot/esp-ginx: HTTP server for the ESP8266) than a 328 with 2K of ram. A 328 could be used to add lots of IO to the ESP.

Cheers Pyro - is the ESP8266 run on an AVRthen ?

@mcnobby

Use this

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

it works the same as Arduino_STM32 ie its just hardware files

@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

:slight_smile:

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?

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

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

@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.

pYro_65:
@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.