Thursday, 15 May 2014

serial port - Raspberry Pi data logger for SDI-12 ussing python -



serial port - Raspberry Pi data logger for SDI-12 ussing python -

ive been working on raspberry pi scheme while. still having problem couple of sensors. trying command scientific sensor using sdi-12 commands , settings.

first using standard of baud of 1200, 7 info bits, 1 parity bit (even parity) , 1 stop bit.

##### #pyserial python library import serial ##### import time ##### #sonde name of sensor sonde=serial.serial('/dev/ttyusb0') sonde.parity=serial.parity_even sonde.bytesize=serial.sevenbits sonde.stopbits=serial.stopbits_one sonde.baudrate=1200 ##### # devices take while respond, standard mentioned # in devices manual. sonde.timeout=30 sonde.break(12000) ##### # devices address 0 sonde.write('0i!') ##### # wait 30 seconds before reading sensor time.sleep(30) line in sonde: print(line) print('\n')

all of in accordance standard except sdi-12 uses 1 start bit pyserial not have field that. should taking business relationship in other way?

the device has manufacture provided wiring harness converts sdi-12 wiring rs-232. have been connecting device pi standard serial usb adapter has functioned other sensors.

when run code on pi terminal display characters or symbols know incorrect. first thought there might issue baud rate off have tried used baud rates.

im not sure next besides seek many more settings not part of sdi-12 standard. using carriage homecoming ('\r'), new line ('\n') or combination of 2 ('\r\n') has made no difference in responses.

what should can see proper response command , not gibberish?

serial-port pyserial sdi-12

No comments:

Post a Comment