Current Lua downloadable firmware will be posted here

User avatar
By alonewolfx2
#2743
ystrem wrote:It will be possible to sleep device the FW ? :] I want to make my home automation on Atmega328+nRf24, but the network library is still buggy. And then came ESP8266 :D

Is nrf24 and arduino buggy ? You are wrong place: ) esp sdk is very bulgu more than arduino +nrf now : )
I am using atmega328 + 433mhz rf +nrf24 and enc24j80. Its more stable more than esp. Esp platform growing every day but now Its is a child. Maybe we can use without bug one day
User avatar
By gerardwr
#2750
cendev wrote:I've added the scripts as attachment :) hope they'll help =)


I had a look at your scripts and converted them for (my) use of the serial console.

I saw in your video that you display the content of a file by 2 commands:
filename="filename.lua"
dofile("fileread.lua")

I tried using a function for a 1-liner that allows the filename as a parameter. This work, I like it!

I created the file functions.lua and uploaded it to the ESP
Code: Select all printfile = function (name)
 file.open(name)
  repeat
    line=file.readline()
    print(line)
  until not line
end


On the ESP I execute the file functions.lua once. After that I can use the command printfile("filename.lua") to display the contents of the file.
Code: Select all> dofile("functions.lua")
> printfile("functions.lua")
printfile = function (name)
  file.open(name)
  repeat
    line=file.readline()
    print(line)
  until not line
end
nil
>


Please note:
- I do not have to use seek to determine the end of file
- the last printed line = NIL, probably because the last line in the file is blank
- in this way you can extend the supported Lua commands as if they were built-in commands

Using this way of working I intend to:
- code all default functions I need in functions.lua. After dofile all functions are available by just typing the name of the function and the required variables.
- When all testing is done, and I am satisfied with the functions I upload the file functions.lua to init.lua to execute the file at boot time.
- for every additional lua file I code, the functions defined are available for use. As a kind of library.

Neat, huh!
User avatar
By ystrem
#2756
alonewolfx2 wrote:
ystrem wrote:It will be possible to sleep device the FW ? :] I want to make my home automation on Atmega328+nRf24, but the network library is still buggy. And then came ESP8266 :D

Is nrf24 and arduino buggy ? You are wrong place: ) esp sdk is very bulgu more than arduino +nrf now : )
I am using atmega328 + 433mhz rf +nrf24 and enc24j80. Its more stable more than esp. Esp platform growing every day but now Its is a child. Maybe we can use without bug one day


I can't get work nrf24 network library, I want to sleep node parent node and if message arrive then send it to base, but the node sleeps :D. Because the limitation of 6 pipes in nrf24. I know about the deep sleep function, it's not problem for me. I want the radion turn off, then I can wake it by other MCU. But there is no AT command for sleep. I tried to compile IoT example, but after 2 days I get worked only ct-ng compiler.