Working on raspberry with Arduino connected over USB. Communicating over python with minimalmodbus library Trying to make reconnection when Arduino was unplugged for a while. I tried to repeat the connection code again on error, didn't helped. Is there any function to reconnect on the serial connection lost?
minimalmodbus.baudrate = 9600
instr = minimalmodbus.Instrument('COM5', 1)
instr.serial.baudrate=9600
instr.debug=False