serial usb communication of smart meter

150 views
Skip to first unread message

Edwin Biemond

unread,
May 21, 2013, 3:56:15 PM5/21/13
to pi...@googlegroups.com
Hi, 

I am now using python serial to read my gas/elec smartmeter with these python settings and now I want to use pi4j but the response contains a lot of ?

#Set COM port config

ser = serial.Serial()
ser.baudrate = 9600
ser.bytesize=serial.SEVENBITS
ser.parity=serial.PARITY_EVEN
ser.stopbits=serial.STOPBITS_ONE
ser.xonxoff=0
ser.rtscts=0
ser.timeout=20
ser.port="/dev/ttyUSB0"

with python
/ISk5\2ME382-1003
0-0:96.1.1(4B414C37303035313039373534393132)

with pi4j
??S?5\?M?3??-?003?
0-0:96.?.?(?B????3?3030353?30393?353?393?3???

I don't see any options how to change the communication options

Thanks


Robert Savage

unread,
May 25, 2013, 4:46:57 PM5/25/13
to Edwin Biemond, pi...@googlegroups.com
Hi Edwin,

Unfortunately there is not a current means to change the parity (EVEN) and data bits (7) in the Pi4J library.
There is an open feature request to add support for this : https://github.com/Pi4J/pi4j/issues/12
But it is not implemented at this time.

The alternative would be to use the RXTX Java library for Raspberry Pi.  I have not implemented this myself, but I believe others have successfully used it. 
RXTX is perhaps the most popular serial communication library for Java programming on Windows, Linux, and other platforms.

Thank You,
Robert





--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages