-->
Page 8 of 9

Re: remote control with only esp8266

PostPosted: Mon Nov 30, 2020 5:00 pm
by quackmore
there must be something wrong in init.lua

somewhere you can read

Code: Select all...attempt to call field 'alarm'. (a nil value ...


followed by some stack trace
that could be the reason of all the garbage on the serial interface

remove that file and try this, it's a trivial led blink every 5 secs

Code: Select all-- init.lua
led_on = false
gpio.mode(4, gpio.OUTPUT)
gpio.write(4, gpio.HIGH)

periodic_task = function()
    if (led_on) then
        -- turn off the led
        print("led off")
        gpio.write(4, gpio.HIGH)
        led_on = false
    else
        -- turn on the led
        print("led on")
        gpio.write(4, gpio.LOW)
        led_on = true
    end
    tmr.create():alarm(5000, tmr.ALARM_SINGLE, periodic_task)
end

print("now running the application")
tmr.create():alarm(5000, tmr.ALARM_SINGLE, periodic_task)

Re: remote control with only esp8266

PostPosted: Tue Dec 01, 2020 8:13 am
by maxniz
sorry for the wait but I had some work problems...

i have tried the file but i got what you can see in attach.. i have also tried to modify the character from 8N1 to 7E1 in each speed ..... nothing !!
I've done so many tests that I don't know what I've done anymore....
now i'll start again ...

erase flash with flash_download_tool
load default files
load your files
with lua loader i'll put in your blink init, a call to version.lua

can i try ????

Re: remote control with only esp8266

PostPosted: Tue Dec 01, 2020 8:51 am
by quackmore
ya, better restart from scratch...

Code: Select allerase flash with flash_download_tool

fine

Code: Select allload default files

which default files?
fine if you mean the binaries 0x00000.bin 0x10000.bin
that's all you need

Code: Select allload your files
with lua loader i'll put in your blink init, a call to version.lua

please don't

rename version.lua into init.lua
upload it and check that nodemcu 3.0.0 is running

then

create a new init.lua with just my blink example
and upload it
check what happens

Re: remote control with only esp8266

PostPosted: Tue Dec 01, 2020 10:07 am
by maxniz
which default files
fine if you mean the binaries 0x00000.bin 0x10000.bin ??

the default files in flash_download_tool_3.8.5 ..you have asked me before
"that's all you need"flashing esp_init_data_default.bin and blank.bin should fix it"

but now.... :D
the led is blinking !!!!!!!!!!!!!!!!!
you are a GREAT !!!!!
i'll try to upload AP and client