Skip to content
This repository has been archived by the owner on Dec 20, 2020. It is now read-only.

Resource busy #10

Open
Nanne118 opened this issue May 16, 2018 · 5 comments
Open

Resource busy #10

Nanne118 opened this issue May 16, 2018 · 5 comments

Comments

@Nanne118
Copy link

resourcebusy

On a fresh install of Raspbian stretch with the Dragino GPS / Lora HAT I get this error message: resource busy. How do I resolve this?

@wkl3nk
Copy link

wkl3nk commented May 16, 2018

The lmic-rpi-lora-gps-hat code will try to "unexport" the BCM pins 4, 23 and 24 before "exporting" them again. If there is an issue with "unexporting", then no error message will be printed, as in most cases it is not necessary to "unexport" the pins, if the where not used by another application.

Please try the following:

Check if the pins are already exported. Which subdirectories exist in directory /sys/class/gpio ?
Is there a subdirectory named gpio4 ?

ls -l /sys/class/gpio

If there is a gpio4 directory, try to "unexport" it manually. What happens?

echo 4 > /sys/class/gpio/unexport
echo 23 > /sys/class/gpio/unexport
echo 24 > /sys/class/gpio/unexport

@Nanne118
Copy link
Author

Oddly enough there does not appear to be a subdirectory named gpio 4, though I am sure I installed WiringPi on my Rpi as gpio -v returns the wiringpi prompt. Maybe I am running a wrong version (wrong source) of WiringPi?

resourcebusy2

@wklenk
Copy link
Owner

wklenk commented May 16, 2018

WiringPi has nothing to do with the issue. This GPIO support by means of a directory structure is provided by the Linux kernel.

You get the error message "write error: Invalid argument", so in fact your "pi" user should be permitted to write to this file /sys/class/gpio/unexport. If it NOT had the permission, you would get a "Permission denied" error message. So your "pi" user seems to be in group "gpio". Could you please cross check and find out the groups the user "pi" belongs to by using the "groups" command?

$ groups

Next, let's assume you got the "Invalid argument" error message, because pin 4 wasn't actually exported.
Let's try to export these ports by giving these commands:

$ echo 4 > /sys/class/gpio/export
$ echo 23 > /sys/class/gpio/export
$ echo 24 > /sys/class/gpio/export

@simortus
Copy link

i have had the same issue, the pins in the code are matching the dragino gpsHat v1.4.
You just need to check how the hat sits on the pins. if it doesn't sit properly, it makes a short circuit and thus cannot see gpio4.

@epasinetti
Copy link

i have had the same issue, the pins in the code are matching the dragino gpsHat v1.4.
You just need to check how the hat sits on the pins. if it doesn't sit properly, it makes a short circuit and thus cannot see gpio4.

same issue here , have you solved in other way ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants