- Tue Dec 01, 2020 12:30 pm
#89665
"latest nodemcu is shipping with SDK 3.0.1 so I think you don't really need to flash esp_init_data_default.bin and blank.bin, those were for fixing issues with the old nodemcu version (with an old SDK)
from nodemc docs"
you are right... i have tried without and blink is ok..
i have loaded the scripts and i have some errors...
they are for the
client what you can find in the attach... and the file is :
please tell me where i wrong ..
-- application.lua
button_pressed = false
last_communicated_button_status = false
cmd_led_on = "http://192.168.10.1/led/turn/on"
periodic_task = function()
-- custom application ...
-- YOUR CODE HERE
tmr.alarm(0, duration, 1, function ()
if status == gpio.LOW then
status = button_pressed = true
else
status = button_status = false
-- example begin
if connected_to_AP and (button_pressed ~= last_commnicated_button_status) then
if button_pressed then
button_pressed = false
print("sending command for turning led off")
cmd = "http://192.168.10.1/led/turn/off"
else
button_pressed = true
print("sending command for turning led on")
cmd = "http://192.168.10.1/led/turn/on"
end
http.post(cmd, nil, nil, function(code, data)
if (code < 0) then
print("HTTP error, cannot communicate with AP")
last_communicated_button_status = not(button_pressed)
else
print(code, data)
last_communicated_button_status = button_pressed
end
end)
end
-- example end
print("connected to AP " .. tostring(connected_to_AP))
tmr.create():alarm(10000, tmr.ALARM_SINGLE, periodic_task)
end
print("now running the application")
print("connected to AP " .. tostring(connected_to_AP))
tmr.create():alarm(10000, tmr.ALARM_SINGLE, periodic_task)
i have also some errors for AP ... i don't touch anything !! i'm not able to...
You do not have the required permissions to view the files attached to this post.