-
Notifications
You must be signed in to change notification settings - Fork 123
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
RP2040: RX works, but always times out #111
Comments
In the meantime, what are supported chipsets to use the library with? I can compare the behavior between this and the RP2040. Thank you! |
Confirmed working on an Adafruit Grand Central M4 Express (SAMD51). This appears to be a RP2040 (raspberry pi pico) issue. Any ideas how to get it working on that particular platform, as it's quite common now? |
Hi @facchinm and @aentinger, hope you're doing well! From your perspective, any idea on how much work it would take to get the library running correctly on the RP2040? Thank you very much! |
Mostly well, thank you 🙇 I don't have any RS485 slave available, but I'll try and take a look into this, mkay? |
@aentinger great, thank you very much! |
Hi! I've started to use this library on raspberry pi pico with my custom board. There is half duplex rs485 and de pin and re pin is the same (gp18). In file pins_arduino.h I've defined another serial (Serial2) with my pins (gp16 and gp17) Edit: |
@martinez20m, very cool!! Thank you for the post. Would you mind sharing a gist or inline code of your actual changes? |
We'd also be taking a PR with both PIN definitions and other related changes 😁 🙇 . |
@martinez20m, hope you're doing well! Would you mind sharing some code, since you have this working on a RP2040? No worries if it's just informal snippets. Thank you! |
Hi @pomplesiegel, thanks, quite good;) Here are my changes: https://gist.github.com/martinez20m/2597dd791224aa96e883bbdbef6921ef |
Hi @pomplesiegel ☕ 👋 Did those files help you with your problem? If you've got any changes to extend this libraries support for RP2040, please feel free to contribute a PR 🙇 . |
Hi @martinez20m and @aentinger, thank you so much for your help! Indeed, these changes worked well.
Thankfully the only changes necessary are within RS485.h! However, this is a library dependency, so I'm not sure what the best approach is here... To address this:
#define RS485_DEFAULT_PRE_DELAY 100
#define RS485_DEFAULT_POST_DELAY 1000 Looking forward to your collective thoughts. Thank you again for finding the fix!! Thank you! |
Hello! Great library. I'm trying to get up and running on a RP2040 (raspberry pi pico) to make a very low cost solution using this library and RS485.
For hardware I am using:
I am able to successfully send commands from a host to the RP2040, but they always time out, even though the value is received by the node. This is the same whether we're talking about a holding register, coil, etc...
To simplify the debug process, below is MVP code to replicate the issue using this hardware:
When calling from a host (whether python or a GUI-based program like ModbusMechanic) the result is the same. My node can see the command from the host, but the response is never seen by the host. It always times out.
See resulting serial output from node below, when I send a 0, followed by a 1 for the coil value from a host to the node:
NOTE: to get the code to compile I had to change a couple default pin values within RS485.h, just because the RP2040 doesn't have an A5 or A6:
I'm wondering if this could be an issue with the software serial on the RP2040's compatibility with the library? Looking forward to others' thoughts!
Thank you!
Michael
The text was updated successfully, but these errors were encountered: