GPIO Permission issue Nvidia Jetson AGX Xavier - gpio

Good afternoon everyone,
When trying to control a stepper motor through the GPIO header on the AGX Xavier I ran into the following issue:
When utilizing the jetson-gpio library for python compatible GPIO control I am able to run all sample scripts (including the ‘simple_pwm.py’, this is relevant later in this post).
However, when I attempt to use the JetsonGPIO librari for c++ compatible GPIO control the following error appears when using the GPIO::PWM() command:
The same command in Python (syntax) does work however. I have moved the 99-gpio.rules file to /etc/udev/rules.d and created the gpio group and added my user to this group. I have tried running all commands with sudo, with no effect unfortunately.
Does anyone know how to solve the permission issue? I would really like to use the GPIO::PWM function in a C++ script rather than python.
Best regards,
Ruud
Extra info:
As explained in the following link: Configure GPIO Nvidia Jetson
The GPIO header of a Jetson device can be configured. The 3 PWM pins on the 40-pin expansion header are disabled by default so these needed to be enabled. I have done this.

Related

Using linux's EHSET

I'm trying to certify USB on our device that is running Linux 4.14. For windows systems we were using https://www.usb.org/usb2tools. For linux the only option I have found is a kernel module called EHSET. Unfortunately I can't manage to get it working, can You please help?
I have added the following configuration:
CONFIG_USB_HCD_TEST_MODE=y
USB_EHSET_TEST_FIXTURE=m
Then on the system I type in modprobe ehset. After this looking at the source code of ehset.c I assumed that inserting USB stick with VendorID:
0x1a0a and ProductID: 0x0108 would start the single step procedure, but it doesn't do anything. The device is loaded as a regular USB stick.
I have not seen any documentation on this topic. Is the kernel driver the only way of testing it in linux and if nothing ready is available do You know what is the procedure of using it?
Thanks in advance!

Run script on Linux startup as late as possible

I created a simple module that controls wheter a USB supplies power for a device when in host mode or not. When loaded, this module cuts off the power to any device connected until told otherwise.
It is also desired that when booted, the system comes with both my module loaded, and the USB supply cut off. To this end, so far I've tried:
Setting my module as a kernel built-in: had no effect, modules that are loaded later overrun my configuration;
Creating an init.d script: Created the script, and set it up to run on rc5. No luck as well, I run into multiple problems with USB devices (such as usb 2-1: device descriptor read/64, error -110);
I'm running Kernel 3.12 on a custom board, and I've tested that the module works as intended if I load it manually (via modprobe) into the system, after logging in.
Ideally, I want to keep these configurations to be done during boot, without any need of logins and such.
So, my question is: how can I postpone the module loading until the last possible minute, assuring that any other configuration is already finished? Also, is udev a good solution for this sort of thing? From what I read, I had the impression it wouldn't be the best fit...
Regards,
Guilherme
So, I've figured out how to get rid of the errors when using an init.d script. All that is needed is to unbind the devices before loading the module. the following line before the modprobe did the trick for me:
echo "2-1" > /sys/bus/usb/drivers/usb/unbind
Regards,
Guilherme

Auto login on BeagleBone White + Angstrom 3.2

I'd like to find a way to make my BeagleBone (white) Rev A6a autologin after being powered up. I'm using Angstrom with kernel 3.2.34, which uses systemd instead of innitab.
I've already seen some topics (like this question) with reference to modifications on some service files (like /etc/systemd/system/getty.target.wants/getty#tty1.service), but that only helped me partly: If I power/reset my BBone while keeping it connected via USB to my computer, it autologs as expected. But, if I just power the BBone with a wallwart (without any other connections), it doesn't seem to log in. At least I believe that's what is happening, as I have a program prepared to autorun after login and it only starts on the first case (with USB on).
I'd appreciate any help. Thanks.
Turned out that a RF module attached to my beaglebone was being powered via USB, and this module should be activated by my test program mentioned in the question. So, when I unplugged my BBone USB cable, I was actually separating its GND from the RF Module's ground.
In short, I just had to use the same source in the entire circuit and keep the autologin configuration explained in the topic I also mentioned in my question.
You could make your program a service and run after user instance of systemd.
Lets say you have a graphical.target in your /usr/lib/systemd/system then just put symlink to ../systemd-user#.target to /usr/lib/systemd/system/graphical.target.wants/system named like systemd-user#<your-user-name>.service.
This systemd-user#.service should containe ExecStart line like /usr/bin/systemd --user.
Then you'll have to add your application's service-file to /usr/lib/systemd/user.
More info is at http://www.freedesktop.org/software/systemd/man/systemd.html and http://www.freedesktop.org/software/systemd/man/systemd.unit.html

Problems installation of camera drivers - linux

I want to install the drivers of the video camera on my linux computer.
I write the command:
modprobe usbserial vendor=... product=...
what I expected to get was ttyUSB0 (or sth simmilar) in the /dev directory.
Instead what is getting installed is sg3 (whatever that is) and when I run a program that is supposed to send a command to start recording I get no results (but no errors either).
(I changed what I had previously: fd = open(/dev/ttyUSB0,...) to /dev/sg3 but I guess this is not a configuration that enables sending this kind of data.
What might be the problem? (Sorry if it's a basic question)
cameras and linux can be tricky.
Start by plugging in the camera and running
lsusb
google for the id to see if anyone has a step by step tutorial or at very least can tell you which modules are needed.
Most common drivers seem to have been migrated to the kernel, so rebulid your kernel make sure the modules are built.
Some more obscure usb modules have to be built by hand.

wpa_supplicant tells "No Drivers enabled"

I have compiled wpa_supplicant code downloaded from http://hostap.epitest.fi/wpa_supplicant/ version is 0.7.3. I am getting No Drivers installed while trying to run the built wpa_supplicant. Am i missing anything in its compilation? Has anyone faced this error? Is there any setting to enable drivers also while compiling wpa_supplicant and wpa_cli?
Does your kernel automatically load the correct module for your wireless card? If not, modprobe the correct module, and try again.
Also, the wpa_supplicant(8) page's AVAILABLE DRIVERS section says that only a handful of cards are supported (disappointing, but at least you could look through the list before buying a card), and that support for the drivers may or may not be compiled in. So make sure your card's driver is on the list, and make sure you've compiled wpa_supplicant(8) with the correct driver.
You have to choose a driver to use by enabling it in .config file of wpa_supplicant before build. They will be in the form CONFIG_DRIVER_<name>.
CONFIG_DRIVER_WEXT and CONFIG_DRIVER_NL80211 are generic that suits many hardware.

Resources