Hi, I get negative power values from my EmonTx because I have a PV system connected to phase L1. In order to make that work with the python script for the Jeelink receiver from https://github.com/emoncms/development/blob/master/Tutorials/Python/PyLink/pylink.py
I had to change the line:
... value = int(values[i]) + int(values[i+1])*256 if value>32768: value -= -65536 datacsv.append(str(value)) ...
to:
if value>32768: value -= 65536
BR, Jörg.
Re: [SOLVED] Bug in python receive script for Jeelink?
Thanks, it;s been fixed https://github.com/emoncms/development/commit/e17dbab6a3d87bb8b68a62522616e52bf6e3e7e8
Re: [SOLVED] Bug in python receive script for Jeelink?
As I don't know anything about Python at all, I have a question regarding this script (might be slightly off-topic).
I saw that the script stopped this night with an error message. How can the script be made to recover automatically from such a fault (restart)?
Re: [SOLVED] Bug in python receive script for Jeelink?
Depends on the error message.
Best would be to identify what causes it and add an exception to generate a warning and go on processing.
Not difficult to achieve in python, the difficulty may lie in the rootcausing.
Re: [SOLVED] Bug in python receive script for Jeelink?
Jerome,
hope you can give me a hint. The error message created is always due to Emoncms not responding to a GET request:
I have no experience with Python, but have now done the following:
It seems to work (script not stopping with the above error any more), but I would like to know how this could be improved. Or is it ok to do it like this?
BR, Jörg.
Re: [SOLVED] Bug in python receive script for Jeelink?
What you're doing seems fine.
I'd to it like this:
Perhaps could you consider using the python OEM Gateway if you want to do this kind of things. It is supposed to be more featured. And it can resend data when server is unreachable.
Re: [SOLVED] Bug in python receive script for Jeelink?
Jérôme,
Thank you very much for your comment. Since using my modified script, it works flawlessly. But I will change it to your proposal and have a look into the OEM Gateway next.
BR, Jörg.
Re: [SOLVED] Bug in python receive script for Jeelink?
You don't have to change it, the only difference is that you commented the lines providing the feedback from Emoncms. But since this feedback is printed into nothing, commenting that is fine.