Phillips45
Posts: 4
Joined: Mon Jun 11, 2018 2:57 pm

"Webserver controlling gpio: Is this possible?

Mon Jun 11, 2018 3:25 pm

Hi all,

I am new to the RPI and a complete NOOB..

Please can someone tell me how difficult it is to achieve the below (apologies in advance for any incorrect terminology)

I wish to create a webserver of which can be controlled via a phone (app?)

As I understand it I could plug the RPI (3B+) directly into a home router via an Ethernet cable and create a webserver. I am not sure however if I would need a static IP in order to host it?

I would like to control the following 3 x inputs (on/off switches) and 9 x outputs (relays) of which would control contactors I would also like a few spare inputs and outputs..

There would be 4 x processes one of which I have explained below the other 3 processes will be similar but in different combinations/overruns/debounces etc

PRESS ICON ON SCREEN TO START BELOW PROCESS

CHECK INPUT 2 IS OPEN CONTINUOUSLY FOR 10s (DE-BOUNCE)

TURN ON OUTPUT 3

30s AFTER OUTPUT 3 HAS STARTED TURN ON OUTPUT 2

BOTH OUTPUTS REMAIN ON UNTIL INPUT 2 CLOSES FOR 10s (DE-BOUNCE)

ONCE TRUE SIGNAL OF INPUT 2 CLOSING HAS BEEN RECIEVED OUTPUTS 2 AND 3 CONTINUE TO RUN FOR 30 SECONDS

OUTPUT 2 TURNS OFF

10 SECONDS LATER OUTPUT 3 TURNS OFF

On the phones screen that's controlling it (app?) there would be 4 x icons to press in order to start each process and there would be an "Abort Process" icon if this is pressed all outputs will turn off instantly this would act as a safety feature...

I would also like 4 other icons of which would be straight on/off buttons for 4 of the 9 outputs of which are not associated with the 4 "processes"

On the screen I would like to see the state of all the inputs and outputs in real time so when I trigger a process remotely I can make sure it is running correctly.

Also if the above is on a webserver how secure is it? i.e if someone gets in they could trigger processes etc so it would need to have good security..

The above seems rather advanced to me..

Any comments welcomed!

Thanks

wolf.z
Posts: 28
Joined: Thu Dec 24, 2015 8:34 pm

Re: Is this possible?

Mon Jun 11, 2018 6:15 pm

Yes, all seems possible. Read about basic GPIO handling, read about script languages, preferably python, and after that read about creating commands via html. How to set up a web server will be an effort for you but straightforward. After:
You'll discover beauty.

Phillips45
Posts: 4
Joined: Mon Jun 11, 2018 2:57 pm

Re: Is this possible?

Mon Jun 11, 2018 6:28 pm

Thanks for the reply...

So it would all be done in Python?

Also how stable is the RPI as far as leaving it unattended as a webserver? (It would only be one person logging into it at a time)

Also how would I go about getting paid help?...I can no doubt learn this but this seems very advanced?

Thanks

B.Goode
Posts: 6192
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Is this possible?

Mon Jun 11, 2018 6:35 pm

how would I go about getting paid help?
Use the Report this Post facility to ask a Moderator to move it to the Wanted section of the forum.

If you want any part of the service to be on-site / in person, be sure to specify that and give your geographic location.

An indication of your timescale and an appreciation of the likely level of professional fees you are likely to face will help you to garner serious replies.

Phillips45
Posts: 4
Joined: Mon Jun 11, 2018 2:57 pm

Re: Is this possible?

Mon Jun 11, 2018 6:45 pm

It wouldn't be on site or in person....

I can build the hardware no problem (electrician)

I'm after somewhere where people advertise for work it should be easy enough to build it on a bench using test box and work with a coder over skype...

Thanks

boyoh
Posts: 1145
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: "Webserver controlling gpio: Is this possible?

Wed Jun 13, 2018 8:33 pm

You said you are a electrician, but have you experience working with electronics.
Is this project to be used in a industrial environment, if so you will have a lot of
regulations to comply with, all your programing must be fail to safe .I suggest
you use a PLC sequencer, and use a ladder program to run the project
all this you can do yourself, You will find other electricians more used to
PLC's than one off Raspberry Pi/s/ Remember you might not always be there
service it

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: "Webserver controlling gpio: Is this possible?

Wed Jun 13, 2018 8:50 pm

I suggest you use a PLC sequencer, and use a ladder program to run the project
I'd agree. For what it would cost to develop, the money could be better spent in a commercial web-enabled PLC. Fewer headaches, better security, and reliability. Any programmer/developer worth their salt usually aren't cheaply hired via Skype or otherwise.

A basic overview: https://www.automation.com/library/arti ... g-your-plc

One of the many websites that sell web-enabled PLCs and modules. https://web-plc.com/

I wouldn't discourage anyone from developing their own system but this particular situation sounds better suited to a commercial solution.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

Phillips45
Posts: 4
Joined: Mon Jun 11, 2018 2:57 pm

Re: "Webserver controlling gpio: Is this possible?

Wed Jun 13, 2018 11:33 pm

Thanks for your replies..

I did briefly take a look at custom built plc's some time ago however the costs would be out of my budget.

Because I am an absolute bacon to the RPI and programming in general at the moment I am scratching around reading the beginner tutorials my aim for now would be something along the lines of turning an led on and off over the internet or similar. I do have a basic knowledge of electronics as in I understand the basic components and how to connect them (my father was in the industry..in fact one of the first things I ever remember learning as a child was the resistor colour code :D )

For now ive decided to move away from the breadboard tutorials and focus more on the very basic linux code.....

Return to “Beginners”

Who is online

Users browsing this forum: Bing [Bot], kim carr and 29 guests