AVR reboot

4 replies [Last post]
garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011

Hi,

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

 

Thanks,

 

Garry

 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Rebooting the AVR without the rebooting the HAH

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.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
thanks... good news

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.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Works with slight modification

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)

brett
Offline
Providence, United States
Joined: 9 Jan 2010
That's one way

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 :)

Hardware Info