Tiny Core Base > Raspberry Pi

GPIO on the Raspberry Pi

(1/4) > >>

phillip.toone:
I tried following this tutorial for accessing the GPIO on the Raspberry Pi with Python.  But ran into problems (lots of error messages) when I tried to install the python code with this command:


--- Code: ---sudo python setup.py install
--- End code ---

So I tried to access the GPIO pins via bash as instructed here.  But I get an error message on the very first command I type:


--- Code: ---echo "4" > /sys/class/gpio/export
--- End code ---

I get this error message:


--- Quote ----sh: can't create /sys/class/gpio/export: Permission denied
--- End quote ---

And yes I tried using sudo and I get the same error message.

Has anyone else tried to access the GPIO on Tiny Core?  I am about to try this on Arch but I am really impressed with Tiny Core and would like to use it for my project.  Let me know.  Thank you so much in advance. =)

althalus:

--- Quote from: phillip.toone on November 21, 2012, 02:40:29 PM ---
--- Code: ---echo "4" > /sys/class/gpio/export
--- End code ---
<snip>
And yes I tried using sudo and I get the same error message.

--- End quote ---
Just to clarify, did you try:
$ sudo echo "4"> /sys/class/gpio/export

Or did you try:
$ sudo -s
# echo "4" > /sys/class/gpio/export

I would expect the first version to fail, but the second version should work (disclaimer: I don't have a raspberry pi to test on, but you have the same issues piping sudo output on regular x86 machines)

phillip.toone:

--- Quote from: althalus on November 21, 2012, 02:49:39 PM ---Just to clarify, did you try:
$ sudo echo "4"> /sys/class/gpio/export

Or did you try:
$ sudo -s
# echo "4" > /sys/class/gpio/export

I would expect the first version to fail, but the second version should work (disclaimer: I don't have a raspberry pi to test on, but you have the same issues piping sudo output on regular x86 machines)

--- End quote ---

I tried both


--- Code: ---sudo echo "21"> /sys/class/gpio/export
--- End code ---

and


--- Code: ---sudo su -
echo "21"> /sys/class/gpio/export
--- End code ---

and they both failed.  But


--- Code: ---sudo -s
echo "21" > /sys/class/gpio/export
--- End code ---

executes without an error.  Thank you!  But the voltage on pin 13 is not changing when I type this:


--- Code: ---echo "21" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio21/direction
echo "1" > /sys/class/gpio/gpio21/value
echo "0" > /sys/class/gpio/gpio21/value
--- End code ---

I think I have this mapped right.  I am using this reference.  I also am going to have to get the python thing fixed since that is what I plan to build my project with.

althalus:

--- Quote from: phillip.toone on November 21, 2012, 03:53:38 PM ---
--- Code: ---sudo -s
echo "21" > /sys/class/gpio/export
--- End code ---

executes without an error.  Thank you!  But the voltage on pin 13 is not changing when I type this:


--- Code: ---echo "21" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio21/direction
echo "1" > /sys/class/gpio/gpio21/value
echo "0" > /sys/class/gpio/gpio21/value
--- End code ---

I think I have this mapped right.  I am using this reference.

--- End quote ---
Unfortunately, until I get my hands on a pi, I can't help you with that error message.

--- Quote --- I also am going to have to get the python thing fixed since that is what I plan to build my project with.

--- End quote ---
Post the python errors and I might be able to give you some direction/extra help, if you like. Python is the language most of my not-day-job code is written in.

bmarkus:
Check you have the latest python extension installed, Nov 9 2012.

Install openssl-1.0.0.tcz,  compile-essentials.tcz and python-dev.tcz extensions.  In QEMU RPi.GPIO-0.4.1a builds fine. I did not try it on real hw, 5:02 AM here :(

Navigation

[0] Message Index

[#] Next page

Go to full version