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

Problems with softwareSerial #7

Open
lonconao opened this issue Jul 16, 2024 · 0 comments
Open

Problems with softwareSerial #7

lonconao opened this issue Jul 16, 2024 · 0 comments

Comments

@lonconao
Copy link

lonconao commented Jul 16, 2024

Hello, i've had some problems using this lib with softwareserial. When i use hardwareserial no problems using libmodbus in PC side, but now, i trying access to some Iregs on ATMEGA328p with minicore (3 MHz) i cannot obtain any response from unit. For now, i have not a osciloscope for view physical port, but RE/DE pin (4 in my case) never change of state (measuring with DMM). Is possible use this library with SoftwareSerial? When use in normal way (sending strings) i don't have any problem reading data with Coolterm o any serial emulator, no data is displayed only using modbus lib in microcontroller

EDIT: I solved problem. Seems related to a custom serial flush function that unsynchronize request from master. But i have another question. If i try to define modbus regs as

const uint16_t reg1=100, reg2=101, reg3=102..., etc. server throws a error "illegal data address", but if i assign direct in object.addIreg (100, value); works properly. Any idea? Maybe uint16_t reg = 0, reg1 = 1... is the problem?

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

No branches or pull requests

1 participant