Python asyncio issues

I’m having a hard time getting anything using Python asyncio to work. Notifications are a hit or miss, mostly miss. For example, when I try drive_to_position_normalized, sometimes it does just one leg, sometimes 2, sometimes, 3. I never saw it completing the path and most of the time it stops on the first leg.

python3 drive_to_position_normalized.py
Registering async
Driving to (0,0.5) at -90 degrees
Move completed, response: {‘success’: True}
Driving to (0.5,0.5) at -180 degrees
Move completed, response: {‘success’: True}
Driving to (0.5,0) at 90 degrees

I enabled logging to syslog and see the error below quite frequently:

Sep 20 12:18:45 pi-rvr npm[627]: {“message”:"API-PARSER >> Generated API message: ",“level”:“debug”}
Sep 20 12:18:45 pi-rvr npm[627]: {“message”:"API-PARSER >> API message parsed: ",“level”:“debug”}
Sep 20 12:18:45 pi-rvr npm[627]: {“message”:"API-DAL-UART >> Data bytes: ",“level”:“debug”}
Sep 20 12:23:10 pi-rvr npm[627]: {“message”:“API-DAL-UART >> Received bytes: 0x8D”,“level”:“debug”}
Sep 20 12:23:10 pi-rvr npm[627]: {“message”:“API-PARSER >> Queuing bytes: 0x8D”,“level”:“debug”}
Sep 20 12:23:13 pi-rvr npm[627]: {“message”:“API-DAL-UART >> Received bytes: 0x8D”,“level”:“debug”}
Sep 20 12:23:13 pi-rvr npm[627]: {“message”:“API-PARSER >> Queuing bytes: 0x8D”,“level”:“debug”}
Sep 20 12:23:13 pi-rvr npm[627]: {“message”:“API-PARSER >> API protocol error: Early Start of Packet (3)”,“level”:“error”}
Sep 20 12:23:13 pi-rvr npm[627]: {“message”:“API-DAL-UART >> API Protocol Error: ‘Early Start of Packet’ (3)”,“level”:“error”}
Sep 20 12:23:13 pi-rvr npm[627]: {“message”:“API-PARSER >> Resetting parser state”,“level”:“debug”}

My environment:

  • Raspberry Pi3+
  • Python 3.7.3
  • Raspian Buster (my own image)
  • Latest Python SDK installed.

Never mind, I found the issue. I had two NodeJS apps configured to start at the boot to serv up some aggregated RVR functionality as REST APIs. Although I was not using them, probably one or more of the init calls in them were causing components to keep pooling the RVR HW, interfering with my standalone Python tests. The problem disappeared as soon as I took the web servers down.

Regards,
Luiz

SPHERO Email Marketing -