-->
Page 1 of 1

Just a few simple questions? Please help!?

PostPosted: Wed Mar 25, 2015 9:53 pm
by GeoReb
Hello,

Just a few quick easy questions (I hope!) and I would really appreciate your help...

I have an ESP8266 hooked up to a third party microprocessor (not Arduino) which is driving the AT commands and collecting data from the internet via my home WiFi access point.

1 - Can I send data TO the ESP8266 over WiFi? For example, I want to set 'AT+CWMODE=2' and then connect to its softAP with my laptop. Is there any way to send a string to the module that could then be relayed to the microprocessor through the Rx/Tx pins for example??

2 - If I were to flash the unit with the Lua Firmware in order to make it a server, does it loose its other capabilities in terms of connecting to an access point and collecting information from the internet??

3 - I have seen a video of a someone controlling an LED from the ESP's onboard web server (they were using Lua of course). I understand that I can control the digital state of the GPIO pins (3.3v ON or OFF), but can I send serial data on these pins using Lua code, for example "Hello World"?

Thanks in advance for your help,
George

Re: Just a few simple questions? Please help!?

PostPosted: Fri Apr 03, 2015 6:47 pm
by OssO
I am also noob with this chip, but getting experience slowly ...
So lets try to help you :

1) generally yes, but it is not possible with AT commands/firmware. You can use Lua firmware (nodemcu) and try the telnet script. But it is dangerous, since if this (wifi) will be the only communication channel, you can get stuck with bad configuration applied

2) using lua (nodemcu) you can do more than with AT firmware

3) sending serial data on regular pin ( emulate uart) will need good timing, so it will not be so easy, but it is not impossible, especialy with lower baudrates. Better (easier) would be use (or emulate by software) some bus with clock, like SPI, I2C or so.

Re: Just a few simple questions? Please help!?

PostPosted: Sat Apr 04, 2015 6:36 am
by picstart
At a moment in time the AT commands were all that you could use. AT has been around since the old telephone modems ...it may well be older than the median age of today's coders. Frankly it is inelegant as an interface to external MCU's. AT is fine for terminal programs running on a PC and talking to the esp8266. For a MCU interface it burdens the MCU with a parsing routine. AT commands are numerous and aren't of fixed length and AT responses are asynchronous so require buffering in the MCU and then extensive parsing. Most MCU's are deployed on synchronous busses like I2C and SPI. NodeMCU lua is fine since the interface can be defined by you and not constrained by AT definitions.
It may pay to go to eclipse and use the esp8266 SDK API's directly.....a very promising alternative is the esp8266 Arduino IDE....it is a very nice idea for those familiar with the AVR arduino IDE. You write a arduino sketch and the sketch is compiled for the esp8266 and uploaded. Code and libraries that work on an AVR can be converted and will run on the esp8266. I suspect this will be the choice approach for the future of the esp8266 since it leverages so much.It is very early in the esp8266 arduino IDE development yet much is working already. The upload is flakey on a first attempt but a second attempt immediately after the first failure usually works. The upload tool is the culprit not the IDE