I am continuing my EZ-scripts to Python conversion and I have begin to work on my Roomba robot.
All my command work with the EZ-scripts, but some of them don't with Python. I have in particular some difficulties with the reading of UART data.
Here are some part of scripts used to identify the Roomba working mode:
uartinit(0, 1, 115200) #have to have this to clear the buffer
uartWrite(0,1,142) # Mode check
uartWrite(0,1,35) # Mode check
$rx = UartAvailable(0, 1)
$rxdata = UARTRead(0, 1, $rx)
print( $rxdata )
With this script, I am able to print $rxdata and then the rest of the script continues normally.
UART.InitHardwareUart(1, 115200) #have to have this to clear the buffer
UART.HardwareUartWrite(1,142) # Mode check 1
UART.HardwareUartWrite(1,35) # Mode check 2
rxdata = 0
rx = UART.HardwareUartAvailable(1)
if rx == 1:
rxdata = UART.HardwareUartRead(1,rx)
With this script, i am unable to print rxdata and the console prints "Not connected" instead (and the script stop).
So, it seems that UART.HardwareUartRead does not behave like UARTRead (when UART.InitHardwareUart, UART.HardwareUartWrite and UART.HardwareUartAvailable behave as expected like their EZ-scripts equivalents).
Did I missed something ?
(By the way, the link to the Roomba manual page (https://synthiam.com/Software/Manual/Roomba-Movement-Panel-16116) does not seems to be active anymore)