Here's the scenario.
i have a cc128 with 2 sensors (soon to be 3-to monitor grid supply) the main power sensor which monitors house usage power:-
dbzoo.livebox.CurrentCost:ch.1
a second which monitors solar power produced :-
dbzoo.livebox.CurrentCost:sensor.1
now if i do an xap-snoop all seems fine and is uploaded to pachube (feed 15114 if your interested)
Member for
16 years 10 monthsPossible problems
As I don't have a CC unit anymore since moving to the US I won't be to test, however I can offer some help.
If xap-snoop is not seeing the data then the problem must squarely lie with the xap-currentcost program. I'm assuming here that only sensor.2 disappears and ch.1 is still reporting? Is this the case?
As Sensor.2 is remote there are few possibilities
There was a few minor updates to this component for build 280, so at least get yourself on this latest build as any fix will be applied here anyway so its good place to be.
If you run xap-currentcost in with debug enabled what is the last thing displayed before it dies?
Brett
Member for
15 years 7 monthsReboot script
Hi
I run a cc unit and have two sensors plus temp:Ch.1, Sensor.9, and temp
these work no problems on version 279.23 so can't help you an that front but I do use a reboot script adapted from Bretts sample, its here if you need it.
Thanks, Garry.
--[[
Auto reboot HAH every 3 hours.
--]]
module(...,package.seeall)
require("xap")
info={
version="1.0", description="Auto reboot after set time"
}
function reboot(self)
os.execute("/sbin/reboot")
self:reset()
end
function init()
xap.Timer(reboot, 10800):start()
end
Member for
15 years 10 monthsThe COMMS to the main unit
will investigate further
Member for
15 years 10 monthsOk i put the reboot script in
Ok i put the reboot script in /etc/plugboard directory labelled rebootApplet.lua
restarted everything (and set it to 3 minute reboot) doesnt seem to be doing anything, now i know i have missed something can anyone advise what?
i am not a script guy, i am ok with linux and cisco cli but my main expertise is hardware not programming or scripting.
Member for
15 years 7 monthsHAH Version ?
Sorry, forgot to check. The script is for the new lua engine available on versions 279.x and 280.
If you are on any of these versions then the file in the link below should reboot every five mins if you put it in /etc/plugboard.
I have made it five mins as its short enough to test functionality but long enough to log in a remove/alter when you need to without getting into a reboot loop, which I have done before and wasn't much fun ;).
Thanks Garry
https://docs.google.com/leaf?id=0BwzJbOYgkNcVZGU3NDZhZjEtZWI4Mi00MjkxLT…
Member for
15 years 10 monthsThanks for that put it in
Thanks for that put it in /etc/plugboard even gave it a 0777 security box still isnt rebooting, do i have to do anything else?
ignore me being stupid as normal :)) working now thanks for help.
got another couple of cc's on order with leads for data capture so going to do some serious data capturing :)
Ta
Dean
Member for
17 yearsWhat is hanging up?
I've made extensive use of CC128 feeding pachube. Pretty damn solid for me (i have a planned reboot once a week, but I have let it run for > 20days).
Having seen a fair few liveboxen, I did get one that consistently hung up after 20mins or so. I put this down to a hardware issue in that livebox. In particular, the 5V regulator does run pretty damn hot in normal operation.
It might be worth you picking up another Livebox to do a 'contrast & compare' ... they are still readily available on eBay.
Cheers,
Derek.
Member for
16 years 10 monthsCheck your HAH version
You need to be on version 280 for this to work - if you are not then the reboot script will not run.
As always you can update your firmware with
# /etc/init.d/update
Member for
15 years 10 monthsignore me being stupid as
ignore me being stupid as normal :)) working now thanks for help.
Member for
15 years 10 monthsway ahead of you
Bidding on 3 at present :)
Member for
15 years 10 monthsI was being stupid but didnt say what now in same position
had to build a new livebox as mine died, now i have the problem that my scripts do not run automatically.
now i said i was being stupid last time but cannot remember what i did.
what else do you have to do apart from have a lua script in the /etc/plugboard directory to get it to run?
ta
Member for
16 years 5 monthsCorrect Filename
They do end with Applet.lua don't they?
ie myscriptApplet.lua, i beleive it is case sensitive as well, so make sure you use a capital A.
Also make sure that the plugboard scripting engine is enable on the assists tab on the web GUI.
Member for
15 years 10 monthsyes, yes and it is.
code:-
--[[
Auto reboot HAH every 5 mins.
--]]
module(...,package.seeall)
require("xap")
info={
version="1.0", description="Auto reboot after set time"
}
function reboot(self)
os.execute("/sbin/reboot")
self:reset()
end
function init()
xap.Timer(reboot, 300):start()
end
Member for
15 years 10 monthsAnyone, this is really bugging me now
I have done everything i can think of the script runneth not.
HELP
Member for
16 years 5 monthsLooks Familiar
You should probably read this, /content/lua-modules, Brett's posted an answer to the exact same question. I want to test it myself to prove that I understand it properly, but I think that it basically comes down to the way you run/call the code, you can't call the module function when you run it using the command lua <script name>.
I'll try the code myself and see how I get on,
Karl
UPDATE:
I copied your script into the /etc/plugboard folder, called it rebootApplet.lua and then rebooted the HAH. I then monitored the HAH and it did reboot after approx. 5 minutes. I don't think there is anything wrong with the script, just the way you're trying to run it.
Member for
15 years 10 monthsyes your right
running it manually does not work.
tried exactly what you did
"
UPDATE:
I copied your script into the /etc/plugboard folder, called it rebootApplet.lua and then rebooted the HAH. I then monitored the HAH and it did reboot after approx. 5 minutes. I don't think there is anything wrong with the script, just the way you're trying to run it."
and it does not reboot GRR
apart from enabling the plu
g board scripting engine having it in /etc/plugboard directory what else do i have to do??? (and yes i rebooted it)
Member for
16 years 5 monthsChecks
OK, the plugboard is enable in the web GUI, and the filename is formatted correctly and stored in the correct place.
Log into the HAH as root and type 'ps', this should show you all the processs running on the HAH. You should see 'lua /etc/plugboard/plugboard.lua', this is obviously the plugboard script running. If you don't see it we need to find out why it's not running.
You could also remove/rename any other script in the plugboard folder to stop them running just incase one of them my be causing a problem, again, remembering to reboot after altering the contents of this folder.
Karl
Member for
15 years 10 monthsits not running :(
But in the ini it is enabled
so how should i correctly set it running with a debug on?
Member for
16 years 5 monthsProgress
Fist of all I'd remove ALL scripts from the /etc/plugboard directory, this isn't strictly necessary but we'd then know we're running clean. I'd then reboot and check to see if the plugboard script runs, using ps again.
Member for
15 years 7 monthsTry this way
Member for
16 years 10 monthsAs an applet
If you are running an applet and its failing any output will be logged to /var/log/xap-plugboard.log - check in there.
I'm also checking you've done a firmware upgrade recently and are not running a *really old* version of plugboard as in v1?
As Gary mentioned the best way to debug is run it manually on the command line and watch. First stop the daemon, then run it manually.
# /etc/init.d/xap stop plugboad
# xap-plugboard
Brett
Member for
15 years 10 monthswell i decided to bite the
well i decided to bite the bullet and di a ini file backup only and a full and hard reset.
put it all back
and would you belive it it is now working fine
double GRRRRRRRRRRRRRRRRR