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

hex protocol implementation #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

giacinti
Copy link

@giacinti giacinti commented Feb 6, 2021

Hello,

Many thanks for your original work and repository. I have created this PR for adding support for the VE.Direct HEX protocol as described in this document: https://www.victronenergy.fr/download-document/4459/bluesolar-hex-protocol-mppt.pdf

Some notes:

  • I'm using (successfully) this implementation in my MPPT monitoring with esphome and homeassistant (see my code here: https://github.com/giacinti/vedirect)
  • the consumer has to record one or many callback functions which will then be called when the hex message has been validated (checksum valid) - it is necessary to process the data right away as the buffer could potentially be changed by an async message. I updated the example file accordingly - please check it out
  • when a hex message is detected, the current machine state is saved and restored after processing. This way we can manage sync and async messages and avoid text checksum errors & text frame miss
  • I also added a way to externally record an helper function for debugging (making easier to integrate with other debug system, like for esphome.io)

I hope it will be helpful

Best regards,
Philippe

@cterwilliger
Copy link
Owner

Interesting. I missed that there could be async messages interfering with text. However, the latest spec says this:
Firmware Asynchronous messages
1.53 Text messages not suppressed/delayed anymore due to hex requests. Now the text messages will always be sent
every 2 seconds. Furthermore, a response to a hex message will always wait until the text message finishes to be sent
(will not be interrupted in the middle of it as it was before).

Have you seen async messages still interrupt?

@cterwilliger
Copy link
Owner

my bad, crappy internet...

@cterwilliger cterwilliger reopened this Sep 8, 2022
@giacinti
Copy link
Author

giacinti commented Sep 9, 2022

I have noticed this effect on my MPPT which firmware has not been updated since a while (v139). This is a very basic version and I don't have the tools for updating. I guess there are plenty of devices with old firmware still in the wild which may experience the same side effect. Having it handled in the code could help.
Eventually implementing hex protocol was super helpful for me for modifying system parameters - for instance my MPPT was wrongly installed and automatically configured itself for 24v instead of 12v (it's in a RV). With hex protocol I could re-configure it just by sending an mqtt message :-)

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.

2 participants