Comments (4)
I had the same problem using the MKR 1310 with the RS485 shield when powering it trough the RS485 shield. Apparently the MKR 1310's BQ24195L needs to be configured in such a way to generate 5V on the 5V pin for the shield to work. I wasn't able to do this but the shield makes a beautiful 5V on the Vin pin. For now I jumper the Vin and 5V pins and communication keeps going without the USB connected.
I don't know why you cannot debug over USB though, I don't have a problem doing so. Did you increase the baudrate? I'm using Serial.begin(115200);
and ModbusRTUClient.begin(19200, SERIAL_8N2);
What I do notice is a delay is needed after writing or reading registers. I'm using 4 ms. But that can be because of my nodes. Anyone else has the same experience?
To bad ModbusRTUClient.setTimeout is not available yet in the latest version in the Library. Instead I adjusted ModbusRTUClient.cpp:
modbus_set_response_timeout(mb, 0, 5000);
Be careful, the third parameter of modbus_set_response_timeout
is microseconds. So 5000 means 5 milliseconds.
from arduinomodbus.
Ahh I see it's a SAMD21G based board. They're unusually picky about SerialUSB.. It's really hard to see what is going on truely without a debugger like a Atmel-ICE...
First off I'd look at lowering the super long 1 second timeout in the library so a much more sensible number... I chose 5ms, a sensible timeout for modbus operating at 56700bps. 1 second is way too long.
ModbusRTUClient.setTimeout(5); //large timeouts need to be avoided
RS485.setTimeout(5);
MODBUS_PORT.begin(57600);
ModbusRTUClient.begin(57600);
from arduinomodbus.
@vri-sst I know this is probably not the place to request help but I see from your response that you've been using the MKR1010 and an MKR485 shield and successfully reading/writing the holding registers. I am trying to do the same using the Arduino as a Modbus Server. I have used the "kitchen sink" example but I cannot read the holding registers that are setup in the example from the Arduino. I have no issue reading coils when using the "LED" example which sets up coils. Any help or pointing in the right direction would be much appreciated.
from arduinomodbus.
This same issue appears with the MKR1400 when powering it through the MKR RS485 shield. Following @engeen-nl 's suggestion to put a jumper between 5V and Vin is an interim workaround. However, when powering the modules through the attached LiPo accumulator, the RS485 shield will not respond either.
The only two cases I identified where RS485 works as expected is when the MKR1400 is powered through USB or when it is powered through the screw connector on the RS485 shield with 5V and Vin connected to each other.
from arduinomodbus.
Related Issues (20)
- Broadcast transmission blocks for TIMEOUT ms
- Add support for UNO R4 WiFi board HOT 1
- Documentation of return values in ModbusServer.h and Arduino Reference does not match source code
- Porting ArduinoModbus Library to Raspberry Pi Pico without Arduino Core HOT 1
- Modbus RTU over TCP Support for Arduino Opta HOT 1
- Question about directly accessing holding register data array via union
- Larger reads sometimes time out at slower baud rates on RP2040 HOT 10
- Not able to read Holding registers more than 15. RX Buffer issue? HOT 6
- Incorrect conversion of seconds and micro seconds to milliseconds HOT 1
- Not able to decode ModbusTCPServer.Poll(); function to get the Function code for read or write Operation.
- Documentation Check HOT 1
- Race condition: ModbusRTUServer.begin() sometimes quietly rejects config
- Add support for Modbus RTU over UDP HOT 2
- How to remove useless PINs in RS485? HOT 1
- Programming issue? timeout without delay within the code HOT 2
- Does this library support Modbus TCP Security?
- Arduino modbus keywords sample codes requset HOT 1
- Clarification regarding RS485 PORT HOT 1
- Modbus TCP Master AND Modbus RTU master - At the same time ?
- ModbusClient.requestFrom() crashes Finder Opta if id > 247
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinomodbus.