A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By quackmore
#89649 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)
User avatar
By maxniz
#89653 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 ????
You do not have the required permissions to view the files attached to this post.
User avatar
By quackmore
#89656 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
User avatar
By maxniz
#89660 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
You do not have the required permissions to view the files attached to this post.