April 17, 2020 at 02:10 #15602
I have to run the M64 acoustic modem by a microcontroller (STM32) in which I cannot use Python. Are there any libraries and code examples in C or C++ for Water Linked modems I can use? Or, can I run the wlmodem library in MicroPython instead of Python 3?April 17, 2020 at 07:30 #15603
We haven’t tested the Python library on MicroPython, so I have no idea if it will actually work.
The Python library has some fancy functionality which might not be needed in your application.
You can actually communicate using the modems by typing the commands in a serial terminal directly.
If you type the protocol example commands manually you should be able to get communication going:
Implementing the basic communication functionality should be fairly straight forward.
I suggest ignoring the checksum to simplify the code (the checksum can be used to detect bit errors on UART but is not required)
Setting configuration (channel, role) is persistent so you can set that manually in advance of using the modems.
So the what you need to get the basic functionality working is:
– Implement sending data. Ie. sending ‘wcq,8,’ then exactly 8 data bytes and then newline (‘\n’)
– Implement reading packets back. Ie checking that the line you receive starts with ‘wrp,8,’. The next 8 bytes are the payload)
Full protocol documentation is here:
https://waterlinked.github.io/docs/modems/modem-m64-protocol/April 17, 2020 at 19:26 #15615
Thanks! This really helps! If I did not want to do it manually and wanted to write a code in any language, I guess I just need to write/read to the serial port the same commands in the same format as they are listed in that table, am I right? E.g. if I am using an Arduino and wanted to check the Modem-M64 serial protocol version, I would write: Serial.print(“wcv”)?April 17, 2020 at 19:29 #15616
Yes, you can use the same as the table.
Your example is almost correct, you need to include a newline too. So you would write: Serial.print(“wcv\n”)April 17, 2020 at 19:38 #15617
Thanks a lot! Will start a code from scratch then. I agree it might be better for my application without the wlmodem library. If you have any similar examples built without it and you can share with me I would really appreciate it. Thanks once again.April 17, 2020 at 19:46 #15618
No problem! Unfortunately we don’t have any examples using C available. If you would be willing to share the code you implement (on github or similar) I’m sure others would be thankful.April 17, 2020 at 19:49 #15619
Sure! Will do when it is done. ThanksJuly 1, 2020 at 07:59 #15916July 2, 2020 at 00:22 #15925
This really helps! Thanks!
You must be logged in to reply to this topic. Not a member yet? Registere here!