Problem with Pi4j 1.1

29 views
Skip to first unread message

Charles Godwin

unread,
Aug 26, 2018, 5:46:18 PM8/26/18
to Pi4J
I have a problem with the version 1.1

I was using pi4j-1.0-SNAPSHOT for years to read a USB/RS485 device. It's a Magnum Energy system that sends packets of bytes and the packets size is identified by a pause in the data stream. Using the older version, I was able to read a character at a time and the delay between packets was reliably measurable.

I have just upgraded to 1.1 and the old read() method to return a character is gone. I have attempted other routines but I'm not getting any measurable delay between characters. I suspect that the software is buffering everything nd the delays are being washed out.

The old, working, code is attached.

I don't know of any other way to read this data as it's poorly structure and delay between packets, which provides message length, was the only reliable method to decipher the messages.

Or... i'm missing something obvious in the protocol or use of the Pi4j API.

Any suggestions anyone can offer would be appreciated. 

This link will provide a description of the methodology used.

http://static.us-inverters.com/docs/support/Magnum-Networking-Communications-Protocol-%282009-10-15%29.pdf
TestRS485Bytes.java

Robert Savage

unread,
Aug 27, 2018, 12:33:04 PM8/27/18
to Pi4J
Hi Charles,

Yes, in 1.1 the serial interfaces were changed to provide better support for a standardized interface which includes buffering, eventing, etc. 

You could try the older WiringPi interfaces (which are still included) to access the serial port and data -- they still include a method to return a single byte and should perform similar to the older Pi4J serial impl.  

SEE:

You may also want to upgrade to version 1.2-SNAPSHOT if you need compatibility with the latest RPI hardware boards.

Thanks, Robert

Charles Godwin

unread,
Aug 27, 2018, 12:36:24 PM8/27/18
to Robert Savage, Pi4J

Thanks for the help. I’ll try this.

--
You received this message because you are subscribed to the Google Groups "Pi4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pi4j+uns...@googlegroups.com.
Visit this group at https://groups.google.com/group/pi4j.
To view this discussion on the web visit https://groups.google.com/d/msgid/pi4j/944d3d1a-8277-4661-bc39-cbf4a767e030%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages