AVR reboot

Hi,

Is it possible to reboot the microcontroller via a lua script without reboot the HAH?

 

Thanks,

 

Garry

 

Member for

16 years 10 months

brett

15 years 4 months ago

I suspect you want to do this because the URF isn't stable... well I've been working with Karl on fixing this and we are almost there - things are on hold whilst I'm moving.  Karl can tell you about our progress...

Technically might possible caveat I've not tried the script below

echo "reboot" >/dev/console
sleep 1
echo "+++" >/dev/console

The sleep and the +++ echo are IMPORTANT due to the way in which the AVR firmware works.

Member for

15 years 7 months

garrydwilms

15 years 4 months ago

Thanks for the update Brett, good to hear your getting some help with the project.

I will give the code you suggest a go, was thinking I would try to get around the RF issue with a microcom reboot whilst leaving plugboard running.

Grateful for your time, as always. Cheers,

Garry.

Member for

15 years 7 months

garrydwilms

15 years 4 months ago

Brett,

 

Code works great, just needed a slight tweak to stop LUA bugging out.

here is what I come up with:

local cmda = string.format("echo 'reboot' >/dev/console")
local cmdb = string.format("sleep 1")
local cmdc = string.format("echo '+++' >/dev/console")

os.execute(cmda)
os.execute(cmdb)
os.execute(cmdc)

Member for

16 years 10 months

brett

15 years 4 months ago

When you progress to LUA master you would write something like this

os.execute[[
echo reboot >/dev/console
sleep 1
echo +++ >/dev/console
]]

much nicer :)