Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: This module can only be run on a Raspberry Pi! RPi._GPIO . Jetson Nano #998

Closed
c1505 opened this issue Mar 21, 2022 · 1 comment

Comments

@c1505
Copy link

c1505 commented Mar 21, 2022

Issue Description

If you upgrade from the last release to the recent one, there is an error that prevents calibration or running the car on the jetson nano. This shouldn't be a problem for people who are coming from a completely fresh setup or those that were are upgrading from something after December 11th when RPi.GPIO was removed as a dependency for the nano https://github.com/autorope/donkeycar/pull/964/files .

configurations affected

software

  • donkeycar 4.3.6 release
  • donkeycar main branch. latest commit 58979613c723aadf6b2fa98b4a43743e18ab1641
  • donkeycar main branch. possibly all commits after d5b91301ff904873e70b9caba72823fe3454feb6

hardware

  • jetson nano

Steps to reproduce the issue

  • Jetson nano setup as described in docs before the recent release(Install from master rather than main)
git checkout master
pip3 install -e .[nano]    
  • Upgrade to the recent release
git checkout tags/4.3.6
pip3 install -e .[nano] 
  • Create a new car or upgrade an existing car
  • Run calibration or drive

What's the expected result?

  • can calibrate car
  • can drive car

What's the actual result?

  • error message for calibration
  • error message for drive

Additional details / error messages

(env) jetbot@jetbot:~/21mar_release_test$ donkey calibrate --channel 1 --bus=1
________             ______                   _________              
___  __ \_______________  /___________  __    __  ____/_____ ________
__  / / /  __ \_  __ \_  //_/  _ \_  / / /    _  /    _  __ `/_  ___/
_  /_/ // /_/ /  / / /  ,<  /  __/  /_/ /     / /___  / /_/ /_  /    
/_____/ \____//_/ /_//_/|_| \___/_\__, /      \____/  \__,_/ /_/     
                                 /____/                              

using donkey v4.3.6 ...
Traceback (most recent call last):
  File "/home/jetbot/env/bin/donkey", line 33, in <module>
    sys.exit(load_entry_point('donkeycar', 'console_scripts', 'donkey')())
  File "/home/jetbot/projects/donkeycar/donkeycar/management/base.py", line 614, in execute_from_command_line
    c.run(args[2:])
  File "/home/jetbot/projects/donkeycar/donkeycar/management/base.py", line 239, in run
    from donkeycar.parts.actuator import PCA9685
  File "/home/jetbot/projects/donkeycar/donkeycar/parts/actuator.py", line 13, in <module>
    from donkeycar.parts.pins import OutputPin, PwmPin, PinState
  File "/home/jetbot/projects/donkeycar/donkeycar/parts/pins.py", line 397, in <module>
    import RPi.GPIO as GPIO
  File "/home/jetbot/env/lib/python3.6/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

Possible solutions

@Ezward
Copy link
Contributor

Ezward commented Jul 13, 2022

If you are on a nano and you have this bug the workaround is to pip uninstall RPi.GPIO and pip install Jetson.GPIO. This is fixed in latest main (4.3.19). Pi install RPi.GPIO, nano installs Jetson.GPIO.

      extras_require={
          'pi': [
              'picamera',
              'Adafruit_PCA9685',
              'adafruit-circuitpython-lis3dh',
              'adafruit-circuitpython-ssd1306',
              'adafruit-circuitpython-rplidar',
              'RPi.GPIO',
              'imgaug'
          ],
          'nano': [
              'Adafruit_PCA9685',
              'adafruit-circuitpython-lis3dh',
              'adafruit-circuitpython-ssd1306',
              'adafruit-circuitpython-rplidar',
              'Jetson.GPIO',
          ],

@Ezward Ezward closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants