Code Monkey home page Code Monkey logo

Comments (2)

unicornrobot avatar unicornrobot commented on May 30, 2024 1

That works great! Thanks for taking the time to explain.

from unicorn-remote.

njbbaer avatar njbbaer commented on May 30, 2024

Great idea. That's how I set up mine for demonstrations.

There are many ways to run a program on boot in the background of the Raspberry Pi.

This simplest would be to edit the file /etc/rc.local to add the command you would like to run on boot. Use the full path to run.py and include & at the end of your command to make it run in the background. Place your command before the line exit 0.

Your rc.local file should look like:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

sudo python3 /home/pi/unicorn-remote/run.py --original &

exit 0

You can also consider systemd or chrontab which are more advanced solutions, but I think rc.local is the way to go for something simple like this.

from unicorn-remote.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.