I have a TX1 (R24.2.1) with ASG003, and I want to use Range Sensor named ‘SF11’
( Product manual : https://acroname.com/sites/default/files/assets/sf11_-laser_altimeter_manual-_rev_6.pdf )
That sensor can communicate with UART serial.
So I connected range sensor with ‘CP210x uart to usb converter’. I built the cp210x driver with reference to http://elinux.org/Jetson/Tutorials/Program_An_Arduino#FTDI_kernel_module.
SF11 range sensor sends encoded ASCII characters which meaning range information (7byte) every 0.05sec (20Hz) through serial communication.
The serial setting is : baud 115200, no parity, 8 data bits, 1 stop bits, no handshaking.
And this is the test code made with Python 3. Recording the time when data has received.
import serial import time class RANGE(): adr='/dev/ttyUSB0' self.ser = serial.Serial(adr, 115200) self.data=None def processdata(self): readbyte=self.ser.inWaiting() if readbyte>0: #When data received self.data=str(time.time())+self.ser.readline().decode() #Time tagging on data else: self.data=None if __name__ == '__main__' : RANGE=RANGE() f = open('sf11.txt', 'w') print("Laser Range Finder DAQ Start") d= try: while True: RANGE.processdata() #do something if RANGE.data: d.append(RANGE.data) #Storing data except KeyboardInterrupt: for i in range(len(d)): #Saving data before exiting script f.write(d[i]) RANGE.ser.close() f.close()
And this is the plot of the Reading frequency. Calculated with 1/(current timetag - previous timetag). Testing time is 800s.
Most of the values stay near 20Hz, but you can see these 4 lines down to 10Hz. The spacing between each line is exactly 120 seconds. This happens not always, but often.
I tested the same code on Windows and Linux Desktop, but this issue happens only on TX1.
And the similar problems also come up not only cp210x but FTDI serial converter.
So I think that every reading performance drops every 2 minutes.
To solve this problem, what should I check? Have any similar symptoms been reported?
Thanks in advance.