troubleshooting.py conditions of failure and success
slowrunner opened this issue · 2 comments
Simply reporting issues I had trying the troubleshooting program.
After downloading the troubleshooting.py program:
wget https://raw.githubusercontent.com/iRobotEducation/create3_docs/brianabouchard/revised-question-template/.github/DISCUSSION_TEMPLATE/troubleshooting.py
Program asks for reboot - assumes user knows steps to reboot Create3
Program should explain how to reboot.
Operations with the power switch are a bit confused for me. Holding the power switch down until the LED ring goes dark is what I have been doing, (docs suggest 7 seconds will shut it to "storage mode"), but it has never been successful when the Create3 is in a 100% CPU usage condition. Some seconds after the LED ring goes dark, the bot wakes up, chimes and the logs show it has restarted the Create3 application.
Attempted execution fails for two reasons:
- Issue: program aborts when RMW_IMPLEMENTATION env var not set
- Assumption that iwgetid (wireless-tools) is installed causes program abort
Repairing both these issues in my environment allowed program to successfully complete
No RMW_IMPLEMENTATION env var:
pi@WaLiPi5:~/wali_pi5/systests/system_query $ python3 troubleshooting.py
This program will cross-check all relevant settings on your computer and robot to expedite troubleshooting. Please fully reboot the robot and wait for the start up chime before proceeding
Have you rebooted and waited for the chime? (Y/n) n
Have you rebooted and waited for the chime? (Y/n) y
Enter IP address of Robot: 10.0.0.xx
Testing Computer Configurations
Traceback (most recent call last):
File "/home/pi/wali_pi5/systests/system_query/troubleshooting.py", line 213, in <module>
computer_settings()
File "/home/pi/wali_pi5/systests/system_query/troubleshooting.py", line 51, in computer_settings
computer_rmw = os.environ['RMW_IMPLEMENTATION']
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "<frozen os>", line 679, in __getitem__
KeyError: 'RMW_IMPLEMENTATION'
Indeed printenv | grep RMW
shows the variable has not been set.
After executing
$ export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
pi@WaLiPi5:~/wali_pi5/systests/system_query $ printenv | grep RMW
RMW_IMPLEMENTATION=rmw_fastrtps_cpp
the environment variable will be found by the program
"iwgetid" is not installed in my container.
pi@WaLiPi5:~/wali_pi5/systests/system_query $ python3 troubleshooting.py
This program will cross-check all relevant settings on your computer and robot to expedite troubleshooting. Please fully reboot the robot and wait for the start up chime before proceeding
Have you rebooted and waited for the chime? (Y/n) y
Enter IP address of Robot: 10.0.0.xx
Testing Computer Configurations
Traceback (most recent call last):
File "/home/pi/wali_pi5/systests/system_query/troubleshooting.py", line 213, in <module>
computer_settings()
File "/home/pi/wali_pi5/systests/system_query/troubleshooting.py", line 57, in computer_settings
get_ssid = subprocess.run('iwgetid',capture_output=True)
File "/usr/lib/python3.10/subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'iwgetid'
Executing sudo apt update && sudo apt install -y wireless-tools
was successful, and allowed program to run successfully.
pi@WaLiPi5:~/wali_pi5/systests/system_query $ python3 troubleshooting.py
This program will cross-check all relevant settings on your computer and robot to expedite troubleshooting. Please fully reboot the robot and wait for the start up chime before proceeding
Have you rebooted and waited for the chime? (Y/n) y
Enter IP address of Robot: 10.0.0.xx
Testing Computer Configurations
Computer Linux Distro: Ubuntu 22.04.3 LTS
Computer ROS Distro: Humble
Computer RMW: rmw_fastrtps_cpp
Computer Wi-Fi Network: xxxxx
Computer Domain ID: 0
Testing Robot Configurations
Robot ROS Distro: Humble
Robot Firmware: H.2.4
Robot RMW: rmw_fastrtps_cpp
Robot Wi-Fi Network: xxxxx
Robot Domain ID: 0
Robot Namespace: None
Discovery Server: false
Summary of Troubleshooting Tests
ROS 2 and Linux Distribution Compatibility OK
ROS 2 Distribution Comparison: OK
ROS 2 Middleware (RMW) Comparison: OK
ROS 2 Domain ID Comparison: OK
Wi-Fi Connection:pi@WaLiPi5:~/wali_pi5/systests/system_query $
SUGGESTION: may be useful to know the processor architecture information
For curiosity I ran the troubleshooting.py successfully on the base Raspberry Pi OS (Bookworm) of my Pi 5:
pi@WaLiPi5:~/wali_pi5/systests/system_query $ uname -a
Linux WaLiPi5 6.1.0-rpi7-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
pi@WaLiPi5:~/wali_pi5/systests/system_query $ python3 troubleshooting.py
This program will cross-check all relevant settings on your computer and robot to expedite troubleshooting. Please fully reboot the robot and wait for the start up chime before proceeding
Have you rebooted and waited for the chime? (Y/n) y
Enter IP address of Robot: 10.0.0.67
Testing Computer Configurations
Computer Linux Distro: Debian GNU/Linux 12 (bookworm)
Computer ROS Distro: Humble
Computer RMW: rmw_fastrtps_cpp
Computer Wi-Fi Network: Media6586
Computer Domain ID: 0
Testing Robot Configurations
Robot ROS Distro: Humble
Robot Firmware: H.2.4
Robot RMW: rmw_fastrtps_cpp
Robot Wi-Fi Network: WIFI6586
Robot Domain ID: 0
Robot Namespace: None
Discovery Server: false
Summary of Troubleshooting Tests
ROS 2 and Linux Distribution Compatibility
WARNING! You computer is currently using a ROS 2 distribution
(Humble) that is not fully supported on
your computer's Linux distribution (Debian GNU/Linux 12 (bookworm)).
We recommend using Ubuntu 22.04 with ROS 2 Humble and Ubuntu 20.04 with
ROS 2 Galactic.
ROS 2 Distribution Comparison: OK
ROS 2 Middleware (RMW) Comparison: OK
ROS 2 Domain ID Comparison: OK
Hi @slowrunner! Thanks so much for doing this testing. I had not tested in a container assuming new/novice users were unlikely to be using one, but this is an important use case to test!
I appreciate the feedback on the rebooting. I will add that to the script.
Great point on the RMW environmental variable not being defined. This is certainly something that could happen and I should account for it and prevent the program from exiting as a result.
It sounds like the need to install wireless-tools was related to container usage is that correct? My goal with this script was to avoid users having to install any additional packages, but perhaps that isn't realistic in all configurations.
Yes, architecture is something I want to add among several other checks.
Thanks again! I'll post revisions when they're ready.
It sounds like the need to install wireless-tools was related to container usage is that correct?
Yes - I didn't install it when building the docker image, but installing it when running the image/container (with -y) worked well, and is gone whenever the container is restarted.
I searched for a different tool that might come installed with the Ubuntu base but wireless-tools seems to be the answer for getting the ESSID.
If you are going to have folks post their results - some may be concerned about having their ESSID and their IP repeated in the results. If the program finds the Create3 at the IP given, the actual value is probably not important. If the program finds the ESSID is consistent between controller and Create3, the actual value is probably not important, but if not consistent the user needs to know the actual ESSIDs so that conflict has to be included.