Questions tagged [script]

non-compiled programs written in scripting languages (e.g. perl, python or tcl) or command line interpreters such as Unix shell.

Filter by
Sorted by
Tagged with
0 votes
1 answer
173 views

How to turn monitor on/off? vcgencmd doesn't know about display_power

In times past, I used tvservice to turn the monitor on/off in a script. Now I understand vcgencmd is the current method. I'm running RPi OS 12.4 on a 4GB RPi 5. I installed lib-rasbperrypibin. ...
0 votes
2 answers
218 views

Script running from terminal after setting pythonpath and running "thonny&" command, but not when thonny ide is opened directly

I am using a Raspberry Pi OS 64-bit to run a script that will capture an image. I have gone through installing the right packages for libcamera for this OS and can run libcamera apps using my terminal....
0 votes
1 answer
40 views

Help with "-bash: syntax error near unexpected token `do' "

Background: Yes, I'm a noob. I've been learning Debian Linux the last several months. Here's the situation: I have 10 Raspberry Pi's (3B+) with hostname rpi-100 to rpi-109. I am trying to automate ...
0 votes
1 answer
112 views

Run a shell script on first boot

I want to make a script that runs on boot, as I'm making a PowerShell script to install the Raspberry Pi OS. It needs to install some things on boot. How do I make a script to run on first boot and ...
2 votes
1 answer
116 views

Traffic Light Led Change During NOAA Satellite Script?

I have the following script that downloads and processes NOAA satellites. I'd really like some external LEDs to indicate the following; When the script is running, turn or blink red When the script ...
1 vote
1 answer
363 views

Pi Zero, Retropie on top of Raspbian?

I know you can install RetroPie on top of Raspbian on a Pi 3 but what about a Zero W? Do I need to get a different setup script and install RetroPie or do you just do everything the same way and it ...
0 votes
1 answer
52 views

How can I have the raspberry pi run scripts portably?

I am a noobie and just got a raspberry pi yesterday and I want to create a wifi strength device with my raspberry pi. I have a wireless adapter and alreaady made a script for my linux machine. It ...
0 votes
2 answers
2k views

play audio stream when bluetooth connects

I have a Raspberry Pi Zero W and want it to use as an Internet Radio. So I wrote a Python script that connects to my bluetooth speaker and starts a stream. Everything works fine, but i always need to ...
1 vote
2 answers
220 views

Can't get Cron to run python script

I'm trying to set up porkbun dynamic dns python script to run at reboot via Cron (later I'd like to run it hourly, but baby steps...) following porkbun's tutorial https://www.youtube.com/watch?v=...
0 votes
1 answer
143 views

Can the Raspberry Pi detect when the screen turns off for a script?

I’m running a Raspberry Pi in my car with an official screen (link: https://www.amazon.com/dp/B073S3LQ6Q/ref=cm_sw_r_cp_api_i_dl_ZSPC0NJXFQVBZ19PXGCP?_encoding=UTF8&psc=1). It’s for obd. When I ...
0 votes
2 answers
3k views

Launch kodi from startup and play track

Sorry if its been answered a lot. I am new to scripting and would like to know where I start to do this. I want to script it myself but would like to know what I need to do to start kodi in ...
1 vote
1 answer
795 views

Retrieve data from Smart Plug via Raspberry Pi (need help with python script)

I am using a tutorial from BeardMonkey in order to retrieve and store the measured data from a smart plug (a smart plug is monitoring the power consumption of my kettle at the moment) https://www....
1 vote
1 answer
1k views

UDEV won't run any script, file or inline

I have a Raspberry Pi 3 model B. I installed Raspbian using NOOBS, and it worked great. I had a project that needed to execute certain actions when a USB device was connected. I learned about udev, ...
1 vote
2 answers
45 views

GPIO input pins high at 3V, and detect when ground is connected when I want it to detect when 3V is connected

This is on a Raspberry Pi Zero 2 W The physical pin 3 and 5 (gpio2 and gpio3) are the input pins I am using and for whatever reason, they are at default 3V and detect a change when they are connected ...
1 vote
2 answers
3k views

Script Using CEC-Client Will Turn on TV OR Change Input But Not Both

I'm trying to use this script to turn on a TCL TV and change the input to RPi using cec-client: echo 'on 0' | cec-client -s echo '4f:82:10:00' | cec-client -s It will turn the TV on, but not change ...
0 votes
1 answer
86 views

Working ssh tunnel script does not work when executed by 'on boot' techniques

The following works flawlessly, in that it allows me to access a webpage hosted on the Pi at my domain which is hooked up to a google compute vm. pi@raspberrypi:~ $ ./pi_home_reverse_proxy/scripts/...
1 vote
1 answer
646 views

Send GPIO trigger(s) at specific video timecode(s)?

Just starting out in the wonderful world of RPi maker projects, scored a Model 2b v.1.1, installed the latest Raspbian and now ready for my first project :-) What I want to build is a video player for ...
1 vote
2 answers
2k views

Switch Raspberry (RaspAP) from an AP to a Wifi Client in a script

Switch Raspberry Hotspot "RaspAP" (wlan0) to a simple Wifi Device via a script What is missing #!/bin/bash # This script will stop the RASPAP Hotspot (AP+DHP) and will Switch your ...
1 vote
1 answer
52 views

run script after some device from dhcp ip pool connect to hotspot raspberry pi 4

I was searching answer from over a week and still don't find it. I'm fresh user of raspi and linux and network config so be patient for my stupid questions :) I describe my problem. I used raspi to ...
0 votes
0 answers
563 views

RPI connected to a smart plug -> how to auto turn off plug after RPI shutdown?

In short: I was wondering if it is possible to send a command to a smart plug when the pi is good to kill it's power. background I'm running a 3d printer which I'm going to control with a rpi 4 using ...
0 votes
0 answers
21 views

Monitor lightbox project – does this exist yet?

I have a second monitor next to my iMac. What I’d like to do is set up a Pi that simply outputs solid colour to the monitor over HDMI or composite (it has both), thus allowing me to use it as a video ...
0 votes
1 answer
229 views

Raspberry Pi POCSAG mail script

I have a Raspberry Pi configured as a Pocsag receiver with a RTL-SDR USB stick. Everything works just perfect, and it receives signals and messages. I then found a script that was supposed to be able ...
-1 votes
1 answer
73 views

New to PI-Automatically move files from sd card to Syncology NAS

My goal: To have video copied from an SD card that is inserted into a Pi 4B using a USB SD Card reader copied to a network share and put in folders based on dates. My scenario. I come home from ...
2 votes
2 answers
3k views

Raspberry pi starting shell script at boot not working

I've been trying to implement a custom procedure triggered by a button connected to my raspberry pi. To do that I've tried to launch a python script on boot that always listens to the button trigger. ...
2 votes
1 answer
3k views

SIP client for Raspberry Pi, receive call, wait for DTMF tones (button presses) -> run Python script

I'm looking for a SIP client for my Raspberry Pi (commandline). I want to be able to call my Raspberry Pi, and based on what buttons I press on the phone (resulting in DTMF tones), run the correct ...
1 vote
0 answers
116 views

Script only works after opening browser and closing it

I have a script to open 2 webpages one on each monitor. The end of the script selects one of the pages and enters in login credentials. The script works great and I have it working with systemctl to ...
2 votes
2 answers
11k views

Run a shell script from a python script when a button is pressed

I'm trying to create a very simple python script that waits for a GPIO button press and then runs a shell script. I personally don't know much about python so what I've come up with is mostly from ...
-1 votes
2 answers
66 views

Start script not working

I have a script that starts my GPIO website server. This allows my phone etc to accress the switches that control certain elements in my camper I would like it to start at after boot in the case of ...
7 votes
3 answers
7k views

Clone Raspberry Pi SDCard to file on Mac OS X?

Is there a simple way using Mac OS X (shell preferred) to clone an entire SDCard from the SDCard slot (byte-for-byte)), to a file? I would then want to reverse the process and restore the image from ...
1 vote
3 answers
1k views

script runs at terminal - but not in cron

I'm logged in as user pi via SSH and have a wifi checking script wifi_test_1.sh in the following directry: /usr/src/scripts/wifi_test_1.sh When i enter the command /usr/src/scripts/wifi_test_1.sh ...
2 votes
4 answers
2k views

Running multiple scripts from different languages

This is mostly a conceptual question. Is it possible to have two scripts running on a Raspberry Pi, where one is a Julia script, and one is a Python script? In the most general case of this, is there ...
0 votes
0 answers
94 views

command is working on terminal but not in the script

I am using raspbian in headless mode and I am trying to mount USB on USB insertion. Script is executing but USB mount command failing. here is the script, filename is automount.sh (this script gets ...
0 votes
1 answer
5k views

"bin/bash: bad interpreter: No such file or directory" when running shell script

I wrote a shell script for my Raspberry Pi and made it executable. When I run ./filename.sh, I see an error: bash: ./filename.sh: bin/bash: bad interpreter: No such file or directory I wrote this ...
-2 votes
1 answer
110 views

Why my code doesn't run when I reboot the raspberry?

So to start in what I tried. first this is the code that I wrote to run import subprocess import pyautogui import urllib.request import time while(1): x = str(pyautogui.position()) time.sleep(...
2 votes
1 answer
223 views

Raspberry pi capture desktop without any connected monitor

I want to capture raspberry pi desktop without connected monitor. IS it possible to run a program capture with script at boot up and record the desktop? Or the raspberry pi must be connected with ...
0 votes
1 answer
65 views

Availability of R packages on Raspberry Pi

I couldn't find it by googling. Are all usual R packages from CRAN also available in R on Rasbian on Raspberry Pi? What is the current supported R version on Pi 4?
0 votes
0 answers
69 views

Error in autorun script, RASP 3

I need to run a script in lxterminal in boot. The unit is headless, just have a digital button to start the process in the code. I already have a automatic pi user loggin and a .desktop created in ...
0 votes
0 answers
209 views

PIR Sensor Counter

Hey guys I'm trying to create a simple script that essentially counts the amount of people that reside within a room, by having an entry sensor and exit sensor and tells you how many are within the ...
0 votes
1 answer
629 views

Crontab does not work

I am trying to run either at boot or at intervals of 5 min (everytime basically) a command that enables me to use my remote control. Thus sudo crontab -e -u root, I add in crontab the following line: *...
0 votes
1 answer
127 views

How do I use the Pigpiod read function within a script

Im trying to use the read function from the pigpio library inside of a pigpiod script. Here is how: detect = pi.store_script('tag 1 inr p0 r4 jp 1 tag 2 r 4 jz 2 tag 3 inr p1 r 4 jp 3 jmp 1') My ...
1 vote
2 answers
3k views

Fuse Mount Option "-nonempty" is Not Working

I have a setup where I need to log quite a bit of data on my Raspberry Pi. I have a 128GB USB stick that mounts to a folder called external where all my scripts/programs log to. This works well, ...
0 votes
2 answers
515 views

Trouble getting picam to take a photo on boot (init..d method)

I want the camera on my pi (Rpi 3B+) to take a picture every time it boots up. I've read through several other questions of people trying to do similar things, but I haven't ever found the script that ...
2 votes
0 answers
310 views

Running Simple Script On Every Boot

Want to run a bash script start.sh with one command that executes tmux and ffmpeg at startup on my Raspberry Pi 4B. The RPi OS loads the Desktop, but to interact with the process only need a terminal (...
1 vote
2 answers
64 views

Web App on computer : Ssh connection to PI + script execution possible? [closed]

I'm sort of new with web app programming so sorry if it is obvious for you guys! I appreciate the time you take for me ! I tried to explain my problem the best I could in the title! :p I am building ...
0 votes
1 answer
222 views

pi 4 - Power present

I am using a pi4 and pijuice. Is it possible with a script or python to check if power is present in my Pi4?(usb port) I am using my pi4 headless with as a web server(online). I would like to know ...
1 vote
2 answers
2k views

Boot script to check for dirty bit/corruption on a USB stick or SD card

I posted this question on the Raspberry Pi forum but got no activity. If it is a dumb question or something else, please say so... While not often, I do experience power outages which stop one of my ...
-1 votes
3 answers
218 views

How to automatically run a script on boot / startup?

I have trying to get a script to run at startup to mount a flash drive and change ownership on dynamically created files. I have not been successful in getting the script to run. It only runs when I ...
-1 votes
1 answer
549 views

Execute a script on startup in latest NOOBS OS - Raspberry - Pi 3B+

Actually I have went through this stack answer and followed the 3rd Type for running the script on startup, and It works like a charm for previous version of NOOBS. Today I downloaded the latest zip ...
2 votes
0 answers
8k views

ufw Error: Couldn't determine iptables version [closed]

I am currently working on an automated shell setup script for my Raspberry Pi 4. This includes installing and setting up ufw as my firewall. However, I'm currently stuck with configuring ufw. My ...
0 votes
2 answers
223 views

ssh shuts down when screen turns off

I have ssh running on boot, on my raspberry PI, it works fine, until the screen shuts off, or it goes into a sleep mode, or whatever its doing. Then ssh becomes unresponsive, and I cannot establish ...

1
2 3 4 5