I've found lots of posts about the YS1 locking up, and failing to transmit because it's left in an undefined state. (Due to design issues with the s/w on the YS1).
I created the following bash script (ys1reset.sh) to reset the YS1 device prior to transmitting. I thought you might want to incorporate something like this into your py code...
YS1V=1D50
YS1P=605B
FOUND=0
YS1V=$(echo "$YS1V" | tr '[:upper:]' '[:lower:]')
YS1P=$(echo "$YS1P" | tr '[:upper:]' '[:lower:]')
for X in /sys/bus/usb/devices/*; do
V=$(cat "$X/idVendor" 2>/dev/null | tr '[:upper:]' '[:lower:]')
P=$(cat "$X/idProduct" 2>/dev/null | tr '[:upper:]' '[:lower:]')
if [ "$V" == "$YS1V" ] ; then
FOUND=1
break
fi
done
if [ $FOUND -eq 1 ] ; then
echo "Reset USB device [$V] [$P] on $X"
echo "Done"
echo 0 > "$X/authorized"
echo 1 > "$X/authorized"
else
echo "Device not found"
fi
I've found lots of posts about the YS1 locking up, and failing to transmit because it's left in an undefined state. (Due to design issues with the s/w on the YS1).
I created the following bash script (ys1reset.sh) to reset the YS1 device prior to transmitting. I thought you might want to incorporate something like this into your py code...