-
Notifications
You must be signed in to change notification settings - Fork 34
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
Trying to add support for XS-WSDS01 Modbus RS-485 wind sensor #94
Comments
Why do you try to change the core? |
I try to get away without it, but I don't want to reinvent the bicycle and I can see the serial ports being instantiated, meaning I need to instantiate a different implementation of serial port handling. That happens in GwChannelList, and that's the only core file that I ended up changing. All this sensor requires is a tiny layer of translation between modbus and NMEA, so re-implementing pretty much all the machinery in GwSerial seems an overkill. How would you implement a modbus translator to NMEA without changing the core and without duplicating loads of good code that is already written for buffering and error handling? Thank you! |
I don't think that it is that complicated |
Browsed through the code and docs - I think I know what you mean. Let me redo. |
I think you meant something like this: https://github.com/maksyms/esp32-nmea2000/tree/windsensormodbustask/lib/windsensormodbustask Basically:
The log says something like:
Note the txtimeout there.
This is my second ever ESP32 project (the first one was using ESPHome for some radio control device), so I'm far from being an expert in Arduino. Thanks a lot for your help! |
Hmm - a couple of different issues. |
I've got it working by changing GwChannelList.cpp to instantiate a different class (GwSerialModbusTask instead of GwSerial)- until pulling the upstream, where all of the serial handling is reworked.
Hence, I have an ask: is it possible to provide the ability to convert whatever I read (after writing) from the serial port into NMEA0183 message for further multiplexing? Here is how I implemented it in the older version of GwSerial: maksyms@f4f56bc#diff-eae4d82b3db7401fa727ce27d1d8d1d24a2ff3119c0c8dfdb0d40e7b0e93e287R125
And it worked fine, but now I need to re-think how to provide my own implementation of serial translation layer.
The text was updated successfully, but these errors were encountered: