Comments (10)
I should provide expected length to read from serial port for each command.
What if you put time.Sleep(300 * time.Millisecond)
before syscall.Select (serial_linux.go:123), will you have full response data?
from modbus.
@nqv: Thank you very much. If I insert a sleep time, I can correctly receive the data (and the data is also correctly decoded, see my last commit). I guess that you can determine the sleep time from the baudrate and the expected response length.
from modbus.
@gonium Thanks. I'll fix this issue as you have suggested.
from modbus.
@gonium Thanks for your pull request, I believe the issue has been fixed. I'd be grateful if you can test and let me know if it works with your device.
You also need to run go get -u github.com/goburrow/modbus
to also download github.com/goburrow/serial as I move the serial part to another repository.
Thanks
from modbus.
@nqv I just switched from my temporary fork back to your master - now everything works as expected. Please note that I am currently using the SDM630 device in its factory settings: 9600 8N1. I didn't test higher baud rates.
Thank you very much for your help! Closing this for now.
from modbus.
@gonium How to connect Pi to TTL to 485 Converter?
from modbus.
Hi @arnavbansal95, I prefer using cheap (as in 3 USD) USB-to-RS485 converters. If you really need to connect directly to the extension header of your RPi you can have a look at the schematics of this Sparkfun RS485 shield.
from modbus.
@gonium Thanks ....I also got a Usb to 485 converter....but I don't know how to install its driver on raspian as I am new to linux....could you help me with that?
from modbus.
@gonium how you did sleep thing to to read energy meter??
from modbus.
@gonium i am also working on it but didn't get the result. Can you give me some help that how you send query?
from modbus.
Related Issues (20)
- Error: response transaction id does not match request HOT 2
- Use of the library with Raspberry Pi 3 and a MAX13487E that has AutoDirection Control HOT 1
- reading of holding register limited to 125 bytes HOT 3
- illegal function HOT 1
- Is there something like keep alive flag?
- golang >v.1.16.3 couldn't find package serial
- Write registers in parallel over tcp HOT 1
- write negative value. HOT 1
- Error "too many open files" on ReadHoldingRegisters for RTUClient HOT 1
- SYS_IOCTL (RS485): inappropriate ioctl for device HOT 1
- Why serial: timeout HOT 1
- WriteSingleRegister time out, though Python code works HOT 2
- About the functionFail
- How to tell if server closes the connection?
- Interface{} to modbus-compatible slice conversion
- panic due to concurrent closeIdle and Send()
- Modbus read velocity
- protocol error' on CentOS7 Ubantu20.04
- parity bit not working
- The ReadCoils method returned a value that was not expected
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 modbus.