Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By patjazz
#23927 Hi proteus74

Your code is very interesting ! with nice features….
But i have also some problems :

ESP12, 2A powered, Arduino 1.6.5 then now 1.6.6 « hourly », ESP8266 1.6.5-804-g2d340c7…. your 1.1.3 version

Serial console output :
<<
Starting ES8266
Reading Configuration
Configurarion Found!
Configuring Wifi
HTTP server started
SwitchON
style.css

Exception (3):
epc1=0x4000bf64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x402397db depc=0x00000000

ctx: cont
sp: 3ffeb410 end: 3ffeb6c0 offset: 01a0

>>>stack>>>
3ffeb5b0: 3ffe9247 3ffe9b18 3ffeb720 4020ac52
3ffeb5c0: 402397db 00000000 3ffeb720 4020a2e4
3ffeb5d0: 401001e8 3fff6200 3ffe9b18 40202e76
3ffeb5e0: 00000000 00000000 00000000 4020b395
3ffeb5f0: 3fff58d0 00000000 00000000 402077be
3ffeb600: 00000000 00000000 3ffe9b18 40207625
3ffeb610: 0000000a 3fff5870 00000003 00000003
3ffeb620: 3fff6a30 00000017 00000017 3ffea5f8
3ffeb630: 3ffe8000 00000000 402017fe 3ffea6a0
3ffeb640: 402010ae 00000001 3ffe9b18 3ffeb6ec
3ffeb650: 3ffe8000 000003e8 3ffe9b18 40207715
3ffeb660: 3ffe93c8 00000000 000003e8 000152d6
3ffeb670: 3ffe9b30 3fff69f8 3ffeb720 40201894
3ffeb680: 00000000 3ffe9b08 3ffe9a88 40204a03
3ffeb690: 4020181d 00000000 00000000 3ffeb6ec
3ffeb6a0: 3fffdc20 00000000 3ffeb6e4 4020187a
3ffeb6b0: 00000000 00000000 3ffea6a0 40100450
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(1,7)


ets Jan 8 2013,rst cause:4, boot mode:(1,7)

wdt reset
>>


Compil time :
<<
Le croquis utilise 279 792 octets (26%) de l'espace de stockage de programmes. Le maximum est de 1 044 464 octets.
Les variables globales utilisent 51 584 octets (62%) de mémoire dynamique, ce qui laisse 30 336 octets pour les variables locales. Le maximum est de 81 920 octets.
Uploading 283936 bytes from /var/folders/_t/0wgp18117bn6f859p_v6l46w0000gn/T/build5485180342922764677.tmp/ESP_WebConfig_Master.cpp.bin to flash at 0x00000000
......................................................................................................................................................................................................................................................................................
>>

When i suppress ALL « PROGMEM », things goes a little better (page ‘config network’ still crash)
Sometime, ESP respond quickly, sometime it seems to be ‘over killed’ ????
I try with Safari, Firefox....

I should be very happy to have this thing operational !!!

Thanks….
User avatar
By ridge
#23938
proteus74 wrote:Please keep in mind that you have to select the right memory amount of your chip when compiling and programming the chip.

These settings are working fine for me:

ESP-01 1M (512K SPIFF)
ESP-12 4M (3M SPIFF)

I also use Visual Micro as IDE because I like the code completion and the serial monitor.



In the Arduino IDE (which I am very grateful to the developers for) there are the following boards available: Generic, Olimex and NodeMCU. I have the NodeMCU selected for the ESP-12.

As a result of many tests of using and removing the PROGMEM keyword, I believe PROGMEM, when used more than once in a program will overwrite or erase the contents of a previously 'saved' PROGMEM constant char string.

At least this occurs on my particular hardware model. Two different devices of the same model were tested with the same results.

This always will result in a WDT program crash when a previously known good page is selected from the menu.

To make debugging even more entertaining, seemingly random page serve freezes occur when the FreeMem heap size drops much below 10000. System crashes are guaranteed for me if the heap size drops below 5000.

I am pleased to say, my ESP-12 water irrigation controller based on the WebConfig template is working well if the above requirements are met.
User avatar
By patjazz
#23955 Hi proteus74

Your code is very interesting ! with nice features….
But i have also some problems :

ESP12, 2A powered, Arduino 1.6.5 then now 1.6.6 « hourly », ESP8266 1.6.5-804-g2d340c7…. your 1.1.3 version

Serial console output :
<<
Starting ES8266
Reading Configuration
Configurarion Found!
Configuring Wifi
HTTP server started
SwitchON
style.css

Exception (3):
epc1=0x4000bf64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x402397db depc=0x00000000

ctx: cont
sp: 3ffeb410 end: 3ffeb6c0 offset: 01a0

>>>stack>>>
3ffeb5b0: 3ffe9247 3ffe9b18 3ffeb720 4020ac52
3ffeb5c0: 402397db 00000000 3ffeb720 4020a2e4
3ffeb5d0: 401001e8 3fff6200 3ffe9b18 40202e76
3ffeb5e0: 00000000 00000000 00000000 4020b395
3ffeb5f0: 3fff58d0 00000000 00000000 402077be
3ffeb600: 00000000 00000000 3ffe9b18 40207625
3ffeb610: 0000000a 3fff5870 00000003 00000003
3ffeb620: 3fff6a30 00000017 00000017 3ffea5f8
3ffeb630: 3ffe8000 00000000 402017fe 3ffea6a0
3ffeb640: 402010ae 00000001 3ffe9b18 3ffeb6ec
3ffeb650: 3ffe8000 000003e8 3ffe9b18 40207715
3ffeb660: 3ffe93c8 00000000 000003e8 000152d6
3ffeb670: 3ffe9b30 3fff69f8 3ffeb720 40201894
3ffeb680: 00000000 3ffe9b08 3ffe9a88 40204a03
3ffeb690: 4020181d 00000000 00000000 3ffeb6ec
3ffeb6a0: 3fffdc20 00000000 3ffeb6e4 4020187a
3ffeb6b0: 00000000 00000000 3ffea6a0 40100450
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(1,7)


ets Jan 8 2013,rst cause:4, boot mode:(1,7)

wdt reset

>>


Compil time :
<<
Le croquis utilise 279 792 octets (26%) de l'espace de stockage de programmes. Le maximum est de 1 044 464 octets.
Les variables globales utilisent 51 584 octets (62%) de mémoire dynamique, ce qui laisse 30 336 octets pour les variables locales. Le maximum est de 81 920 octets.
Uploading 283936 bytes from /var/folders/_t/0wgp18117bn6f859p_v6l46w0000gn/T/build5485180342922764677.tmp/ESP_WebConfig_Master.cpp.bin to flash at 0x00000000
......................................................................................................................................................................................................................................................................................
>>

When i suppress ALL « PROGMEM », things goes a little better (page ‘config network’ still crash)
Sometime, ESP respond quickly, sometime it seems to be ‘over killed’ ????

I should be very happy to have this thing operational !!!

Thanks….
User avatar
By ridge
#23963 The attached program is based on WebConfig without the web config. It uses a hardcoded static IP address.
This is a first pass effort at an irrigation timer. It is no where near production ready. There are no integer type checking or range checking of user entered values for instance. There is no error trapping or other production software basics.

To use this create a folder called Irrigation_1 inside your MySketches directory.
Download and unzip the attached files into the Irrigation_1 directory.
Open Irrigation_1.ino and add your router ssid, password and a valid static IP address for your network setup.

Tested only on an ESP-12.
You do not have the required permissions to view the files attached to this post.