User avatar
legendisback
Posts: 11
Joined: Thu Sep 01, 2016 12:58 pm

Controlling rp2 pins with an application on Windows PC

Thu Sep 08, 2016 9:25 am

Hi there,
I have been trying to do a simple project .
What i want to do is simply have a two buttons program that runs in windows pc and controls rp2 pins to light a led (on and off buttons).
I do NOT want to use any remote desktop control program !!!
I do NOT want to see the rp2 screen on my pc, I just want to see the 2 button program,
I was doing the project in windows iot with visual studio c# (was using windows remote client to control app in rp2) and the only way i could was, using rp2 as server and using a browser to reach the program to control the led (thats not what i want either! ), but i am willing to change the system from windows iot core to rasbian and do the programming in python if i can do it without using any browser or remote app to control rp2 pins from windows pc with a single app(which i will write :)).
(the program will run in a windows pc)
thanks...
I am the terror that flaps in the night...
I am the surprise you find in your cereal box!
I am DARKWING DUCK!!!

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

Re: Controlling rp2 pins with an application on Windows PC

Thu Sep 08, 2016 9:40 am

pigpio has the ability to interact from Python running on a Windows PC with an RPi running Raspbian: http://abyz.co.uk/rpi/pigpio/

User avatar
RST8
Posts: 64
Joined: Tue Nov 25, 2014 1:57 pm

Re: Controlling rp2 pins with an application on Windows PC

Thu Sep 08, 2016 9:51 am

I take it the Pi and the PC are on the same network?
There are several approaches, one quick and dirty one one would be to have a file share on your PC, create a simple text file that has "ON" or "OFF" in it, depending on what button was pressed in the PC app. Mount a share on the Pi and python can read it and then set the GPIO accordingly. You could monitor the file creation / modify time to check if you need to read it again.
It's clunky, but relatively quick to implement.

A more elegant solution might involve using web sockets, depends on how much work you want to do and how secure you need to make it. You could do this in IOT or Raspbian.

Joe

Return to “Python”