Skip to main content
27 votes

Make "iw wlan0 set power_save off" permanent

I did it by simply adding a line to /etc/rc.local /sbin/iwconfig wlan0 power off Add that ahead of exit 0 and it will run at every boot.
Dougie's user avatar
  • 5,311
26 votes
Accepted

Make "iw wlan0 set power_save off" permanent

Power save mode was an issue years ago on older versions of Raspbian. It was fixed for a while, but has now (like a zombie) come back. It was disabled by default with the WiFi driver brcmfmac for a ...
Ingo's user avatar
  • 42.2k
19 votes
Accepted

What is the earliest place in the boot process where I can put my script?

If you're using systemd (which you are if you have Jessie or Stretch), you'll want to create a systemd unit that will run your script as early as possible. In your /lib/systemd/system (note: not /lib/...
Aurora0001's user avatar
  • 6,308
13 votes

How to get PulseAudio running?

If you want pulseaudio to start at boot, but as a user-level service, you can make a systemd unit file. This may help, as pulseaudio does not prefer to run in systems mode. https://www.freedesktop.org/...
semitones's user avatar
  • 431
7 votes

Raspberry Pi4 systemctl suspend or systemctl hibernated not supported?

Raspbian kernel is built without CONFIG_HIBERNATION which is needed to provide the necessary interfaces for systemctl. You will have to build a custom kernel to enable those interfaces. You will also ...
Dmitry Grigoryev's user avatar
6 votes

Start Python Script on Startup

As frequently stated here (and other places) rc.local has been deprecated in Linux, and it is not recommended for use. Numerous problems in the use of rc.local have been reported here; you should ...
Seamus's user avatar
  • 22.1k
5 votes
Accepted

start chromium on raspberry pi in kiosk mode using systemd service instead of through LXDE-pi/autostart

The Unit file looks very good for a program to start as service. systemd runs services automatically in the background. But your script is sending unclutter and chromium-browser to the background ...
Ingo's user avatar
  • 42.2k
4 votes
Accepted

Running a Python script as a service file on boot

I know nothing about your script, if it runs only one time on boot up or stays always in the background as a service, if it needs root rights, if it produces text or graphical output, to name the most ...
Ingo's user avatar
  • 42.2k
4 votes

Crontab suddenly doesn't start jobs

You can help yourself by collecting any error messages that are generated when cron runs your scripts. As you're aware, your shell will send error messages to the stderr stream when they occur. When ...
Seamus's user avatar
  • 22.1k
4 votes

Make "iw wlan0 set power_save off" permanent

This is still relevant for me when I want to use the RPi headless and log in through SSH, as there are no input devices plugged in and power management kicks in too early. Sometimes I couldn't log in ...
Bim's user avatar
  • 151
4 votes
Accepted

says i don't have wiringpi module when runing code at startup

You cannot use ~/.bashrc to run a program at boot up. It is to configure bash and runs only with bash sessions and not at boot up of the RasPi. To have a service started on boot up you best use a ...
Ingo's user avatar
  • 42.2k
4 votes

Earliest systemd target for running Python script

I would say the earliest usable target is the sysinit.target. But because there is nothing known about the needed resources of the LED strip it may fail. You can try other targets. The next could be ...
Ingo's user avatar
  • 42.2k
3 votes
Accepted

Running Hologram cellular network from startup issues [cannot run on rc.local or .bashrc]

Please take note that using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from ...
Ingo's user avatar
  • 42.2k
3 votes

Raspberry Pi run commands on boot

In order to store the script’s text output in a log file, you can change the ExecStart line to: ExecStart=/usr/bin/python3 /home/pi/sample.py > /home/pi/sample.log 2>&1 This is wrong, ...
goldilocks's user avatar
  • 58.9k
3 votes

Raspberry Pi run commands on boot

If you're expecting a GUI browser to open, the DISPLAY environment variable may need to be explicitly set so that the browser the webbrowser module opens knows where to show itself. Otherwise it would ...
Fred's user avatar
  • 4,552
3 votes

How to start a systemd service as a non-root user?

You can include [Service] ... User=pi Group=pi ... in your service file.
Dougie's user avatar
  • 5,311
3 votes

SystemD unit dependencies to start wiringPi GPIO application

I believe there's a degree of indeterminacy with regard to execution order. If this isn't required by anything else, and isn't required to happen before anything else, then it won't be a priority. ...
goldilocks's user avatar
  • 58.9k
3 votes

What is the earliest place in the boot process where I can put my script?

The earliest possible place is in the initrd (init ramdisk). For this you should look into creating an initramfs-tools hook in /etc/initramfs-tools/hooks or similar. You probably best look for some ...
allo's user avatar
  • 330
3 votes

Raspberry Pi run commands on boot

Just haven't a monitor by hand so I can't test it but here are some ideas how it could work with reference to this accepted answer How to make a service to run a python script which includes browser ...
Ingo's user avatar
  • 42.2k
3 votes
Accepted

Mounting an external drive by label at startup with systemd

Try running it in root's crontab -e with a short sleep 30 at every reboot? @reboot sleep 30; /sbin/mount-media.sh >> /var/log/mount.log 2>&1 And take it out of systemd
Shelby Kira Marvell's user avatar
3 votes

Raspberry Pi Auto-start Executable with Systemd, Loaded but Inactive (Dead)

From the status as shown everything seems OK so far. It shows that the program has run and finished successfully with code=exited, status=0/SUCCESS. No problems seen by systemd. I did not understand ...
Ingo's user avatar
  • 42.2k
2 votes
Accepted

SystemD unit dependencies to start wiringPi GPIO application

I ended up with the following SystemD Unit file /lib/systemd/system/gpio-test.service: [Unit] Description=GPIO Test DefaultDependencies=false [Service] Type=oneshot ExecStart=/opt/gpio-test Restart=...
Pascal Rosin's user avatar
2 votes
Accepted

Access Point service is not starting on boot with systemd

Loaded: loaded (/lib/systemd/system/accesspoint.service; disabled) Note the "disabled" part. This means the service is not set to run at boot. Try: sudo systemctl enable accesspoint I notice you ...
goldilocks's user avatar
  • 58.9k
2 votes

Crontab suddenly doesn't start jobs

You are using crontab to start programs on boot with option @reboot. In man 5 crontab you can read: Please note that startup, as far as @reboot is concerned, is the time when the cron(8) daemon ...
Ingo's user avatar
  • 42.2k
2 votes

Excute python file on start-up

A systemd unit will do the job. Create a new one with: rpi ~$ sudo systemctl --force --full edit myPythonScript.service In the editor insert these statements, save it and quit the editor: [Unit] ...
Ingo's user avatar
  • 42.2k
2 votes
Accepted

How do I change runlevel without keyboard or screen?

The default unit systemd starts at bootup can be overridden with the systemd.unit= kernel command line option. So you can edit cmdline.txt (mounted on your Ubuntu system) and append the parameter ...
Ingo's user avatar
  • 42.2k
2 votes

Pi - own python startup script in the wrong order

As noted in a comment on your question, the error suggests that a Python module is not found, which is controlled in part by environment variables such as (but not limited to) PYTHONPATH. (See, for a ...
Brick's user avatar
  • 1,377
2 votes
Accepted

Run a script before blank screen on shutdown/reboot

Your service file looks good, except for the Before=multi-user.target line. That should be After=multi-user.target, because services get stopped in the inverted order they got started. There's no ...
jake's user avatar
  • 1,347
2 votes
Accepted

Connect to Wifi for 10 minutes then disconnect

We do not know anything about your setup. The simplest way is to start a service on boot up that just delays 10 minutes (e.g. sleep 600) and then disables wifi. Here an idea for a generic systemd Unit ...
Ingo's user avatar
  • 42.2k
2 votes

Raspberry Pi run commands on boot

I had an issue like that with one of my Python projects, where I needed a Bash script with the steps to run my program to run not only after the Raspberry Pi boots, but also after the GUI loads. What ...
Tané Tachyon's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible