-
• #2
You might have to run it with
sudo
so it has priviledges to access the hardware?Also, does:
echo 23 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio23/direction echo 1 > /sys/class/gpio/gpio23/value
work for you in the shell? I'm not 100% sure how the
gpio
command works. -
• #3
Your commands only work after: gpio export 23 output.
Without this command setting, I am not allowed to write to the ..gpio23/value. Also using sudo doesn't allow me to write
-
• #4
That's a bit weird. You know
sudo echo 23 > /sys/class/gpio/export
won't have the right effect though, since only theecho
will be run as sudo, not the>
bit? You'd have tosudo bash
and then type the commands in there.What OS are you using? Raspbian Stretch? I can't say I've used Stretch yet, but Jessie worked great.
-
• #5
sudo bash ... will only work after I typed: gpio export 23 output.
Without the last command I receive the error:
bash: /sys/class/gpio/gpio23/value: No such file or directoryI am using Raspbian Stretch.
-
• #6
Hmm. Where do you type
gpio export
? That sounds like it's inside Python's wiringpi library? Do you shut Python down first? It might be interfering somehow.If
/sys/class/gpio/export
doesn't work, you'll need to get that sorted first. That's pretty much the most basic way of using GPIO, and if it doesn't work then I guess you have other issues. Maybe you could ask on the Pi forum, or does someone else have some ideas?Have you tried with any other GPIOs? It might be that 23 is used by something else?
-
• #7
the Gpio utility comes with wiringPi.
I just uninstalled wiringPi and now I can use the echo commands without sudo.However Espruino still no results on all gpio-ports.
-
• #8
Well, it's a start I guess. What about running Espruino with
sudo
? You definitely need it to get the low-level wiringpi access -
• #9
sudo will not help. Installing Jessie now. Maybe that helps.
-
• #10
Just installed Jessie. Unfortunately the same problem happens.
-
• #11
I finally got it working after the command: gpio export 23 output
I have to run this command for each gpio port.
-
• #12
Thanks for letting us know - it sounds a bit like it's not actually using WiringPi but the filesystem GPIO, but hey - if it works then great.
-
• #13
Do I need the wiringPi for rf433 support?
-
• #14
rf433? You mean http://www.espruino.com/433Mhz, or something like http://www.espruino.com/RFM69
-
• #15
The first one: 433Mhz
-
• #16
Yes, you would if you want to receive - I think you might be ok for sending. You'll struggle a bit with reliability on Raspberry Pi anyway, because with the Operating System you can't guarantee accurate timing - you'd be much better off plugging an external microcontroller like the Pico into the Pi, so you can leave that to do the accurate timing stuff.
I have successfully installed Espruino at my raspberry pi zero w. Also wiringPi is installed before the Espruino make.
In a command-box the following will switch on my led: gpio -g write 23 1.
However in Espruino: D23.write(HIGH) will not switch the Led.
What did I forget?