Let's say I have a few sensors and LEDs connected to a raspberry Pi and I want to make a fully connected GUI on a desktop(PyQT) for it. So I can see the sensor values, toggle the LEDs and so forth.
What is the most optimal way of doing this?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
So here was my findings after tinkering around with it all day. Seems I just got the communication part down. Still need to figure out the GPIO end and the client GUI end.
I wrote a simple server/client code using sockets.
server end code:
import socket s = socket.socket() host = '192.168.0.103' //IP from the router port = 12345 s.bind((host,port)) s.listen(5) while True: c, addr = s.accept() print ('Got connection from' , addr) c.send( 'Response from Orange Pi' ) c.close()
Client end code:
import socket s = socket.socket() host = '192.168.0.103' //IP from the router port = 12345 s.connect((host,port)) print(s.recv(1024)) s.close()
I am fairly new to python so I am still digging around to make the GUI for the client end. Will post updates as I progress.