ESP8266, Wifi enabled board

Hi all,
I started to use the ESP8266 in combination with an Arduino UNO and found out that this Wifi enabled chip as quite powerful. So I developed "Blink" running on native ESP8266. Blink without using an UNO, only the ESP8266 microprocessor. My next challenge was to use Arduino IDE as the development environment. Here is my journey until so far. Have a look at www.arduinesp.com. If you like it, improve it. Let's create an Arduino board, wifi enabled just for 3US$.

Lots of neat stuff appearing for the ESP8266:like this, too.

And, the recent Hackaday post.

I have not started playing with my 3 yet, but soon.

Ray

This is fantastic

Until now I have only used LUA, simply because it was too
difficult to build the toolchain.

Your Arduino implementation worked right out of the box.

Thank you for sharing your great work.

Erni:
This is fantastic

Until now I have only used LUA, simply because it was too
difficult to build the toolchain.

The toolchain is actually pretty trivial to build (at least it was on 0.95, 1.0 was released this week but haven't tried it), just takes a very long time on slower hardware (10+ hours on a Pi B+).

I updated to espressif SDK1.00 thanks for the tip.
BTW no building required for windows. Just running setup.exe.

@jeebmster

Wow. Can't wait to give it a try. I have been using the Linux vm tool chain for a while, but its always been a pain to use.

So I'd it also includes the latest ESP SDK , double wow.

My life will suddenly have got a lot easier when I need to make some IoT devices .

Edit.

I'm a bit curious, what gets uploaded, actual binaries like the Linux tool chain creates, or something else.

Eg can the web server be ported to arduino, ie as it uses the espressif SDK,?

Then uploaded. But if so, I presume I'd need to manually upload the web page data to the correct address in flash memory ??

@jbeemster

Umm

Not had any luck, but I suspect its because I've already got something else installed - but still it doesn't make a lot of sense

I've followed your instructions and I uploaded the "bootloader" - However all you seem to be doing is writing blank.bin to 2 sections of Flash, so its not really a bootloader as such.

So I get this output

C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esptool.exe -v -cp COM1 -cb 115200 -cd none -ca 0x00000 -cf C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/boot_v1.2.bin -ca 0x01000 -cf C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/at/user1.512.new.bin -ca 0x3e000 -cf C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/blank.bin -ca 0x7e000 -cf C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/blank.bin 
esptool v0.4.1-3-g9ab93f4 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
opening bootloader
resetting board
trying to connect
trying to connect
Uploading 1936 bytes from C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/boot_v1.2.bin to flash at 0x00000000
..
Uploading 239904 bytes from C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/at/user1.512.new.bin to flash at 0x00001000
...
Uploading 4096 bytes from C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/blank.bin to flash at 0x0003E000
....
Uploading 4096 bytes from C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/bin/blank.bin to flash at 0x0007E000
...C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esptool.exe -v 
esptool v0.4.1-3-g9ab93f4 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
.
starting app without reboot
closing bootloader

Which appears to imply that blank.bin was uploaded

However I'm not entirely sure it has really succeded, because after I reboot, my ESP8266 web server is working just as it did before, so wherever its storing its settings, have not been overwritten by blank.bin, because its still connecting to my secured wifi router

I then tried uploading a really basic sketch, that just outputs to the serial port

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

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

Serial.print(c++);
delay(500);
}

and I get this output in verbose while its uploading etc

C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ -c -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -IC:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/include -IC:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esp_iot_sdk_v1.0.0/include/json -Idriver -Iuser -Idriver/include -Iuser/include -Iinclude -IC:\Program Files (x86)\Arduino\hardware\arduino\esp8266\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\esp8266\variants\standard C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp\SerialTest.cpp -o C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp\SerialTest.cpp.o 
etc
etc 
... Stuff edited as its too big to post -------------------

C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esptool.exe -eo C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp.elf -bo C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp_0x00000.bin -bs .text -bs .data -bs .rodata -bc -ec 
C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esptool.exe -eo C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp.elf -es .irom0.text C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp_0x40000.bin -ec 

Sketch uses 27,504 bytes (13%) of program storage space. Maximum is 200,000 bytes.
C:\Program Files (x86)\Arduino/hardware/arduino/esp8266/tools/esptool.exe -v -cp COM1 -cb 115200 -cd none -ca 0x00000 -cf C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp_0x00000.bin -ca 0x40000 -cf C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp_0x40000.bin 
esptool v0.4.1-3-g9ab93f4 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
opening bootloader
resetting board
trying to connect
trying to connect
Uploading 32032 bytes from C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp_0x00000.bin to flash at 0x00000000
................................
Uploading 153976 bytes from C:\Users\rclark\AppData\Local\Temp\build6144271137234591030.tmp/SerialTest.cpp_0x40000.bin to flash at 0x00040000
...
starting app without reboot
closing bootloader

Which tends to imply that it has uploaded to the board

But when I reset, I'm still getting my normal debug from the ESP8266 web server - so it doesnt look like this has been uploaded either :frowning:

normally I use the python tool to upload my esp8266 web server e.g.

esptool.py --port COM1 write_flash 0x00000 0x00000.bin 0x40000 0x40000.bin 0x12000 webpages.espfs

Though I must admit, I"m not sure why it always has to upload 3 bin files. I always presumed that the 0x0000 bin was the SDK and the 0x40000 was the actual program that used the SDK and the 0x12000 is the web page data (compressed in some strange format)

I guess I can try using the Python tool to upload the binaries that the IDE is creating, and see what happens

I'll keep you posted !

Update.

OK. I worked out whats wrong.

There seems to be a bug in the esptool.exe that reports that its uploading even if the upload fails.

In my case looking at what my python based uploader was doing, the upload was starting and then failing after a few percent of upload.

This seemed to be an issue with the 3.3V from my USB to Serial, not being enough to supply the board during the start of uploads, but was giving enough power to run it normally (when not uploading)

However when I switched to using 5V via a regulator, the python tool managed to upload and then so did the exe

So my simple Serial example is now working !!

Now. How to get it to do some real work ! i.e integration with the SDK ?

Guys

@victor_pv has pointed out to me that there is another version already available on GitHub

Looking at that code, its superior to the very basic version on arduinoesp.com

Ideally neither need to package up the whole IDE, the only need the source code and the SDK and the Xtensia tool chain.

But I'm hoping to address that when I get time...

Hi Roger,
Your right. It seems that we were working on the IDE at the same time.
It was an exiting week for ESP8266 in combination of Arduino
I am thinking of updating the core to the one from esp8266/Arduino.
They did a great job.

Jeroen.

@jbeemster

I'm just in the process of doing that and uploading to a new repo on github

It seems that github/esp8266/arduino has some compiler issues, so I've done a mashup of your compiler files and their code file

They also had an uploader issue, which I will need to fix

I'll repost when my repo is available

PS. they still use SDK 0.9 but you cant just drop in 1.0 as it doesnt compile :frowning:

I forgot to post this yesterday, but I built a version using arduino/esp8266 from GitHub and using your compiler files and it works fine now

See

Http://GitHub.com/rogerclarkmelbourne/arduino-esp8266

Read the readme, it explains how to unzip into your existing Arduino folder , after you have created the hardware folder

Also not the selection of Programmer seems to be needed, e.g. Esptool

Currently it uses their old SDK 0.9. I hope to update to 1.0 today buy there seem to be a lot of differences that their code has problems with :frowning:

Anyway, give it a try...

Just a quick update

The main project team have updated the source to use SDK 1.0, so I've also updated my repo.

Http://GitHub.com/rogerclarkmelbourne/arduino-esp8266

Read the ReadMe which explains how to install the zip into your Arduino sketches folder

I have updated also some things also. See you are working on it. I will have a look asap.

Ahh, this is great stuff, thank you guys for your efforts. The WiFiClient is working good.