-
Notifications
You must be signed in to change notification settings - Fork 29
Add support for MMDVM HATs #175
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
base: master
Are you sure you want to change the base?
Conversation
Bring the MMDVM driver code from <https://github.com/rwth-afu/UniPager/commits/mmdvm/> to the current up to date.
|
What I suspected might happen, is happening: This needs a bit of reworking to read the packet header, then read the byte values. At the moment it's not reading the whole version string from the MMDVM and this results in the command processing getting out of sync with the firmware on the HAT. |
* Major refactor to tidy up the protocol handling, remove magic
numbers, and improve (add) comments
* Consolidate response handling into read_result (including version
string).
* Use the length byte to read the rest of the packet (fixes issues
with truncated ACK/NACK/VERSION responses).
* Print the MMDVM version string in the logs on startup.
Collaboration with @ejmount / https://github.com/ejmount
|
This seems to have fixed the connection to the MMDVM, but it's against the v2 master branch. The issue is that there seem to be no public DAPNET servers - or rather the four servers in the default configuration file do not work. V1.0.3 currently connects but only one server (the last on the list) works. But that's still better than nothing! I'll look at backporting this to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. I don't know anything about the MMDVM specifics and my rust knowledge is a bit rusty, too but I didn't spot anything obvious. @dj7lc please check this as well.
The main issue I'm looking at (at the moment) is that messages longer than about 45 characters (usually around 47) end up corrupted or truncated. I'm not sure if this is a problem with my transmitter setup, my pager, MMDVM, UniPager or some combination thereof. I've been looking for a way to get UniPager's scheduler to not add the preamble rather than chopping it off in the driver, but I've found that code pretty hard to figure out. That said, there aren't many messages flying around which are that long. MMDVM specifics are, you send the messages in full batches to the MMDVM. If it wasn't previously transmitting, it'll prepend the preamble automatically then send the batch. If you keep the buffer full, it'll send continuously. |
Resolves #139
This is my attempt to bring the existing MMDVM codebase from the "mmdvm" branch up to date and get them working on my Raspberry Pi.
Transmit frequency is fixed. The existing code doesn't say to what or how it's calculated, I expect it's the standard 4
I've also improved the logging of NACKs, which now include a human-readable
Comments appreciated, there are probably a lot of improvements which could be made. I'm new to Rust so may be misunderstanding how the code works -- but it seems like reading the entire header then waiting for
<length>bytes of payload or a timeout would be better than blindly assuming it's already in the serial buffer.