I develop a C program and want to control something using nano GPIO, but here (Jetson.GPIO · PyPI) is the python library.
So how should i use the GPIO in C language on nano board? Do you have C library for GPIO?
Thanks a lot! Look forward to your reply.
I wrote a library for working with GPIO pins and I2C sensors for the Raspberry Pi 3.
The library is here https://github.com/blademoon/sensum-library . If you want, I can modify it for Jetson Nano. But I will need help, I need to test it on Jetson Nano.
I do not have my own board. If you want to contact me, write email@example.com. In the subject line of the letter, indicate on what issue.
I am trying to access the GPIO’s on the Jetson Nano with C++. The first link you have provided (https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) says that the ABI was deprecated and that userspace consumers are supposed to use the character device ABI. Any documentation on the character device thing they mention?
Also I tried to implement the same code from the example you provided ( [url]https://developer.ridgerun.com/wiki/index.php/Gpio-int-test.c[/url]) and I was not able to write to /sys/class/gpio/export . I received a “Permission Denied” error. Any advice on getting GPIO’s to work with C++? I am using nsight for my development by the way
Since the files under /sys are dynamic and get reset after every reboot, the modified permissions would need to be set for your user in a boot service. The easier way would just be to run your application with sudo.
Once I finish with my code, I intend to be able to power up the device and have the program running with no user input. My program needs to be able to write to GPIO pins and so I need a way to have all these permissions set at boot. Running as sudo is fine for now but it is definitely not a long term solution for me. Any chance you could point me in the right direction to get a boot service set up?
Hi nadir, see this post for an example systemd boot service that sets write permissions to a set of files under /sys. You would want to modify the chmod command there to reflect the /sys/class/gpio/* path you are using instead of the path from that example.
I created the service but I notice that when booting up the device that service always fails. Once it is logged in I can manually start the service but my code still outputs an error when attempting to initialize the GPIOs. Any advice?
Is there any error output that may indicate why it fails, either the start-up service or with your application?
You might also want to try this sudo NOPASSWD method from another post in that same thread, which limits the sudo access to the files/directories that you specify. Perhaps that may be easier to get going with.
I am writing a deep-stream script in C++ for object detection bounding box location and moving motors using GPIO pins. Does writing in C++ increase efficiency and speed of the script tremendously ? Since most computing is done in deep-stream i am unsure.
Ps: My goal is to make it fast, but is difference in speed between C++ and python significant as development and bug testing in C++ is a pain.