Closed Short-bus closed 5 months ago
received: motor status 20200101000016 altitude n 20200101000016 000.0nn0.1 3024 tmr
queueing (Q# 2): configure motor 20240203171249 altitude 0.0 0 90 0.0 -1 0.001 0.05 0.003 10 [15]
The above exchange shows that the RPi is receiving and understanding the microcontroller. The motorcontroller is sending motor status, the RPi understands this is an unconfigured motor so responds immediately with a configuration message. However all the followon status messages from the microcontroller continue to show an unconfigured motor, this suggests that the microcontroller is not receiving or processing the messages from the RPi properly.
The motor status messages include the 'tmr' status code, this indicates WHY the status message was sent. In the log file these are ALL 'tmr' which means the message is just a timed message. If the microcontroller was processing the configure motor messages correctly it responds immediately with a 'cfg' code instead of 'tmr'. This also suggests that the microcontroller is not actually processing the messages.
received: session status 20200101000053 n n n 47 0 tmr
queueing (Q# 1): set time 20240203171326 [24]
The above exchange shows a session status message from the microcontroller, it includes a timestamp - the timestamp is the default 2020.Jan.01 00:00:00 clock. The RPi responds with a 'set time' message to set the clock to the current time. However all the later messages from the microcontroller continue to show the unsynchronised clock. This also suggests that the microcontroller is not receiving or processing the messages.
If the microcontroller was completely crashing we would not receive any further messages. If the microcontroller was failing and restarting we would see repeated blocks of messages identifying a restart. Neither is occurring, so the problem is likely to be a non-fatal fault in the microcontroller processing. The most likely reasons being a break in the TX->RX line from the RPi to the microcontroller, or a function call failing on the microcontroller.
To see the precise detail the microcontroller was connected via a USB cable to the RPi and the serial shell output viewed through Thonny. It then was apparent that the microcontroller was running the wrong version of CircuitPython.
The code currently only works on CircuitPython7, the microcontroller was running CircuitPython8 which has syntax changes in the UART module. Downgrading the microcontroller to CircuitPython7.2 should solve the problem.
When the microcontroller first starts communicating it should pass information about the environment including some CircuitPython version information. This will be visible in the RPi log file, you can also trigger this to be resent by pressing the 'reset' button on the microcontroller to trigger a restart.
Later versions of the software compare the reported version number against a list of supported versions and leave a warning in the log file too.
The 2024-01-issues branch includes an updated version of circuitpython/code.py which now also runs on CircuitPython8.
Done.
There's a case where the UART communication log on the RPi looks OK. There are SEND and RECEIVE messages being logged between the RPi and the microcontroller. However the messages coming back from the microcontroller suggest that the RPi messages are not being handled properly by the microcontroller. eg: Motor configurations are sent, but the returned motor status does not show that the configuration has been set. eg: The 'set time' message is sent to the microcontroller, but the microcontroller messages do not show the synchronised time in the example messages seen. Is there a way to identify what is causing the problem?
Full log file probably needs checking for other error messages. Microcontroller could be hooked up to UART & USB so it can be monitored through the SHELL window in Thonny.
Original message: