@György-Farkas that did the trick, it works via the rs232 TTL converter. I never even considered the voltage before. Thank you!
Posts made by James Penick
-
RE: Omega2+ serial not working as expected
-
RE: Omega2+ serial not working as expected
Oh, cool! I'll give that a shot and report back. Thank you!
-
RE: Omega2+ serial not working as expected
@György-Farkas I bought the Sabrent CB-FTDI, and use it to connect both the laptop to the receiver and to connect the omega2+ to the receiver in lieu of the onboard serial.
-
RE: Omega2+ serial not working as expected
@György-Farkas sure, it's this: https://www.rainharvest.com/aquatel-d110-s-wireless-tank-level-monitor-with-rs-232-interface.asp
receivers are placed on each tank to measure the water level with ultrasonic pulses. The level data is sent back to a little receiver station that has an RS232 port on it. My goal is to take that data and ship it off to something like amazon IOT so I can check the water level from my phone without having to go look at the display on the device.
-
RE: Omega2+ serial not working as expected
That's a good idea, I might play with doing that.. Or i can look into doing one that ties into some GPIO pins.
Of course, it'd be nice if we could all just use one of the two rs232 interfaces already on the darn device.
-
RE: Omega2+ serial not working as expected
msg sent
continuing the saga for the edification of anyone else interested. I tried a USB to serial adaptor with the FTDI FT232RL chipset. It's a sabrent so I guess it's not a counterfeit?
The cable worked fine from my laptop to the device I was querying. Attaching it to my onion showed things working better than the onboard UART, but I still saw corrupted data.
I realized that omega had python2 installed, so I installed python3, and then things worked fine. No idea why, as that doesn't make sense. But whatever, it works so i'll call it good enough.
I'm pretty frustrated that the omega2+ onboard UART doesn't work right, but I don't know how to debug that any further
-
RE: Omega2+ serial not working as expected
@JP-Norair said in Omega2+ serial not working as expected:
So i'm not the only one, and i'm not crazy.. that's good at least.
Looking at all the diagnostics you've run I'm guessing the python library must be making some calls that run afoul of the bug in the UART driver. in my case I can use a USB to serial adapter with my device, but broken serial drivers seriously impairs what I had planned to use these for. That's frustrating.
-
Omega2+ serial not working as expected
Hey folks,
I'm trying to connect my Omega2+ to a wireless water tank measurement system so I can check the tank water levels from my phone without having to go look at display on little receiver. There's a serial port on the receiver with a very simple API. I've written a script to grab the data, however I'm having trouble actually getting the serial connection from the omega to talk to the receiver. I get either nothing, or a bunch of garbage characters coming back.If I connect my laptop to the receiver with a USB to serial adapter, my script works fine, and I get the data I expect. However it doesn't work on the Omega2+
I'm using python3 and the pyserial library, connecting at 9600 baud. Is there something i'm missing here?
I've tried two different Omega2's, the power dock, and the arduino dock. Same behavior regardless of the combination, so I don't think it's them. The Omega's are from feb 2017, and I just updated their firmware to the latest available.
the code is below, in case it's relevant:
The code:
#!/usr/bin/pythonimport binascii
import serial
import timeser = serial.Serial(port='/dev/ttyS1',
baudrate=9600,
timeout=None,
xonxoff=False,
rtscts=False,
dsrdtr=False,
parity=serial.PARITY_NONE,
bytesize=serial.EIGHTBITS,
stopbits=serial.STOPBITS_ONE) # open serial port
i = 0
while True:
#the following request asks the receiver to return the data for the first tank:
send_bytes = serial.to_bytes([0x02,0x01,0x01,0x0D])
print("Sending: ", send_bytes)
ser.write(send_bytes)
readbyte = ser.read(1)
i += 1
#the next two conditionals are to deal with garbage chars
if readbyte == serial.to_bytes([0x00]):
print("I got a zero..")
continue
if readbyte != serial.to_bytes([0x02]):
print("I read this unexpected byte: %d",readbyte)
else:
#looks like we found a message
tankID,sequence,tankLevel,RSSI,temp,battery,Alarm,endbit = ser.read(8)
print("tankID" , tankID)
print("sequence" , sequence)
print("tankLevel" , tankLevel)
print("RSSI" , RSSI)
print("temp" , temp)
print("battery" , battery)
print("Alarm" , Alarm)
print("endbit" , endbit)
time.sleep(5)ser.close() # close port