I'm having trouble getting a fresh wheezy/ emonhub setup to post data from emontxv3 to localhost/ emoncms v8.2.4 setup on the same raspberry pi. It starts off posting ok with the update time on the Node page showing ca. 6secs but after 2- 3 minutes the update time is very erratic. It jumps about between 7-8 secs to 190 secs and back and eventually stops altogether.
The values recorded seem to get out of sync as well. The realtime graph produced from a Wh feed jumps up and down instead of steadily increasing.
These problems are only occurring on my localhost emoncms. The same emonhub posting to emoncms.org carries on working faultlessly while the local one is stopped.
Can anybody help figure out what's causing this as I have tried everything I can think of.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Interesting, of the two test systems we have here testing the emonhub, mine posting to emoncms.org has stable timing but Glyn's is showing this similar erratic timing posting to another emoncms instance (not local but not emoncms.org). Im not sure why that's happening at the moment.
Are you using this build guide? https://github.com/openenergymonitor/documentation/blob/master/Modules/R...
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Yes I followed that guide to the letter except I'm running rw on usb hdd.
I git pulled your latest updates this morning and temporarily disabled emonhub from posting to emoncms.org but the localhosts timing still turned unstable.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Been trying to test this this morning, I've got another pi up and running posting to a local server, so far it seems to be quite stable. Regular 10s updates from the emontx as expected. Il leave it running for a while.
I made a change to emoncms on the 16th of May that is needed for correct timing https://github.com/emoncms/emoncms/commit/607079d289ab8af7a36a9f863595c3..., is your local emoncms v 8.2 or more recent?
This still doesnt explain what is effecting Glyn's as the emoncms server his is posting to is v 8.2.4
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
I'm using v8.2.4 as well.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
I have just taken out the V8.2.4 changes you linked to above and the local server seems to be behaving now.
edit: The feeds are reporting as updated 2- 3 secs ago and figures look reasonable at the moment, I think, but the nodes have reverted to being 20mins behind and the message no. is jumping backwards and forwards again.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Since both your localhost and Glyn's are using v8.2.4 and have issues whilst both Trystans and your .org account's using v8.0.9 are ok the "difference" has to be within the changes made between v8.0.9 and v8.2.4.
https://github.com/emoncms/emoncms/compare/8.0.9...8.2.4
There are quite a few changes so unless something obvious can be spotted it maybe easier to git checkout the different versions to narrow the search to one revision or set of changes.
That's not to say emonCMS is necessarily at fault, but something that has changed causes a different result. once that change is found one or other can be modified to suit.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
That's strange, Glyn's monitor is posting more regularly now as of early this morning, the system hasnt been changed in any way.
The test pi (forwarder-only) I setup yesterday is still posting regularly and being logged correctly in to emoncms v8.2.4 here on a test server in the lab.
The changes I made here https://github.com/emoncms/emoncms/commit/607079d289ab8af7a36a9f863595c3... should actually improve the timing as it allows for the timing to be set by the raspberrypi rather than the packet receive time in emoncms. Without this change if you bulk upload several hours of data it will try and insert it all at one point in time rather than use the timing given by the raspberrypi.
Il keep investigating..
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
@nrgbod, It would be interesting to look at your emonhub log to see what the timing given to the packets are there.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
If you could also pull in the latest version that would be great as it has an easier to read and debug log format for the bulk data.
Once logged in to the pi the steps are:
ipe-rw
cd emonhub
git pull
sudo service emonhub restart
ipe-ro
To view the log
tail -f /var/log/emonhub.conf
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
https://github.com/TrystanLea/emonhub/tree/threading
Just added a link for anyone following the discussion and I think those steps should be rpi not ipe :-)
Paul
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
I've just added another improvement. I did have a time.sleep(5) in the dispatcher loop but thinking about it, its better to run the dispatcher on a 'timed' basis: so rather than:
while 1:
# dispatch
time.sleep(5)
it now checks the time:
while 1:
if ((time.time() - lastposttime)>5.0):
lastposttime = time.time()
# dispatch
time.sleep(0.1)
with the first method: say dispatching takes 2 seconds the next dispatch will be 7seconds from the start of the first dispatch. With the second method the 2nd dispatch will be happen at 5s as long as the dispatch time of the first is less than 5s.
I dont think this will fix the problem though because the actual packet timing is independent of this.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
A bit off-topic: git has a "git bisect" command that does the checkouts until the guilty commit is found.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
I pulled in the latest changes to emonhub but the local server nodes page update times are still slowing down and jumping about. The message numbers are also jumping backwards and forwards on the nodes page, or is that a result of buffering?
I previously thought the times on the feeds page looked normal at 4- 5 secs but now they are matching the nodes page more or less.
Attached are some screenshots of log outputs with emonhub only posting to the local server. ie. with remote server sending disabled in emonhubnode.conf
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Over the weekend I reinstalled the software to another HDD. This time I used Trystans Emonhub/ raspberry image and installed the latest emoncms (v8.2.4) via git.
The ever increasing node times where still happening so I updated to the latest Emonhub version on Trystans Git page.
This time I could see the local host buffering being recorded in the emonhub.log when I first fired up the new version. Then after about 40 minutes the log recorded the buffer had reached it's 1000 item limit and items where being discarded (see screenshots). The buffer reaching it's limit coincided with when the nodes page stopped updating.
Is the Emonhub forwarder meant to be able to forward from the same machine it's forwarding to? ie. I'm running Emonhub on my localhost rpi forwarding to emoncms also on my localhost rpi.
Also is emonhub.conf not used? Trystans instructions only detail modifying emonhubnode.conf
My emonhubnode.conf file contents......
####################
# Hub settings #
####################
[hub]
# log file path
logfile = /var/log/emonhub/emonhub.log
# loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
# see here : http://docs.python.org/2/library/logging.html
loglevel = DEBUG
#############
# Listeners #
#############
[listeners]
# This listener manages the RFM2Pi module
[[RFM2Pi]]
type = EmonHubRFM2PiListener
[[[init_settings]]]
com_port = /dev/ttyAMA0
[[[runtime_settings]]]
sgroup = 210
frequency = 4
baseid = 15
sendtimeinterval = 0
defaultDecoding = byte
# This listener gets data from a socket
[[Socket]]
type = EmonHubSocketListener
[[[init_settings]]]
port_nb = 50011
[[[runtime_settings]]]
###############
# Dispatchers #
###############
[dispatchers]
# The two following dispatchers instantiate the same class,
# that formats the data for an emoncms instance.
# One sends the data to a local instance, the other one
# to a distant one.
# If active is set to False, the dispatcher neither records nor sends any data,
# but it buffers unsent data until active becomes True.
[[emoncms_local]]
type = EmonHubEmoncmsDispatcher
[[[init_settings]]]
bufferMethod = memory
bufferSize = 1000
[[[runtime_settings]]]
url = http://localhost/emoncms
interface = /node/multiple
apikey =xxxxxxxxxxxxxxxxxxxxxxxxxxxx
active = True
maxItemsPerPost = 100
[[emoncms_remote]]
type = EmonHubEmoncmsDispatcher
[[[init_settings]]]
bufferMethod = memory
bufferSize = 1000
[[[runtime_settings]]]
url = http://emoncms.org
interface = /node/multiple
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
active = True
maxItemsPerPost = 100
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
@ngbod, thanks for the info on the logs. that suggests that emonhub cant reach or isnt getting the right reply from emoncms. I wonder if there's some error in the reply from emoncms. Do you see this line in the logs:
Send failure: wanted 'ok' but got ...
If you do what does it say it got?
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Thanks for helping Trystan, I have been seeing the send failure message all along but the reason has always been empty. Send failure: wanted 'ok' but got "blank"
2014-05-31 14:03:42,653 DEBUG Append item to buffer: http://localhost/emoncms, time: 1401541420, data: [33, 0, 0, 0, 0, 0, ,0,0,0,0,0,0,0,0],[1401540243,10,254,35,1,0,180,255,248,3,180,2,0,0,214,48,0,0,78,3,0,0,202,63,0,0,75,0,0,0,255,33,0,0,239,81,0,0,25,33,0,0,0,0,0,0,0,0,0,0],0,0,0,0,0,0],[1401540259,10,6,36,1,0,173,255,247,3,172,2,0,0,214,48,0,0,78,3,0,0,207,63,0,0,75,0,0,0,2,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],,0,0,0,0,0,0],[1401540274,19,200,10,14,6,95,7]]&sentat=1401541422
2014-05-31 14:03:43,084 WARNING Send failure: wanted 'ok' but got
2014-05-31 14:03:44,162 INFO Serial RX: 10 75 38 1 0 175 255 249 3 83 2 0 0 214 48 0 0 104 3 0 0 252 64 0 0 75 0 0 0 192 34 0 08 1 0 177 255 250 3 83 2 0 0 214 48 0 0 104 3 0 0 253 64 0 0 75 0 0 0 192 34 0 0 123 82 0 0 165 33 0 0 0 0 0 0 0 0 0 0
2014-05-31 14:03:44,178 DEBUG Node: 10
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
It seems like there is some strange going on there, your data is very long and seems to have an incorrect pattern of brackets:
[1401540259,10,6,36,1,0,173,255,247,3,172,2,0,0,214,48,0,0,78,3,0,0,207,63,0,0,75,0,0,0,2,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],,0,0,0,0,0,0]
That could be causing the reply to be false.. rather than true. I wonder if its combining packets into one line.
How fast are the radio packets coming in?
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Looking at your logs above, it looks like there could be data coming in every 0.6 of a millisecond or am I reading incorrectly?
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Sorry, I deleted a few lines in the middle to condense the post down. Here's the full section of log as it should have read....
2014-05-31 14:03:42,673 INFO Sending: http://localhost/emoncms/node/multiple | data=[[1401540144,10,203,35,1,0,172,255,249,3,174,2,0,0,214,48,0,0,76,3,0,0,173,63,0,0,75,0,0,0,235,33,0,0,228,81,0,0,14,33,0,0,0,0,0,0,0,0,0,0],[1401540145,10,204,35,1,0,175,255,247,3,178,2,0,0,214,48,0,0,76,3,0,0,174,63,0,0,75,0,0,0,236,33,0,0,228,81,0,0,14,33,0,0,0,0,0,0,0,0,0,0],[1401540145,19,200,10,32,6,114,7],[1401540145,10,205,35,1,0,175,255,247,3,176,2,0,0,214,48,0,0,76,3,0,0,174,63,0,0,75,0,0,0,236,33,0,0,228,81,0,0,14,33,0,0,0,0,0,0,0,0,0,0],[1401540147,10,206,35,1,0,173,255,248,3,173,2,0,0,214,48,0,0,76,3,0,0,175,63,0,0,75,0,0,0,237,33,0,0,228,81,0,0,14,33,0,0,0,0,0,0,0,0,0,0],[1401540149,10,207,35,1,0,175,255,246,3,171,2,0,0,214,48,0,0,76,3,0,0,176,63,0,0,75,0,0,0,237,33,0,0,229,81,0,0,15,33,0,0,0,0,0,0,0,0,0,0],[1401540150,19,200,10,26,6,114,7],[1401540151,10,208,35,1,0,173,255,250,3,174,2,0,0,214,48,0,0,76,3,0,0,176,63,0,0,75,0,0,0,237,33,0,0,229,81,0,0,15,33,0,0,0,0,0,0,0,0,0,0],[1401540153,10,209,35,1,0,176,255,251,3,177,2,0,0,214,48,0,0,76,3,0,0,177,63,0,0,75,0,0,0,238,33,0,0,229,81,0,0,15,33,0,0,0,0,0,0,0,0,0,0],[1401540155,10,210,35,1,0,176,255,249,3,174,2,0,0,214,48,0,0,76,3,0,0,177,63,0,0,75,0,0,0,238,33,0,0,229,81,0,0,15,33,0,0,0,0,0,0,0,0,0,0],[1401540155,18,47,10,114,8,15,11,163,27,215,11,249,23],[1401540156,19,200,10,26,6,120,7],[1401540157,10,211,35,1,0,176,255,249,3,170,2,0,0,214,48,0,0,76,3,0,0,178,63,0,0,75,0,0,0,239,33,0,0,229,81,0,0,15,33,0,0,0,0,0,0,0,0,0,0],[1401540161,10,213,35,1,0,173,255,249,3,173,2,0,0,214,48,0,0,76,3,0,0,179,63,0,0,75,0,0,0,239,33,0,0,230,81,0,0,16,33,0,0,0,0,0,0,0,0,0,0],[1401540163,10,214,35,1,0,172,255,252,3,174,2,0,0,214,48,0,0,76,3,0,0,180,63,0,0,75,0,0,0,240,33,0,0,230,81,0,0,16,33,0,0,0,0,0,0,0,0,0,0],[1401540165,10,215,35,1,0,172,255,249,3,172,2,0,0,214,48,0,0,76,3,0,0,180,63,0,0,75,0,0,0,240,33,0,0,230,81,0,0,16,33,0,0,0,0,0,0,0,0,0,0],[1401540167,19,200,10,20,6,120,7],[1401540167,10,216,35,1,0,174,255,250,3,169,2,0,0,214,48,0,0,76,3,0,0,181,63,0,0,75,0,0,0,240,33,0,0,231,81,0,0,17,33,0,0,0,0,0,0,0,0,0,0],[1401540169,10,217,35,1,0,173,255,250,3,174,2,0,0,214,48,0,0,76,3,0,0,181,63,0,0,75,0,0,0,241,33,0,0,230,81,0,0,16,33,0,0,0,0,0,0,0,0,0,0],[1401540169,10,218,35,1,0,173,255,250,3,174,2,0,0,214,48,0,0,76,3,0,0,181,63,0,0,75,0,0,0,241,33,0,0,230,81,0,0,16,33,0,0,0,0,0,0,0,0,0,0],[1401540171,10,218,35,1,0,176,255,250,3,169,2,0,0,214,48,0,0,76,3,0,0,182,63,0,0,75,0,0,0,241,33,0,0,231,81,0,0,17,33,0,0,0,0,0,0,0,0,0,0],[1401540172,19,200,10,26,6,120,7],[1401540173,10,219,35,1,0,172,255,251,3,179,2,0,0,214,48,0,0,76,3,0,0,182,63,0,0,75,0,0,0,242,33,0,0,230,81,0,0,16,33,0,0,0,0,0,0,0,0,0,0],[1401540175,10,220,35,1,0,172,255,251,3,180,2,0,0,214,48,0,0,76,3,0,0,183,63,0,0,75,0,0,0,242,33,0,0,231,81,0,0,17,33,0,0,0,0,0,0,0,0,0,0],[1401540177,10,221,35,1,0,177,255,251,3,178,2,0,0,214,48,0,0,76,3,0,0,184,63,0,0,75,0,0,0,242,33,0,0,232,81,0,0,18,33,0,0,0,0,0,0,0,0,0,0],[1401540178,19,200,10,32,6,120,7],[1401540179,10,222,35,1,0,176,255,251,3,141,2,0,0,214,48,0,0,77,3,0,0,184,63,0,0,75,0,0,0,243,33,0,0,232,81,0,0,18,33,0,0,0,0,0,0,0,0,0,0],[1401540179,10,223,35,1,0,176,255,251,3,141,2,0,0,214,48,0,0,77,3,0,0,184,63,0,0,75,0,0,0,243,33,0,0,232,81,0,0,18,33,0,0,0,0,0,0,0,0,0,0],[1401540181,10,223,35,1,0,174,255,250,3,117,2,0,0,214,48,0,0,77,3,0,0,185,63,0,0,75,0,0,0,243,33,0,0,233,81,0,0,19,33,0,0,0,0,0,0,0,0,0,0],[1401540183,10,224,35,1,0,174,255,249,3,168,2,0,0,214,48,0,0,77,3,0,0,185,63,0,0,75,0,0,0,243,33,0,0,233,81,0,0,19,33,0,0,0,0,0,0,0,0,0,0],[1401540184,19,200,10,26,6,120,7],[1401540185,10,225,35,1,0,176,255,251,3,177,2,0,0,214,48,0,0,77,3,0,0,186,63,0,0,75,0,0,0,244,33,0,0,233,81,0,0,19,33,0,0,0,0,0,0,0,0,0,0],[1401540187,10,226,35,1,0,173,255,253,3,181,2,0,0,214,48,0,0,77,3,0,0,186,63,0,0,75,0,0,0,244,33,0,0,233,81,0,0,19,33,0,0,0,0,0,0,0,0,0,0],[1401540189,10,227,35,1,0,172,255,252,3,177,2,0,0,214,48,0,0,77,3,0,0,187,63,0,0,75,0,0,0,245,33,0,0,233,81,0,0,19,33,0,0,0,0,0,0,0,0,0,0],[1401540189,10,228,35,1,0,172,255,252,3,177,2,0,0,214,48,0,0,77,3,0,0,187,63,0,0,75,0,0,0,245,33,0,0,233,81,0,0,19,33,0,0,0,0,0,0,0,0,0,0],[1401540191,10,228,35,1,0,178,255,251,3,183,2,0,0,214,48,0,0,77,3,0,0,188,63,0,0,75,0,0,0,245,33,0,0,234,81,0,0,20,33,0,0,0,0,0,0,0,0,0,0],[1401540193,10,229,35,1,0,174,255,251,3,181,2,0,0,214,48,0,0,77,3,0,0,188,63,0,0,75,0,0,0,245,33,0,0,234,81,0,0,20,33,0,0,0,0,0,0,0,0,0,0],[1401540195,19,200,10,26,6,114,7],[1401540195,10,230,35,1,0,173,255,251,3,179,2,0,0,214,48,0,0,77,3,0,0,189,63,0,0,75,0,0,0,246,33,0,0,234,81,0,0,20,33,0,0,0,0,0,0,0,0,0,0],[1401540197,10,231,35,1,0,173,255,251,3,170,2,0,0,214,48,0,0,77,3,0,0,189,63,0,0,75,0,0,0,246,33,0,0,234,81,0,0,20,33,0,0,0,0,0,0,0,0,0,0],[1401540199,10,232,35,1,0,174,255,250,3,117,2,0,0,214,48,0,0,77,3,0,0,190,63,0,0,75,0,0,0,246,33,0,0,235,81,0,0,21,33,0,0,0,0,0,0,0,0,0,0],[1401540199,10,233,35,1,0,174,255,250,3,117,2,0,0,214,48,0,0,77,3,0,0,190,63,0,0,75,0,0,0,246,33,0,0,235,81,0,0,21,33,0,0,0,0,0,0,0,0,0,0],[1401540201,19,200,10,20,6,108,7],[1401540201,10,233,35,1,0,172,255,250,3,138,2,0,0,214,48,0,0,77,3,0,0,190,63,0,0,75,0,0,0,247,33,0,0,234,81,0,0,20,33,0,0,0,0,0,0,0,0,0,0],[1401540203,10,234,35,1,0,174,255,252,3,181,2,0,0,214,48,0,0,77,3,0,0,191,63,0,0,75,0,0,0,247,33,0,0,235,81,0,0,21,33,0,0,0,0,0,0,0,0,0,0],[1401540205,10,235,35,1,0,174,255,251,3,187,2,0,0,214,48,0,0,77,3,0,0,191,63,0,0,75,0,0,0,248,33,0,0,234,81,0,0,20,33,0,0,0,0,0,0,0,0,0,0],[1401540206,19,200,10,26,6,101,7],[1401540207,10,236,35,1,0,179,255,252,3,182,2,0,0,214,48,0,0,77,3,0,0,192,63,0,0,75,0,0,0,248,33,0,0,235,81,0,0,21,33,0,0,0,0,0,0,0,0,0,0],[1401540209,10,237,35,1,0,177,255,251,3,181,2,0,0,214,48,0,0,77,3,0,0,193,63,0,0,75,0,0,0,248,33,0,0,236,81,0,0,22,33,0,0,0,0,0,0,0,0,0,0],[1401540209,10,238,35,1,0,177,255,251,3,181,2,0,0,214,48,0,0,77,3,0,0,193,63,0,0,75,0,0,0,248,33,0,0,236,81,0,0,22,33,0,0,0,0,0,0,0,0,0,0],[1401540211,10,238,35,1,0,173,255,252,3,182,2,0,0,214,48,0,0,77,3,0,0,193,63,0,0,75,0,0,0,249,33,0,0,235,81,0,0,21,33,0,0,0,0,0,0,0,0,0,0],[1401540212,19,200,10,26,6,101,7],[1401540213,10,239,35,1,0,176,255,251,3,182,2,0,0,214,48,0,0,77,3,0,0,194,63,0,0,75,0,0,0,249,33,0,0,236,81,0,0,22,33,0,0,0,0,0,0,0,0,0,0],[1401540215,10,240,35,1,0,175,255,252,3,181,2,0,0,214,48,0,0,77,3,0,0,194,63,0,0,75,0,0,0,250,33,0,0,235,81,0,0,21,33,0,0,0,0,0,0,0,0,0,0],[1401540217,10,241,35,1,0,175,255,251,3,176,2,0,0,214,48,0,0,77,3,0,0,195,63,0,0,75,0,0,0,250,33,0,0,236,81,0,0,22,33,0,0,0,0,0,0,0,0,0,0],[1401540217,19,200,10,26,6,95,7],[1401540218,18,47,10,120,8,15,11,169,27,221,11,255,23],[1401540219,10,242,35,1,0,176,255,251,3,173,2,0,0,214,48,0,0,77,3,0,0,195,63,0,0,75,0,0,0,250,33,0,0,236,81,0,0,22,33,0,0,0,0,0,0,0,0,0,0],[1401540219,10,243,35,1,0,176,255,251,3,173,2,0,0,214,48,0,0,77,3,0,0,195,63,0,0,75,0,0,0,250,33,0,0,236,81,0,0,22,33,0,0,0,0,0,0,0,0,0,0],[1401540221,10,243,35,1,0,175,255,250,3,178,2,0,0,214,48,0,0,77,3,0,0,196,63,0,0,75,0,0,0,251,33,0,0,236,81,0,0,22,33,0,0,0,0,0,0,0,0,0,0],[1401540223,10,244,35,1,0,173,255,252,3,177,2,0,0,214,48,0,0,78,3,0,0,197,63,0,0,75,0,0,0,251,33,0,0,238,81,0,0,24,33,0,0,0,0,0,0,0,0,0,0],[1401540223,19,200,10,20,6,95,7],[1401540225,10,245,35,1,0,180,255,253,3,176,2,0,0,214,48,0,0,78,3,0,0,197,63,0,0,75,0,0,0,251,33,0,0,238,81,0,0,24,33,0,0,0,0,0,0,0,0,0,0],[1401540227,10,246,35,1,0,177,255,250,3,176,2,0,0,214,48,0,0,78,3,0,0,198,63,0,0,75,0,0,0,252,33,0,0,238,81,0,0,24,33,0,0,0,0,0,0,0,0,0,0],[1401540229,19,200,10,20,6,95,7],[1401540229,10,247,35,1,0,172,255,251,3,176,2,0,0,214,48,0,0,78,3,0,0,198,63,0,0,75,0,0,0,252,33,0,0,238,81,0,0,24,33,0,0,0,0,0,0,0,0,0,0],[1401540230,10,248,35,1,0,176,255,251,3,176,2,0,0,214,48,0,0,78,3,0,0,198,63,0,0,75,0,0,0,252,33,0,0,238,81,0,0,24,33,0,0,0,0,0,0,0,0,0,0],[1401540231,10,248,35,1,0,176,255,247,3,179,2,0,0,214,48,0,0,78,3,0,0,199,63,0,0,75,0,0,0,253,33,0,0,238,81,0,0,24,33,0,0,0,0,0,0,0,0,0,0],[1401540233,10,249,35,1,0,174,255,250,3,173,2,0,0,214,48,0,0,78,3,0,0,199,63,0,0,75,0,0,0,253,33,0,0,238,81,0,0,24,33,0,0,0,0,0,0,0,0,0,0],[1401540235,19,200,10,14,6,95,7],[1401540235,10,250,35,1,0,175,255,249,3,175,2,0,0,214,48,0,0,78,3,0,0,200,63,0,0,75,0,0,0,253,33,0,0,239,81,0,0,25,33,0,0,0,0,0,0,0,0,0,0],[1401540237,10,251,35,1,0,174,255,250,3,174,2,0,0,214,48,0,0,78,3,0,0,201,63,0,0,75,0,0,0,254,33,0,0,239,81,0,0,25,33,0,0,0,0,0,0,0,0,0,0],[1401540239,10,252,35,1,0,173,255,249,3,177,2,0,0,214,48,0,0,78,3,0,0,201,63,0,0,75,0,0,0,254,33,0,0,239,81,0,0,25,33,0,0,0,0,0,0,0,0,0,0],[1401540240,10,253,35,1,0,173,255,249,3,177,2,0,0,214,48,0,0,78,3,0,0,201,63,0,0,75,0,0,0,254,33,0,0,239,81,0,0,25,33,0,0,0,0,0,0,0,0,0,0],[1401540240,19,200,10,20,6,95,7],[1401540241,10,253,35,1,0,173,255,247,3,171,2,0,0,214,48,0,0,78,3,0,0,202,63,0,0,75,0,0,0,254,33,0,0,240,81,0,0,26,33,0,0,0,0,0,0,0,0,0,0],[1401540243,10,254,35,1,0,180,255,248,3,180,2,0,0,214,48,0,0,78,3,0,0,202,63,0,0,75,0,0,0,255,33,0,0,239,81,0,0,25,33,0,0,0,0,0,0,0,0,0,0],[1401540245,10,255,35,1,0,177,255,248,3,170,2,0,0,214,48,0,0,78,3,0,0,203,63,0,0,75,0,0,0,255,33,0,0,240,81,0,0,26,33,0,0,0,0,0,0,0,0,0,0],[1401540246,19,200,10,20,6,95,7],[1401540247,10,0,36,1,0,175,255,248,3,170,2,0,0,214,48,0,0,78,3,0,0,203,63,0,0,75,0,0,0,0,34,0,0,239,81,0,0,25,33,0,0,0,0,0,0,0,0,0,0],[1401540249,10,1,36,1,0,173,255,249,3,173,2,0,0,214,48,0,0,78,3,0,0,204,63,0,0,75,0,0,0,0,34,0,0,240,81,0,0,26,33,0,0,0,0,0,0,0,0,0,0],[1401540250,10,2,36,1,0,172,255,249,3,173,2,0,0,214,48,0,0,78,3,0,0,204,63,0,0,75,0,0,0,0,34,0,0,240,81,0,0,26,33,0,0,0,0,0,0,0,0,0,0],[1401540251,10,2,36,1,0,172,255,247,3,171,2,0,0,214,48,0,0,78,3,0,0,204,63,0,0,75,0,0,0,0,34,0,0,240,81,0,0,26,33,0,0,0,0,0,0,0,0,0,0],[1401540253,10,3,36,1,0,173,255,247,3,173,2,0,0,214,48,0,0,78,3,0,0,205,63,0,0,75,0,0,0,1,34,0,0,240,81,0,0,26,33,0,0,0,0,0,0,0,0,0,0],[1401540255,10,4,36,1,0,174,255,245,3,178,2,0,0,214,48,0,0,78,3,0,0,206,63,0,0,75,0,0,0,1,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],[1401540257,19,200,10,14,6,95,7],[1401540257,10,5,36,1,0,177,255,248,3,176,2,0,0,214,48,0,0,78,3,0,0,206,63,0,0,75,0,0,0,2,34,0,0,240,81,0,0,26,33,0,0,0,0,0,0,0,0,0,0],[1401540259,10,6,36,1,0,173,255,247,3,172,2,0,0,214,48,0,0,78,3,0,0,207,63,0,0,75,0,0,0,2,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],[1401540260,10,7,36,1,0,175,255,247,3,172,2,0,0,214,48,0,0,78,3,0,0,207,63,0,0,75,0,0,0,2,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],[1401540261,10,7,36,1,0,175,255,245,3,170,2,0,0,214,48,0,0,78,3,0,0,207,63,0,0,75,0,0,0,2,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],[1401540263,19,200,10,14,6,95,7],[1401540263,10,8,36,1,0,173,255,244,3,172,2,0,0,214,48,0,0,78,3,0,0,208,63,0,0,75,0,0,0,3,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],[1401540265,10,9,36,1,0,175,255,245,3,171,2,0,0,214,48,0,0,78,3,0,0,208,63,0,0,75,0,0,0,3,34,0,0,241,81,0,0,27,33,0,0,0,0,0,0,0,0,0,0],[1401540267,10,10,36,1,0,174,255,243,3,177,2,0,0,214,48,0,0,79,3,0,0,209,63,0,0,75,0,0,0,3,34,0,0,243,81,0,0,29,33,0,0,0,0,0,0,0,0,0,0],[1401540268,19,200,10,14,6,101,7],[1401540269,10,11,36,1,0,178,255,244,3,173,2,0,0,214,48,0,0,79,3,0,0,210,63,0,0,75,0,0,0,4,34,0,0,243,81,0,0,29,33,0,0,0,0,0,0,0,0,0,0],[1401540270,10,12,36,1,0,173,255,244,3,173,2,0,0,214,48,0,0,79,3,0,0,210,63,0,0,75,0,0,0,4,34,0,0,243,81,0,0,29,33,0,0,0,0,0,0,0,0,0,0],[1401540271,10,12,36,1,0,173,255,242,3,168,2,0,0,214,48,0,0,79,3,0,0,210,63,0,0,75,0,0,0,4,34,0,0,243,81,0,0,29,33,0,0,0,0,0,0,0,0,0,0],[1401540273,10,13,36,1,0,175,255,242,3,174,2,0,0,214,48,0,0,79,3,0,0,211,63,0,0,75,0,0,0,5,34,0,0,243,81,0,0,29,33,0,0,0,0,0,0,0,0,0,0],[1401540274,19,200,10,14,6,95,7]]&sentat=1401541422
2014-05-31 14:03:43,084 WARNING Send failure: wanted 'ok' but got
2014-05-31 14:03:44,162 INFO Serial RX: 10 75 38 1 0 175 255 249 3 83 2 0 0 214 48 0 0 104 3 0 0 252 64 0 0 75 0 0 0 192 34 0 08 1 0 177 255 250 3 83 2 0 0 214 48 0 0 104 3 0 0 253 64 0 0 75 0 0 0 192 34 0 0 123 82 0 0 165 33 0 0 0 0 0 0 0 0 0 0
2014-05-31 14:03:44,178 DEBUG Node: 10
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Aha, I now realise why it was giving a blank reply for got, I've just fixed it, If you pull the latest change and try restarting emonhub it should give some information on the errors
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Pulled the changes but this is all the log is producing now.....
2014-06-03 22:14:30,226 DEBUG Opening socket on port 50011
2014-06-03 22:40:00,368 DEBUG SIGINT received.
2014-06-03 22:40:00,372 DEBUG Closing serial port
2014-06-03 22:40:00,375 DEBUG Closing socket
2014-06-03 22:40:00,377 INFO Exiting hub...
2014-06-03 22:40:02,366 INFO Logging level set to DEBUG
2014-06-03 22:40:02,369 INFO EmonHub v1.0.0
2014-06-03 22:40:02,371 INFO Opening hub...
2014-06-03 22:40:02,374 INFO Creating dispatcher emoncms_local
2014-06-03 22:40:02,381 INFO Set up dispatcher 'emoncms_local' (buffer: memory)
2014-06-03 22:40:02,383 INFO Creating dispatcher emoncms_remote
2014-06-03 22:40:02,389 INFO Set up dispatcher 'emoncms_remote' (buffer: memory)
2014-06-03 22:40:02,392 INFO Creating listener RFM2Pi
2014-06-03 22:40:02,395 DEBUG Opening serial port: /dev/ttyAMA0
2014-06-03 22:40:02,399 INFO Setting send time interval to 0
2014-06-03 22:40:02,402 INFO Setting RFM2Pi | frequency: 4
2014-06-03 22:40:03,406 INFO Setting RFM2Pi | sgroup: 210
2014-06-03 22:40:04,409 INFO Setting RFM2Pi | baseid: 15
2014-06-03 22:40:05,413 INFO Setting defaultDecoding to byte
2014-06-03 22:40:05,415 INFO Creating listener Socket
2014-06-03 22:40:05,418 DEBUG Opening socket on port 50011
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
might be worth restarting it again, it looks like the rfm12pi isnt responding, if restarting it doesnt work try pulling out and re-inserting the rfm12pi then restarting emonhub again,
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
After restarting I got the undefined offset error the same as below.
I then decided to reinstall everything from an image I saved when I very first set the system up last time ie.with blank databases before I started logging. Low and behold this ran perfectly, error free for about five hours.
Thinking the problem was solved I tried to reinstall again from the same image but this time the undefined offset errors returned and the localhost system stopped within 20 minutes, but as usual the emoncms.org postings carried on without problems.
The undefined offset lines below where repeated hundreds of times so I've taken most of them out to stop the post being too long.
2014-06-04 19:56:33,487 WARNING Send failure: wanted 'ok' but got <br />
<b>Notice</b>: Undefined offset: 48 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 9 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>157</b><br />
<br />
<b>Notice</b>: Undefined offset: 10 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>157</b><br />
<br />
<b>Notice</b>: Undefined offset: 11 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>157</b><br />
<br />
<b>Notice</b>: Undefined offset: 48 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 49 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 50 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 51 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 52 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 53 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 54 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Notice</b>: Undefined offset: 55 in <b>/var/www/emoncms/Modules/node/node_model.php</b> on line <b>166</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at
/var/www/emoncms/Modules/node/node_model.php:166) in <b>/var/www/emoncms/index.php</b> on line <b>131</b><br />
true
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Fantastic, I think this explains the reason why this only affected particular configurations and not others! and why emoncms.org works and not the local install..
The error is caused by the decoder specification in the nodes module being longer than the number of bytes received for that node. Ie if a node is sending 4 integers but the decoder has 6 integers set then that causes this bug, which I should really catch rather than leaving it to happen - I will fix that.
The error does not appear in the emoncms.org output because of the way there is a redis worker queue between the HTTP api and the processing of the data.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Ok fix implemented version is now: 8.2.6
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Trystan, thanks for the quick response. I've had V8.2.6 running for a couple of hours now and all seems well my local server is matching the emoncms.org version exactly and the logs are error free.
OT but could you add the fix for the kWh to kWhd processor not updating to the emoncms.org version. I don't think it restarts on v809 but was ok on my local install with later versions.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
V8.2.6 still running fine. kWh to kWhd also now working on both local server and emoncms.org.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Fantastic good to hear that the v8.2.6 changes are working, I havent made any kwh_to_kwhd related modifications but good to hear its working. Il mark this thread as solved
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
I've just reinstalled emoncms on my local server and this problem has reappeared. I installed the latest buffered write version then switched it to the master branch full emoncms v8.3.6 running on HDD with the latest Emonhub v1.0 rc sending to the inputs page. It is sending to emoncms.org fine but the update intervals to the local server get progressively longer and longer until they stop.
I think I have emonhub.conf configured correctly with the correct datacodes but would appreciate any pointers where to look for a solution.
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
What log messages are you getting in /var/log/emonhub/emonhub.log ? You can make the logs more detailed by changing the loglevel in emonhub.conf to DEBUG.
If you receiving the data correctly at emoncms.org the configuration of emonhub and the datacodes should be ok, only the url and apikey differ between targets.
Did you do all the steps in the "switch to full emoncms" guide?
Paul
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Yes I followed that guide to the letter.
I've just switched to DEBUG mode and the log is attached but I'm not sure what to make of it.
The api key and url must be correct if the local emoncms receives some data before locking up, shouldn't it?
Re: Emonhub sending to localhost grinds to a halt [SOLVED]
Yes the apikey and the url must be good, as you say things start off ok which confirms they were correct and see no reason to suspect they changed. the log shows the identical data string being sent to both remote and local emoncms, For some unknown reason the local emoncms response changes from "ok" to
I cannot explain why, but since the remote emoncms didn't object to the same data, the issue is probably something that is particular to the local emoncms install but not the remote.
There are "warnings" in the rogue response that suggest a permission issue with log4php opening emoncms.log, maybe that's a starting point, if emoncms was able to log a message that should help.
Paul