Chat freely about anything...

User avatar
By amadeus84
#30491 I wanted for some time to be able to control the light switches in my house from a web interface and I discovered the wonderful esp8266 module. I recently bought 2 esp8266-01 from ebay and this is what I have been able to do so far:

I wired up the esp to a Raspberry Pi 2 following this excellent post:
http://www.extragsm.com/blog/2014/12/03 ... pberry-pi/

Then, using picocom I can talk to the esp module:

AT+GMR
AT version:0.25.0.0(Jun 5 2015 16:27:16)
SDK version:1.1.1
Ai-Thinker Technology Co. Ltd.
Jun 23 2015 23:23:50

OK

This version seems very recent and there is far less stuff on the web related to this particular firmware. Possibly more info about this chip:

AT+RST

OK
WIFI DISCONNECT

ets Jan 8 2013,rst cause:2, boot mode:(3,0)

load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0

2nd boot version : 1.4(b1)
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000

� �R��
i
�jj
�**�*))�H�ds�� �7�
Ai-Thinker Technology Co. Ltd.

ready
WIFI CONNECTED
WIFI GOT IP


My background is in math and computer science, no electrical engineering, so if someone could translate the important bits for me, I would appreciate it.

Next, using AT commands, I can connect the esp to my router and start the esp server. Also, from my pc I can connect to the esp AP (192.168.4.1) e.g. with telnet or a web browser and I can send data from the esp to my pc.

Now the questions.

First, the esp AP has no security by default. Can encryption be configured?

Second, is it possible to control the GPIO pins on the esp with the default firmware?

If I do have to flash the chip with custom firmware, how would I go about restoring the default 0.25.0.0, if need be?

Thanks!
User avatar
By vgamesx1
#30500 Before I say anything else I'll just let you know that I don't know very much about the stock firmware, so I could be wrong..

1. Yes, use AT+ CWSAP= "SSID", "password",5,3 see the wiki or here for details http://tech.scargill.net/esp8266-as-an-access-point/

2. I dunno... I'll just say probably.

3. Here you go, download the firmware here http://www.electrodragon.com/w/ESP8266_ ... d_firmware
then download the flasher here http://www.electrodragon.com/w/ESP8266_firmware_flasher or you can probably just flash it the same way you flashed the custom firmware, its not very diffucult.

I personally flashed NodeMCU immediately after getting my esp because it's just way easier to work with but that's just my preference.
User avatar
By amadeus84
#30514 Thanks for the reply!

About enabling encryption, I also discovered the AT+CWSAP command. I set the encryption to 4, which is WPA_WPA2_PSK. That's pretty good.

As per the link you posted (http://www.electrodragon.com/w/ESP8266_ ... d_firmware), the AI-Thinker firmware supports AT+CIOREAD and AT+CIOWRITE commands which read and write to the GPIO pins. I tried it and it works:

AT+CIOREAD=0
1:HIGH

OK
AT+CIOREAD=15
0:LOW

OK


So, if I understand this correctly, the firmware I have now is AI-Thinker, which is a different company than Espressif. Both provide their own AT firmware, probably similar, but perhaps with some differences. Is this correct?

What confuses me about flashing the firmware is that some versions (espressif) come with more than one .bin file that need to go to different addresses, whereas other versions (e.g. the AI-Thinker ones that electrodragon references) have a single bin file and I have no idea which address to write them to. If it matters, I'll be using esptool.py from my raspberry pi, as I have no windows machines, so I can't use any of the .exe flash tools floating around. Any help with this?

Thanks!
User avatar
By vgamesx1
#30517 Yeah if you want the official firmware release you'll have to find it on the AI-thinker.com fourms or google for it, but they both fuction basically the same as far as I'm aware.

I'm sort of a beginner myself, I don't know all that much about the flashers or the file locations other than the default settings should work fine in most cases (so flash 0x00000).

Well if you have absolutely no windows machines you can borrow I'd recommend setting up and trying it on a windows virtual machine if you can, because there are quite a few more options for example the NodeMCU flasher is pretty good and very straightforward, just grab your bin, select it, then under advanced set the baud rate at 9600 and I don't know if you need to do it but I'd probably still change the flash size to whatever size your esp is and after all that is set, pick your COM port and you're ready to flash.
If you however would still like to use esptool.py then I can't really help you, so I'll simply recommend you read the usage and examples to figure out how it works or find a good tutorial on how to use it and don't worry too much about bricking the esp, shouldn't be an issue unless you override the bootloader.

Note: I did make a minor mistake when trying to flash mine, so this may help you.. Do you know how you must pull GPIO0 low (to gnd) in order to set it into flash mode? well I didn't realize when I first flashed mine that you had to start the flashing process then power the esp on... basically I was doing it in reverse order which lead to me frustratingly spending an hour or so trying to figure out why it wasn't working Lol.