Web GPIO Status interface doesn't respond
Closed this issue · 12 comments
Hi, I have installed berryio on a Raspberry Pi B+, latest Raspbian, fully updated. I followed the berryio install instructions. I have a Slice of Relay board installed. I can activate the relays using the command line:
sudo berryio gpio_set_mode 24 out; sudo berryio gpio_set_value 24 1; sudo berryio gpio_set_value 24 0
but when I access the web page I can get no response from the GPIO Status GUI elements. Although I get an indication that 'Not In Use', 'In' and 'Out' are clickable, when I click them nothing happens.
I have looked at the /etc/berryio/gpio.php but I can't see where to edit the In/Out status. When I use the gpio_set_mode command nothing seems to be saved; I have to repeat the command after a reboot.
I have javascript enabled in browser. The rest of the graphic elements (e.g. 'System') seem to work OK. Can you give me an idea what I need to do to get the GPIO Status GUI to work?
Thanks for this very useful programme.
Thanks, Ken
Hi Ken,
It looks like you have two issues, one where you need to set the directions on the GPIO permanently and one where the web interface isn't changing the GPIO mode.
- Setting the GPIO permanently:
Unfortunately its not possible to set the GPIO modes permanently because they are reset on bootup and BerryIO doesn't have the ability to set anything at startup. However you can add BerryIO commands in the /etc/rc.local file and they will be run when the Pi starts up. If you edit this file and add your commands on lines just before the "exit 0" command they will run every time your Pi is switched on and should be able to set the GPIO how you want it. Let me know if this works for you. You don't need the sudo as rc.local is run as root but it may be the case that you need to use the full path, for example "/usr/bin/berryio gpio_set_mode 24 out" - Mode not changing with the GUI:
This is an unusual one. I've not seen this before. Can you go to the "About" page and find the gpio_set_mode link and use that and let me know what it says?
For example to set pin 24 to out:
http://#### your Pi #####:81/gpio_set_mode/24/out
Hi Daniel,
Thank you very much for responding to me so quickly. Setting the GPIO modes
the way you suggested works fine, thank you.
I'm not exactly sure what you wanted me to do but I put this into my
browser address bar:"http://192.168.0.14:80/gpio_set_mode/24/out"
And got this response:"ERROR: Cannot set pin "24" into mode "out" on the
GPIO Control page.
Regards, Ken
On Sat, Feb 7, 2015 at 2:31 PM, Daniel Bull notifications@github.com
wrote:
Hi Ken,
It looks like you have two issues, one where you need to set the
directions on the GPIO permanently and one where the web interface isn't
changing the GPIO mode.
Setting the GPIO permanently:
Unfortunately its not possible to set the GPIO modes permanently
because they are reset on bootup and BerryIO doesn't have the ability to
set anything at startup. However you can add BerryIO commands in the
/etc/rc.local file and they will be run when the Pi starts up. If you edit
this file and add your commands on lines just before the "exit 0" command
they will run every time your Pi is switched on and should be able to set
the GPIO how you want it. Let me know if this works for you. You don't need
the sudo as rc.local is run as root but it may be the case that you need to
use the full path, for example "/usr/bin/berryio gpio_set_mode 24 out"
2.Mode not changing with the GUI:
This is an unusual one. I've not seen this before. Can you go to the
"About" page and find the gpio_set_mode link and use that and let me know
what it says?
For example to set pin 24 to out:
http://#### your Pi #####:81/gpio_set_mode/24/out—
Reply to this email directly or view it on GitHub
#22 (comment).
Ken Ironside & Associates
voice & fax: +27 44 343 2031
mobile: +27 82 881 0665
email: ken@kenironside.co.za
"If we knew what we were doing, we wouldn't call it research..."
[image: Facebook] http://www.facebook.com/kenironside [image: Twitter]
http://www.twitter.com/kenironside [image: LinkedIn]
http://za.linkedin.com/in/kenironside [image: about.me]
http://www.about.me/kenironside
Thanks Ken, thats what I wanted you to do.
It looks like something is preventing the BerryIO web interface from changing the GPIO mode.
Could you run the following commands for me and let me know the output:
sudo /usr/share/berryio/scripts/gpio_set_export_permissions.sh
sudo /usr/share/berryio/scripts/gpio_set_device_permissions.sh
$ sudo /usr/share/berryio/scripts/gpio_set_export_permissions.sh
$ The user www-data' is already a member of
gpio'.
$ sudo /usr/share/berryio/scripts/gpio_set_device_permissions.sh
$ The user www-data' is already a member of
gpio'.
chgrp: cannot access /sys/devices/virtual/gpio': No such file or directory chmod: cannot access
/sys/devices/virtual/gpio': No such file or directory
Hi Daniel,
There's no file or subdirectory in /sys/devices/virtual/ called 'gpio'
On Sat, Feb 7, 2015 at 4:04 PM, Daniel Bull notifications@github.com
wrote:
Thanks Ken, thats what I wanted you to do.
It looks like something is preventing the BerryIO web interface from
changing the GPIO mode.
Could you run the following commands for me and let me know the output:
sudo /usr/share/berryio/scripts/gpio_set_export_permissions.sh
sudo /usr/share/berryio/scripts/gpio_set_device_permissions.sh—
Reply to this email directly or view it on GitHub
#22 (comment).
Ken Ironside & Associates
voice & fax: +27 44 343 2031
mobile: +27 82 881 0665
email: ken@kenironside.co.za
"If we knew what we were doing, we wouldn't call it research..."
[image: Facebook] http://www.facebook.com/kenironside [image: Twitter]
http://www.twitter.com/kenironside [image: LinkedIn]
http://za.linkedin.com/in/kenironside [image: about.me]
http://www.about.me/kenironside
I just tried it on 3 of my Pi's and the folder is there but I got someone else who has the latest version of Raspbian to test and they say its also missing :(
So it looks like something has changed in Raspbian and now the GPIO is moved/missing :(
Please give me some time to investigate this...
Hi Daniel,
No problem, I'm just so grateful that you might be able to help!
Po pressure from me.
Regards, Ken
On Sat, Feb 7, 2015 at 4:28 PM, Daniel Bull notifications@github.com
wrote:
I just tried it on 3 of my Pi's and the folder is there but I got someone
else who has the latest version of Raspbian to test and they say its also
missing :(
So it looks like something has changed in Raspbian and now the GPIO is
moved/missing :(
Please give me some time to investigate this...—
Reply to this email directly or view it on GitHub
#22 (comment).
Ken Ironside & Associates
voice & fax: +27 44 343 2031
mobile: +27 82 881 0665
email: ken@kenironside.co.za
"If we knew what we were doing, we wouldn't call it research..."
[image: Facebook] http://www.facebook.com/kenironside [image: Twitter]
http://www.twitter.com/kenironside [image: LinkedIn]
http://za.linkedin.com/in/kenironside [image: about.me]
http://www.about.me/kenironside
Hi Ken,
Thanks for letting me know about this issue and your patience in getting it resolved. The issue was indeed that the GPIO virtual device files had moved in the latest version of Raspbian.
I know this sounds odd but please could you run berryio upgrade twice and let me know if it fixes the problem after the second run.
Thanks
Hi Daniel,
OK, progress! The GPIO Control screen is now reflecting the state of the
pins and the pin states can be changed from the GUI. However, the switches
appear but they don't switch on and off. The switches don't appear to be
clickable.
Regards, Ken
On Sat, Feb 7, 2015 at 7:28 PM, Daniel Bull notifications@github.com
wrote:
Hi Ken,
Thanks for letting me know about this issue and your patience in getting
it resolved. The issue was indeed that the GPIO virtual device files had
moved in the latest version of Raspbian.I know this sounds odd but please could you run berryio upgrade twice and
let me know if it fixes the problem after the second run.Thanks
—
Reply to this email directly or view it on GitHub
#22 (comment).
Ken Ironside & Associates
voice & fax: +27 44 343 2031
mobile: +27 82 881 0665
email: ken@kenironside.co.za
"If we knew what we were doing, we wouldn't call it research..."
[image: Facebook] http://www.facebook.com/kenironside [image: Twitter]
http://www.twitter.com/kenironside [image: LinkedIn]
http://za.linkedin.com/in/kenironside [image: about.me]
http://www.about.me/kenironside
Hi Daniel, apologies, the switches do work - I didn't see that I needed to
click on the 'On' and 'Off' writing.
Thanks you so much!
Regards, Ken
On Sat, Feb 7, 2015 at 7:28 PM, Daniel Bull notifications@github.com
wrote:
Hi Ken,
Thanks for letting me know about this issue and your patience in getting
it resolved. The issue was indeed that the GPIO virtual device files had
moved in the latest version of Raspbian.I know this sounds odd but please could you run berryio upgrade twice and
let me know if it fixes the problem after the second run.Thanks
—
Reply to this email directly or view it on GitHub
#22 (comment).
Ken Ironside & Associates
voice & fax: +27 44 343 2031
mobile: +27 82 881 0665
email: ken@kenironside.co.za
"If we knew what we were doing, we wouldn't call it research..."
[image: Facebook] http://www.facebook.com/kenironside [image: Twitter]
http://www.twitter.com/kenironside [image: LinkedIn]
http://za.linkedin.com/in/kenironside [image: about.me]
http://www.about.me/kenironside
Excellent news :)
Thanks for helping me test this Ken.
No, thank you for the amazing fast fix! Gotta love open source!
Go well!
Regards, Ken
On Sat, Feb 7, 2015 at 7:42 PM, Daniel Bull notifications@github.com
wrote:
Excellent news :)
Thanks for helping me test this Ken.—
Reply to this email directly or view it on GitHub
#22 (comment).
Ken Ironside & Associates
voice & fax: +27 44 343 2031
mobile: +27 82 881 0665
email: ken@kenironside.co.za
"If we knew what we were doing, we wouldn't call it research..."
[image: Facebook] http://www.facebook.com/kenironside [image: Twitter]
http://www.twitter.com/kenironside [image: LinkedIn]
http://za.linkedin.com/in/kenironside [image: about.me]
http://www.about.me/kenironside