Error on restarting PI with emonhub

Hi

I had to halt all systems for some electrical work. When I restarted my test Pi running emonhub I noticed it was not posting to emoncms.org.

I stopped and started the emonhub service and looked at the log with this result:-

Traceback (most recent call last):
  File "/usr/share/emonhub/emonhub.py", line 338, in <module>
    hub.run()
  File "/usr/share/emonhub/emonhub.py", line 90, in run
    values = I.read()
  File "/home/pi/emonhub/src/emonhub_interfacer.py", line 509, in read
    return self._process_frame(f, t)
  File "/home/pi/emonhub/src/emonhub_interfacer.py", line 101, in _process_frame
    validated = self._validate_frame(ref, frame)
  File "/home/pi/emonhub/src/emonhub_interfacer.py", line 531, in _validate_fram                        e
    self.rssi = int(received[-1][1:-1])
ValueError: invalid literal for int() with base 10: '8F'

Regards

Ian

 

 

 

pb66's picture

Re: Error on restarting PI with emonhub

Hi Ian

Can you show us the log leading up to this error? It would be good to at least see the frames arriving from the rfm2pi immediately prior to the error.

line 531 "self.rssi = int(received[-1][1:-1])"  is inside an if function that tests if the last item in the list is in parenthesis which it must of found true, but then it failed because it tried to cast the result of removing the parenthesis from the text string to an int, normally no problem as only the RSSI is in brackets and that is normally an int. But the errors suggest it found "8F" inside the parenthesis and although emonhub should handle the error better It should not of seen '(8F)' there. I'm not sure how that came about, it could be hex, the RFM2Pi can output hex but I'm not sure how emonhub responds as I've never tried it to be honest.

Paul

EDIT -    8F is 10001111 or -16 as a signed byte so it is possibly a hex rssi, it's in range !!

Ian Eagland's picture

Re: Error on restarting PI with emonhub

Hi Paul

Messed up looking for log file so I rebooted Pi and of course everything is now working perfectly!

Regards

Ian

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.