Nvidia Jetson Nano and porting node-red-node-pi-gpio to libgpiod

I was gifted an Nvidia Jetson Nano by the Fedora project to troubleshoot some arm specific packaging issues. Now that that's complete, I have a shiny new toy/tool looking for a problem to solve.

I noticed there is no official or contrib node for the Nvidia Jetson Nano. It looks like the GPIO is very similar to the Pi3, and there are hacks suggestions about just switching which python library to import. Unfortunately the sysfs method of accessing GPIO has been depreciated for quite some time (Kernel 4.8?) and Fedora no longer includes that in favor of libgpiod.

My personal plan is to leverage the work in node-red-node-pi-gpio to create a contrib Jetson node module but what I've come to realize is that once I've migrated to libgpiod, it would be trivial to migrate the official pi-gpio from sysfs to libgpiod.

I took a look at the gpiod module but would prefer not to rely on an external daemon.

Any tips? I'm not really a programmer per se. $DAYJOB is an Automation engineer but I have a little experience with C/C++, BASH, Python, etc, but no javascript.

I started with a mass replacement of pi with jetson but that seemed to break things sufficiently that I can't get the nodes to load in node-red. My plan, if possible, it to use the tools in libgpiod-utils directly, and have three nodes:

  1. Monitoring input: Creates a message on changes on input state (connection on right)
  2. Pass through input: Reads the current input/output state (in and out)
  3. Output: Sets an output, digital or PWM. (connection on left)

These would use gpiomon, gpioget, and gpioset respectively.

Pardon if I'm not using the correct nomenclature, I'm still pretty new to node-red.


1 Like

I've had some limited success but I've gotten monitoring of inputs kinda working. When a node is deleted it's not killing the process so I've got to figure that out.

When I'm done the module should be easily ported to other devices libgpiod supports.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.