Comments (5)
Are you properly cleaning up the GPIO before exiting out of the interpreter?
What happens if you do: ls /sys/class/gpio
from chip_io.
I have the same error using python 2.7.9
root@chip:/home/chip# ls /sys/class/gpio
export gpiochip0 gpiochip1013 gpiochip1021 unexport
from chip_io.
I see the same error being displayed when debug mode is active. In my case, GPIO works even when these messages are being displayed.
I think this is caused by a small bug on function gpio_export on event_gpio.c:
ssize_t s = write(fd, str_gpio, len); e_no = errno;
if (DEBUG)
if (e_no)
printf("gpio_export: something went wrong: %s\n", strerror(e_no));
I'm not an expert on C, but according to what I researched you should only check errno
when you get an erroneous result. In this case, we should check the value returned by write
first, and if it's different to the value of len
, then we should check the error code the function set into errno
(this check is done further in the gpio_export
function and it passes in my tests). You should expect the stdlib functions to set errno
only in case of error. In this case, a previous function call set the errno
variable to "2" (no such file or directory), so when the code above checked errno
, the error line was printed. I made a test change to print errno
before and after the write call and confirmed the errno
code of "2" was there before the call to write
, so I think we can ignore these errors. I'll try to submit a patch for this, it's pretty simple.
from chip_io.
Nice work! I haven't used the GPIO pins on my CHIP for anything and with it being so long I can't remember if this issue is the reason I never fully utilized it. Either way nice contribution!
from chip_io.
Nice work! I haven't used the GPIO pins on my CHIP for anything and with it being so long I can't remember if this issue is the reason I never fully utilized it. Either way nice contribution!
Thanks for your kind words! And also thank you for opening this issue in the first place: it inspired me to search for an answer to this problem :)
Regards,
-G.
from chip_io.
Related Issues (20)
- adding callback functions on any pin that supports edge detection not work HOT 8
- setup doesn't work twice HOT 6
- Per PWM Cleanup
- Think about ability to specify GPIO number for all functions
- Investigate SBC determination using model number in the device tree HOT 2
- CHIP_IO low-level library for using in other scripting languages HOT 1
- Allow callback functionality for PWM1, I2S-MCLK, and I2S-DI on the CHIP Pro
- Edge/Interrupt detection on the C.H.I.P. Pro HOT 9
- bounce time HOT 1
- Could not open GPIO 1015 value file HOT 2
- Verify module level documentation
- Create API Documentation HOT 1
- wait_for_edge() timeout
- Adding error catching for pins in event_gpio.c that are being used by the system while in debug mode
- binary wheel pypi package? HOT 2
- Cleanup Servo code to leverage SoftPWM as a basis HOT 1
- Intermittent GPIO RuntimeError
- Segmentation fault HOT 2
- No signs of life with Servo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chip_io.