Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By jtheires@netins.net
#28569 Figured out what the form needs to look like after playing with it for awhile. For those interested, my example.h code showing the added HTML form and its processing is at pastebin.com: http://pastebin.com/FGKfqKwe with highlighted sections.
In short, I added a form tag with a button inside, formmethod=post, formaction=example.html (back to same page), the name of my button (to be processed later), and a value of 90 (sent to servo later). Then, near the bottom, inside processExample, I have the code to retrieve the form value and send it to the servo.
Mostly this works, but now I have a few other mysteries to solve, such as the servo moving every 3 minutes and 10 seconds by itself, without any button pushes on my part. This seems to be related to a message on the serial monitor which reads:
"Admin Mode disabled!

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

wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
Starting ES8266
Reading Configuration
Configuration Found!
Configuring Wifi
HTTP server started"

Does anyone know what this means, or why this is happening? It kinda looks like a server restart...
User avatar
By jtheires@netins.net
#28940 I have loaded this cool code into my esp8266-01 module and in general I love it.
However, I'm getting some strange behavior that I need help with.
I have setup a custom example.h file that contains one html button/form that sends a PWM signal to a servo connected to GPIO2. I'm using the Arduino Servo.h library to control the servo. I am using only the AP mode to connect with my iPhone Safari browser to the wifi signal and control the servo. So far, so good - the button kicks the servo just as expected (90 degrees clockwise, wait 1.5 seconds, then back to 0 degrees). Then, without any other behavior on my part about 3 minutes and 10 seconds later, the servo jumps on its own (not the kind of jump like the button behavior - it turns counterclockwise about 30-45 degrees, wait 0.5 seconds, then back to 0 degrees). This behavior continues every 3 min 10 sec thereafter. This mysterious servo movement seems to coincide with the serial monitor message "Admin Mode disabled!" - perhaps this a clue?
I've looked through the code and don't see any periodic task that could be responsible. I've set the NTP settings to 0 (disable) using the admin mode. I commented out the line “server.on ( "/", processExample );” from main page ESP_WebConfig_Master in the hopes that someone was calling my example.h page periodically, but this did nothing different. Perhaps there is some noise being introduced on the GPIO2 wire, or an error in the Servo library?
Thanks in advance for your help.
I'm happy to share my code if anyone wants to see it.
User avatar
By hakha4
#29055 I've read this topic and the sketch looks awesome.Started with a NodeMcu 12 ver 0.9 board and I can compile/upload sketch without errors. When opening 192.168.4.1/admin.html I get timeout everytime (Chrome) and in debug window it seems to get stucked after 'HTTP server started' is printout. Anyone have an idea what might be the problem ? I've made no changes in the original code besides changing to match my network in :

#define ACCESS_POINT_NAME "MyAP"
#define ACCESS_POINT_PASSWORD "Mypwd"
ser_output.jpg
You do not have the required permissions to view the files attached to this post.