eclipse / mraa

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.
http://mraa.io
MIT License
1.37k stars 613 forks source link

Invalid GPIO pin specified (39, GP77) #529

Closed ivictbor closed 8 years ago

ivictbor commented 8 years ago

Hi. I want to use GPIO pin 39 (GP77) on Intel Edison But when I Create:

mraa.Gpio(39)

I have python exception " Invalid GPIO pin specified" Another pins initialized ok (for example 52, GP78) strace:

stat64("/sys/class/gpio/gpio78/", 0xbf8e88b0) = -1 ENOENT (No such file or directory) open("/sys/class/gpio/export", O_WRONLY) = 8 write(8, "78", 2) = 2 close(8) = 0 stat64("/sys/class/gpio/gpio78/", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 open("/sys/class/gpio/gpio78/pinmux", O_WRONLY) = -1 ENOENT (No such file or directory) open("/sys/kernel/debug/gpio_debug/gpio78/current_pinmux", O_WRONLY) = 8 write(8, "mode0", 5) = 5 close(8) = 0 open("/sys/class/gpio/gpio78/direction", O_RDWR) = 8 write(8, "out", 3) = 3 close(8) = 0 open("/sys/class/gpio/gpio78/value", O_RDWR) = 8 lseek(8, 0, SEEK_SET) = 0 write(8, "1", 1) = 1 stat64("/sys/class/gpio/gpio77/", 0xbf8e88b0) = -1 ENOENT (No such file or directory) open("/sys/class/gpio/export", O_WRONLY) = 9 write(9, "77", 2) = -1 EBUSY (Device or resource busy) time(NULL) = 1466639716 send(5, "<139>Jun 22 23:55:16 libmraa[225"..., 103, MSG_NOSIGNAL) = 103 close(9) = 0 futex(0x42574d08, FUTEX_WAKE_PRIVATE, 2147483647) = 0 clock_gettime(CLOCK_REALTIME, {1466639716, 448213798}) = 0 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=127, ...}) = 0

I am not shure but seems like EBUSY (Device or resource busy) looks very odd. I tried lsof but it shows some trash on edison:

lsof +D /sys/class/gpio/export lsof 4.87 latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man usage: [-?abhKlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[gG]] [+|-e s] [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names] Use the ``-h'' option to get more help information.

Sorry if it is not related to MRAA, may be you can suggest something.

ivictbor commented 8 years ago

seems like answer is here https://communities.intel.com/thread/77677