Go Down

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

impeham

#60
Mar 28, 2015, 10:44 am Last Edit: Mar 28, 2015, 11:21 am by impeham
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

pYro_65

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.
Forum Mod anyone?
https://arduino.land/Moduino/

rogerClark

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
Freelance developer and IT consultant
www.rogerclark.net

veseo

I added a UDP example: https://github.com/Paulware/ESP8266.  It is written for the mega since the ESP8166 needs commands over a fast serial port.

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

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

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


   Also, in this directory is an Android project written in .java/Eclipse which demonstrates basic connectivity. You can use this project as a skeleton to create your own Android App.
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.
Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

pYro_65

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.
Forum Mod anyone?
https://arduino.land/Moduino/

impeham

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?

CrossRoads

How are you powering the ESP8266?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

impeham

#67
Apr 14, 2015, 02:38 am Last Edit: Apr 14, 2015, 02:40 am by impeham
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.

rogerClark

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

Freelance developer and IT consultant
www.rogerclark.net

mcnobby

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
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

pYro_65

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 / 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.
Forum Mod anyone?
https://arduino.land/Moduino/

mcnobby

Cheers Pyro - is the ESP8266 run on an AVRthen ?
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

rogerClark

@mcnobby

Use this

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

it works the same as Arduino_STM32 ie its just hardware files

Freelance developer and IT consultant
www.rogerclark.net

mcnobby

#73
May 02, 2015, 11:52 am Last Edit: May 02, 2015, 11:52 am by mcnobby
@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

:)
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

lightaiyee


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?

Go Up