RVR RaspberryPi 4 model B, Python 3.75, keyboard-control problem

Hello, Newbie here. I am using a Raspberry Pi 4 model B with Python 3.75 on my RVR. All setup completed successfully, I believe. Attempted to run the project keyboard_control and received what you see below. What is wrong? Help deeply appreciated. How do I figure it out?

Thanks, wmwinkle1

(sphero-sdk-raspberrypi-python) pi@raspberrypi:~/sphero-sdk-raspberrypi-python/projects/keyboard_control $ python drive_with_wasd_keys.py

Checking RVR firmware versions…

Traceback (most recent call last):

File “drive_with_wasd_keys.py”, line 22, in

loop

File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/toys/sphero_rvr_async.py”, line 36, in init

self._check_rvr_fw()

File “/usr/lib/python3.7/asyncio/base_events.py”, line 584, in run_until_complete

return future.result()

File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/firmware/rvr_fw_check_async.py”, line 26, in _check_rvr_fw

rvr_nordic_version = await self.__rvr.get_main_application_version(target=SpheroRvrTargets.primary.value, timeout=3)

File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/toys/sphero_rvr_async.py”, line 87, in get_main_application_version

return await self._dal.send_command(**command_dict)

File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/dal/serial_async_dal.py”, line 78, in send_command

timeout=timeout

File “/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/server/handler/api_sphero_handler.py”, line 191, in send_command

await asyncio.shield(asyncio.wait_for(future, timeout=timeout))

File “/usr/lib/python3.7/asyncio/tasks.py”, line 423, in wait_for

raise futures.TimeoutError()

concurrent.futures._base.TimeoutError

(

The futures.TimeoutError() exception being raised indicates RVR did not respond to the command to check firmware versions. Make sure that you have RX, TX, and GND connected properly between RVR and your Raspberry Pi. You’ll also need to make sure your UART is properly configured on the Pi.

Instructions can be found here. They’re not specific to the Pi 4, so there may be some additional configuration for the Pi UART and ensure that the scripts are using the correct TTY if it needs to be something other than the default. (This is set in the constructor of SerialAsyncDal and defaults to port_id='/dev/ttyS0')

Jim

Jim,

Thanks for your help. I have confirmed the wiring is correct from the Raspberry Pi to the RVR. Pi GPIO pin 8 txd to RVR rxd, and GPIO pin 10 rxd to RVR txd, pin14 - gnd to RVR gnd see photo attached.

I have enabled the serial communications from the Pi by:

  1. SSH into Pi
  2. enter sudo raspi-config
  3. select option 5 -interfacing
  4. select option P6-serial
    5 when asked,“Would you like a login shell to be accessible over serial?” -answered NO
  5. when asked," would you like the serial port hardware to be enabled?" -answered Yes
  6. Exit and reboot

On reboot enabled VM via pipenv shell successfully. Proceeded as below. Again your help appreciated

(sphero-sdk-raspberrypi-python) pi@raspberrypi:~/sphero-sdk-raspberrypi-python/projects/keyboard_control **python drive_with_wasd_keys.py** *Checking RVR firmware versions...* *Traceback (most recent call last):* *File "drive_with_wasd_keys.py", line 22, in <module>* *loop* *File "/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/toys/sphero_rvr_async.py", line 36, in __init__* *self._check_rvr_fw()* *File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete* *return future.result()* *File "/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/firmware/rvr_fw_check_async.py", line 26, in _check_rvr_fw* *rvr_nordic_version = await self.__rvr.get_main_application_version(target=SpheroRvrTargets.primary.value, timeout=3)* *File "/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/toys/sphero_rvr_async.py", line 87, in get_main_application_version* <i>return await self._dal.send_command(**command_dict)</i> *File "/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/client/dal/serial_async_dal.py", line 78, in send_command* *timeout=timeout* *File "/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/asyncio/server/handler/api_sphero_handler.py", line 191, in send_command* *await asyncio.shield(asyncio.wait_for(future, timeout=timeout))* *File "/usr/lib/python3.7/asyncio/tasks.py", line 423, in wait_for* *raise futures.TimeoutError()* *concurrent.futures._base.TimeoutError* *(sphero-sdk-raspberrypi-python) pi@raspberrypi:~/sphero-sdk-raspberrypi-python/projects/keyboard_control *

SPHERO Email Marketing -