On my Digi Connect EZ Mini, I’m attempting to access the serial port on the device with a Python script. I’ve replaced the usual script I use with a basic one that connects to the port and reads/writes data in a loop every second. On the 24.6.16.64 firmware, this works just fine, but after upgrading to 24.9.79.151, no data is being sent or received even though the initial opening of the port appears to be successful. I’ve ensured that all relevant configuration options are the same on both versions, and the firmware versions come with the exact same version of Python installed (3.10.13). Anyone else having similar issues?
Here is the script I’m using which works on 24.6 but not on 24.9. Both versions print the “Serial connection successful” message, but data only appears on 24.6.
#!/usr/bin/env python
import serial
import sys
import timetry:
serial_connection = serial.Serial(‘/dev/serial/port1’, (9600), timeout=0.5)
print(‘Serial connection successful’)
except:
print(‘Failed to create serial connection’)
sys.exit()while True:
try:
data = serial_connection.read(512).decode(‘unicode-escape’)
serial_connection.write(b’write test\r\n’)
if data != ‘’:
print(str(data))
except:
print(‘Failed to read from serial port’)
sys.exit()
time.sleep(1)