esin8785
Posts: 4
Joined: Wed Feb 13, 2019 2:53 am

Hello I'm new to raspberry pi and the forums but need your help - GPIO over internet

Wed Feb 13, 2019 2:59 am

Hello first time poster here and first time raspberry pi user, what I currently have is a raspberry pi 3 b+. Basically I need to be able to control the gpio's via website and be able to access my raspberry pi via website and ssh from anywhere around the world, I'm having some issues with doing this though. I have port forwarded 3 different ports and none seem to work outside of the network, I do have apache2 and php mysql and what not installed and are working, I know because I can go to the test pages of them php does display the php info page when going to it. But I cannot seem to get it to access outside of my network for some reason and was wondering if someone could come by and help me out vncing or something. The reason I need this is so I can control my 8 channel relay board I have set up to 8 outlets outside of the network if need to be I mean I'd really only know my ip or my url address unless I gave it out to everyone but I need it password protected as well.

I have an app that able to control the raspberry pi gpio pins but done through android only and I need it to be online so any device can control so long they have my password. Thank you guys so much and I'm excited to be apart of the community!

tpyo kingg
Posts: 809
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Hello I'm new to raspberry pi and the forums but need your help

Wed Feb 13, 2019 7:25 am

esin8785 wrote:
Wed Feb 13, 2019 2:59 am
But I cannot seem to get it to access outside of my network for some reason [...]
Do you have the GPIO working with PHP locally over the LAN yet? That is the first step before even considering opening up external ports on the router.

Then once you do have GPIO access via PHP to set up password protection in Apache2, see the official documentation on basic authentication.

The port forwarding will depend on your router's brand and model. I would set up TLS (HTTPS on port 443) at that point and use Let's Encrypt to get it going, so that you can avoid HTTP since it is unencrypted.

Also, before you forward port 22, be sure that you have SSH key-based authentication working over the LAN and that you've turned off password authentication for SSH.

Return to “Beginners”