0

My first piece of code is inside of my pc which detects characters at a part of the screen. Once it detects a certain sequence then it needs to send a signal to the raspberry pi which controls LEDs. I know that I can use SSH to run things remotely on a raspberry pi. But how do I automate it?

For example if I have the following code inside of my main pc

if numbs == [1,1,2]:
    #enter this code into the ssh to run leds.py on the raspberry

The pi is running standard Linux based raspbian.

If you have any other suggestions on better ways of doing this I'm open to ideas.

1 Answer 1

1

You can automate anything on linux(raspbian in particular) in many ways.

First option is to use cron command. I'd say it is a simplest option, and pretty powerful: you can run your code once a minute, once a day, on each fridady 13th, etc.

Another option is writing systemd service for your task. Its pretty hard way, but even more powerful then the first one.

Another option special for python scripts is python package supervisor, which is kinda like prevoius solutions.

Sign up to request clarification or add additional context in comments.

2 Comments

thats not really what i want, i can go multiple ways but the main idea is to send data from a windows machine to a raspberry pi
Again there are lots of ways. Simpest one is to connect them by ethernet or wifi and send data through http. There are http client and server implementation in python - http.server and http.client. Another option is to use usb cable, but i'm not sure about how to work with usb on Windows

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.