guyc / py-gaugette

Python library to support building hardware gadgets with the Raspberry Pi and BeagleBone Black
http://guy.carpenter.id.au/gaugette/
GNU Lesser General Public License v3.0
121 stars 44 forks source link

jetson nano (NVIDIA) ARM Cortex-A57, Platform is not supported. #39

Open Avi-avidan opened 4 years ago

Avi-avidan commented 4 years ago

hi, loved this repo. I am trying to read dc motor encoder link, using your example, how ever I am getting NotImplementedError: Platform is not supported. exception is raised for this line - gpio = gaugette.gpio.GPIO()

any advice will be appreciated.

this is the motor I am using - https://www.aliexpress.com/i/4000098341909.html

this is jetson nano board - https://developer.nvidia.com/embedded/jetson-nano-developer-kit

here is my gpio setup -

import Jetson.GPIO as GPIO
GPIO.setmode(GPIO.TEGRA_SOC)
ENC1, ENC2 = 'LCD_TE', 'SPI2_SCK'
GPIO.setup(ENC1, GPIO.IN)
GPIO.setup(ENC2, GPIO.IN)

thank a lot, a.

guyc commented 4 years ago

The problem is that the gpio wrapper needs a new block to adapt the Jetson.GPIO library. At a glance the Jetson library looks like a drop-in for Adafruit_BBIO.GPIO, so try changing the block for beagleboneblack to support your platform: https://github.com/guyc/py-gaugette/blob/14732a78fc953cfc920f548b04d69d5b6219ba54/gaugette/gpio.py#L34

eg experimentally change this:

elif gaugette.platform.isBeagleBoneBlack:
            import Adafruit_BBIO.GPIO
            self.gpio = Adafruit_BBIO.GPIO

to

else:
            import Jetson.GPIO
            self.gpio = Jetson.GPIO
Avi-avidan commented 3 years ago

thanks :) that helped alot. moving down the rubbit hole reveals Jetson.GPIO has no attribute 'trigger'...

jpalves commented 6 months ago

I have a modified version to work with Jetson Nano, take a look https://github.com/jpalves/py-gaugette