We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have created a simple server and client apps:
https://github.com/simpleiot/simpleiot/blob/feature-modbus/cmd/modbus-client/main.go
https://github.com/simpleiot/simpleiot/blob/feature-modbus/cmd/modbus-server/main.go
When I send a packet to the server, it only ever receives one byte.
What causes the the Read() at this location:
https://github.com/tbrandon/mbserver/blob/master/servertu.go#L26
func (s *Server) acceptSerialRequests(port serial.Port) { for { buffer := make([]byte, 512) bytesRead, err := port.Read(buffer) if err != nil { if err != io.EOF { log.Printf("serial read error %v\n", err) } return } if bytesRead != 0 { // Set the length of the packet to the number of read bytes. packet := buffer[:bytesRead] frame, err := NewRTUFrame(packet) if err != nil { log.Printf("bad serial frame error %v\n", err) return } request := &Request{port, frame} s.requestChan <- request } } }
To read an entire packet, instead of just several bytes?
Thanks, Cliff
The text was updated successfully, but these errors were encountered:
closing this as this project appears to not be maintained. I started a new modbus library that will implement both client and server functionality:
https://github.com/simpleiot/simpleiot/tree/master/modbus
Examples:
https://github.com/simpleiot/simpleiot/blob/master/modbus/rtu-end-to-end_test.go https://github.com/simpleiot/simpleiot/blob/master/cmd/modbus-client/main.go https://github.com/simpleiot/simpleiot/blob/master/cmd/modbus-server/main.go
Sorry, something went wrong.
No branches or pull requests
I have created a simple server and client apps:
https://github.com/simpleiot/simpleiot/blob/feature-modbus/cmd/modbus-client/main.go
https://github.com/simpleiot/simpleiot/blob/feature-modbus/cmd/modbus-server/main.go
When I send a packet to the server, it only ever receives one byte.
What causes the the Read() at this location:
https://github.com/tbrandon/mbserver/blob/master/servertu.go#L26
To read an entire packet, instead of just several bytes?
Thanks,
Cliff
The text was updated successfully, but these errors were encountered: