Gigabyte2
Posts: 94
Joined: Thu Jan 31, 2013 9:15 pm

GPIO control from a web page

Tue Feb 18, 2014 9:09 pm

Hi, I wrote a Python script for controlling sensor values and relays.
I need to manage GPIO outs in a web page. I'm looking for a "button" that sets the output True when it is False and vice versa.

How I can do this?

Thank you :mrgreen:

mescgroup
Posts: 6
Joined: Fri Feb 14, 2014 7:59 pm

Re: GPIO control from a web page

Tue Feb 18, 2014 9:44 pm

Howdy, if I understand your question, there is a great example of doing something similar here:
http://www.instructables.com/id/Simple- ... ur-Raspbe/

Gigabyte2
Posts: 94
Joined: Thu Jan 31, 2013 9:15 pm

Re: GPIO control from a web page

Tue Feb 18, 2014 10:10 pm

Thank you!
I have downloaded the package from the link at the bottom of page.
Now I can't set the GPIO pins, I could set only pins 19, 21, 23.

ondrej1024
Posts: 151
Joined: Thu Dec 05, 2013 3:09 pm
Contact: Website

Re: GPIO control from a web page

Fri Feb 28, 2014 8:08 am

Hi Gigabyte2

I am developing a software to control relay cards remotely via various user interfaces. With the latest version also controlling GPIO pins is supported.
The software has a built-in webserver and provides its own web GUI. But it also provides an HTTP API which you can use to send HTTP requests from your own custom web page to control the GPIO pins.

You can have a look at the projects GitHub page to see if this is what you need:
http://ondrej1024.github.io/crelay

Cheers, Ondrej
The Telegea.org project: https://www.telegea.org

Tarcas
Posts: 740
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: GPIO control from a web page

Fri Feb 28, 2014 3:36 pm

Gigabyte2 wrote:Thank you!
I have downloaded the package from the link at the bottom of page.
Now I can't set the GPIO pins, I could set only pins 19, 21, 23.
Make sure you're using the Broadcom numbering scheme when you're identifying which pins you're looking at. (It's confusing, there are at least 3 ways to identify each pin. Maybe more.)

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: GPIO control from a web page

Sat Mar 01, 2014 7:51 am

I prefer to separate the IO control from the interface, using python to control the IO from set values stored in a database. The UI then interfaces with the database. It facilitates many features, such as logging, foreign key constraints, etc.
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

User avatar
DougieLawson
Posts: 36150
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: GPIO control from a web page

Sat Mar 01, 2014 11:19 am

iinnovations wrote:I prefer to separate the IO control from the interface, using python to control the IO from set values stored in a database. The UI then interfaces with the database. It facilitates many features, such as logging, foreign key constraints, etc.
I don't use a database. I use MQTT to separate the GPIO from the CGI.
https://www.ibm.com/developerworks/comm ... x_and_gpio
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: GPIO control from a web page

Sun Mar 02, 2014 1:03 am

cgi is slow, and database is good. wsgi is great. I lost an order of magnitude on server response time, not to mention on multiple concurrent requests, by making the switch.
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: GPIO control from a web page

Sun Mar 02, 2014 1:05 am

I see, you use fastcgi. I find it easier to use wsgi and apache2 ... no wonder django uses it. It's plug and play and fast.
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

thisisqasim
Posts: 3
Joined: Wed May 10, 2017 2:08 pm

Re: GPIO control from a web page

Wed May 10, 2017 2:10 pm

Since I couldn't find a better solution, I made a very simple web UI to toggle GPIO pins on/off. You are welcome to check it out and contribute.
https://github.com/ThisIsQasim/WebGPIO

baris93pau
Posts: 1
Joined: Thu Jun 08, 2017 1:28 pm

Re: GPIO control from a web page

Thu Jun 08, 2017 1:42 pm

Hi, i controlled the gpio pins from a web page with two buttons and i also want to control motor speed with a slider. How can i do it?

Return to “Automation, sensing and robotics”