Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EmonHubMqttInterfacer.py crash when transmitting via RF (required for emonglcd etc.) #211

Merged
merged 4 commits into from
May 20, 2024

Conversation

alandpearson
Copy link
Contributor

@alandpearson alandpearson commented Apr 26, 2024

A typo appears to have made in my last commit 2 years ago, which went unnoticed.
This causes EmonHubMqttInterfacer.py to crash when using RF send functionality (used for emonPiGLCD).
Line 265:
msg.payload,decode() should be msg.payload.decode() (note comma instead of period)
and a further crash fixed at line 268 (_log.debug, msg.payload is not a string)
Additionally, EmonHubOEMInterfacer sending was updated to use existing send_cmd function instead of sending directly to serial port (to ensure "\n" is correctly appended) and remove spurious trailing comma from the end of cmd string.

… unnoticed.

This causes EmonHubMqttInterfacer.py to crash when using RF send functionality (used for emonPiGLCD).
 Line 265:
msg.payload,decode() should be msg.payload.decode() (note , instead of
.)
Additionally a further crash fixed at line 268 (_log.debug, msg.payload
not a string)
This makes a big difference on lower powered hardware e.g. pizero and
pi3b, and also allows more throughput with emonhub, as well as being
much more efficient.
A discussion on this last year:

https://community.openenergymonitor.org/t/emonhub-reduce-cpu-usage/22857/26
correctly appended when sending to serial)
Remove spurious trailing comma from end of payload string
@TrystanLea TrystanLea merged commit 81e211f into openenergymonitor:master May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants