Joel77364
Posts: 1
Joined: Tue Feb 12, 2019 11:55 am

How to control Raspberry Pi's GPIO pins from separate PC

Thu Feb 28, 2019 7:44 am

In my application I want to turn on certain GPIO pins that are on the Raspberry Pi from my PC's C++ script. My PC is currently running on Windows 10 and my Raspberry Pi on Raspbian.

The general idea I had was to write python scripts on the Raspberry Pi itself and run them somehow from my PC when needed. Although, I am not sure how to do this or if it's possible in C++.

I know I can ssh into my Raspberry Pi and run scripts manually but the idea of this application is automation. I am able to connect my PC to the Raspberry Pi either by Ethernet or USB cables.

I have seen USB to GPIO modules that would probably work better although for now I am stuck with my Raspberry Pi.

Any knowledge or resources on how to do this is greatly appreciated.

kissanime app
Last edited by Joel77364 on Fri Mar 01, 2019 6:48 am, edited 1 time in total.

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

Re: How to control Raspberry Pi's GPIO pins from separate PC

Thu Feb 28, 2019 9:43 am

pigpiod and the matching python pigpio can do this.
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
neilgl
Posts: 1292
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: How to control Raspberry Pi's GPIO pins from separate PC

Thu Feb 28, 2019 12:58 pm

Maybe you could have a python script on the pi to listen for and act on mqtt messages (topics) e.g. "turn on GPIO 17"
You can send those messages from your PC in C++, or type them into a Command Prompt for testing

Return to “Troubleshooting”