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
-2
votes
1answer
31 views

I'm trying to make a shell script that can mount a exFAT drive

Hi I am trying to make a shell script that can create a directory (/mnt/drive) and mount a exFAT drive in that directory on my raspberry pi 2. The problem I am having is that when I try to run the ...
1
vote
3answers
57 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
vote
1answer
63 views

Permissions error with logrotate [closed]

I am using a script to monitor a service. I have added said script in crontab. crontab runs the script every one minute. I have found this script online and it works pretty good, but it writes the ...
1
vote
2answers
111 views

Wiring Pi Issue - #!/bin/bash vs #!/bin/sh

I am working on a project and have an application shell script. For function part, I need the GPIO access, and for that, I am using the standard wiringpi package. The issue I am getting is with the #...
1
vote
1answer
125 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 ...
1
vote
1answer
31 views

Coproc in shell script

I'm trying to do a simple shell script that will make my raspberry's bluetooth discoverable but i'm facing some issues. My raspberry is running Raspbian. Running this through command line works ...
0
votes
0answers
20 views

Howto tell the difference between a RP3B and RP4B from a script? [duplicate]

I want to create scripts that configure RP3 and RP4 software installations using Raspbian Lite. The scripts need to know the difference between an RP3B+ and and RP4B. How can I do that? Dazz
1
vote
0answers
30 views

shell script does not invoke define variable in autostart script

I try to use the raspberry pi for power point presentation. I want to run this as auto ( I mean once the raspberry pi started or rebooted the power point presentation should run). Basically it works ...
3
votes
1answer
29 views

Include File With Raspbian Setup

I am working on a project which requires many raspberry pi's to be set up pretty much the same way. In order to set up the pi's we put NOOBS on the micro SD card and then install raspbian onto the pi. ...
2
votes
3answers
98 views

Python script won't load on startup

I have tried like 5 methods to get this script loaded after raspi3 load. #!/usr/bin/python3.7 #sudo python /home/pi/masterBaseInterface.py import socket # Import socket module import ...
2
votes
2answers
77 views

how to update customised OS image to a newer version keeping modification?

I am using Hypriot as OS . I have done modifications to some file and script,and i have add new service on boot . I would like to know if i have a newer version of Hypriot how can i update my ...
-1
votes
1answer
56 views

Disable autologin on tty1 on stretch 9.9

I found this answere but it doesnt work anymore. How does it work on the new version?
2
votes
4answers
66 views

Pi - own python startup script in the wrong order

I've written a python script to connect to mysql & insert the current time then close. The use case is if my Pi browns out/restarts (often does) the time of this event will be logged. The script ...
0
votes
1answer
149 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 ...
0
votes
3answers
362 views

Use a bash file to open a lxterminal and run commands into it automatically

I have made a python application for raspberry and it needs to run into a terminal. That's totally necessary. To do that I wrote two bash files, run_.sh and launcher.sh. run_.sh execute the python ...
0
votes
1answer
52 views

I want to do this, what programming languages and libraries do I need to know?

I want to run a program or script on Raspberry Pi 3B+, which allows the user to set an amount of time for it to connect to WiFi 1, after the expiry of that time it has to connect another WiFi 2 for ...
0
votes
0answers
40 views

Can't run a command using Raspi_Runner

I've setup Raspi_Runner to auto run commands reading from a text file every x minutes. Raspi Runner is a BASH script which runs all your scripts delivered by e-mail. It works good with commands like ...
2
votes
2answers
39 views

How do I make a Java application I made run as a deamon?

I have a Java Application is going to be my Discord Server's bot. How do I make this application run as a daemon on a Raspberry Pi, it uses the latest version of Raspbian and the Java application ...
2
votes
2answers
559 views

Run script with virtualenv on init

I have bash script which loads a virtualenv and run 3 python scripts. I have tried to init on startup by ini.d and rc.local methods but it doesnt work and I have no idea why is not working but if I ...
2
votes
1answer
96 views

Run bash script after New WiFi connection

Noobs installation. I've a script which needs to be run after a new WiFi connection is set. Is there any way to run this script automatically once we connect/set WiFi?
1
vote
1answer
200 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....
4
votes
2answers
303 views

Visualize execution of scripts

I have a script that always runs on the Raspberry Pi. I defined with sudo nano /etc/rc.local so that they turn even after a reboot or a power failure. My question is how can visualize the execution ...
0
votes
2answers
870 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. ...
1
vote
2answers
757 views

Why doesn't my autostart file run a simple shell script

I am trying to launch a simple script (let's say it is /home/pi/python/python_code/hello-world.sh) from the /home/pi/.config/lxsession/LXDE-pi/autostart file. I have added the following line to the ...
-1
votes
3answers
509 views

Runing python script after startup

R Pi 3 B+, Raspbian I would like to run a Python script after the Pi has booted up. There loads of posts about this like here & here & here. They either dont work or I just plain dont ...
0
votes
1answer
62 views

Python script execution time limits?

I have a python3 script called bot.py which is running a simple (for now) telegram bot, and I can retrieve some PI system states. It's required to maintain the bot online, so I added next string to ...
0
votes
0answers
21 views

How to suppress the “The desktop has been updated…” prompt?

I have written a "setup" script to customize a stock Raspian (stretch) image for use in my application, and it includes apt-get update && apt-get upgrade. This was working great last time I ...
0
votes
0answers
24 views

Help with connect / disconnect script

Very noob to Pi programming but am tech savvy. Can somebody help with the 2 questions below: 1) How to I go about setting a script to run boot 2) Can you also help with a script to do the following: ...
1
vote
0answers
60 views

Calling a program from /etc/rc.local

I have a simple script that adjusts the monitor's brightness that is set to run on startup. #!/bin/bash gpio -g 18 1024 gpio -g mode pwm gpio pwmc 1000 gpio -g 18 800 I am calling this script from /...
1
vote
1answer
775 views

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

I've been using qbittorrent-nox on a headless Raspberry Pi 3 B+. The setup was a breeze. But then I wanted to autostart qbittorrent after boot, so I wrote a systemd service unit and enabled it. It ...
2
votes
2answers
95 views

Waiting for network connectivity instead of just sleep fixed time

I'm new to the whole Raspberry Pi and Bash scripting thing, so bear with me. I run raspberry autopilot on a remotely controlled vehicle thru a 3G/4G connection. Raspberry Pi is installed onboard the ...
0
votes
0answers
41 views

Rotate script output on my TFT 3.5

I'm trying to use my TFT 3.5 screen on my rpi to rotate different scripts. The idea is to show pihole dashboard, digital clock and a custom message. I have tried to do it using the crontab: */3 0 0 ...
2
votes
1answer
37 views

Monitoring NICs on the Pi

Is it possible to have a script running as a service constantly monitor certain NICs and alert me throught LEDs if one of them has been disconnected or is not properly detected by the OS? Would ...
1
vote
1answer
223 views

Controlling Raspberry pi3 Wirelessly with HTML (Lighttpd)

I've been working on a Obstacle avoidance robot using Ultrasonic and IR sensors. The scope of my project is to execute my program over the air. Control the robot's movement using mouse or touch ...
0
votes
2answers
335 views

auto execute a terminal command in raspberry pi startup

I am working on a pi project which uses audio out through HDMI. I am using respeaker mic for audio in. My problem is everytime when I startup the pi, the default audio is analog. I need to change it ...
0
votes
2answers
73 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 ...
0
votes
1answer
668 views

run bash script at startup

i needed 50+ rp points to comment on this one: Run bash script on startup my "problem" is that i use adafruits read only script: https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/...
1
vote
2answers
3k views

Run a script at shutdown on Raspbian

I'm trying to run a script right before my Pi shuts down. OS: Raspbian Stretch Here is what I did so fare: put my script (name: sendir) in /etc/init.d/ created a symbolic link to it in /etc/rc6.d ...
-2
votes
1answer
82 views

How to compare if the cpu serial is correct

I have a question. I would like to check when the raspi system starts or if the serial cpu is correct. If not, he would be rebooting. So he would be doing reboot loops all the time. I found the ...
0
votes
1answer
2k 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
2answers
2k views

How did I launch this Python script at boot?

I have a Python script running at boot, on a Raspberry Pi, and of course I didn't write down how I set it up. Now I need to change it, and I can't for the life of me figure out how it's getting ...
0
votes
1answer
204 views

My script in init.d fails on boot, fails as a service, but works fine when executed manually

I created the following script in /etc/init.d/bootscript.sh The script has these permissions: -rwxr-xr-x 1 root root 855 Aug 1 22:44 bootscript.sh # /etc/init.d/bootscript.sh ### BEGIN INIT INFO # ...
0
votes
0answers
42 views

printing info from weather utility [duplicate]

I've download the weather-util on raspberry pi. Is there a way to print the info from a python script? Say you want the weather info for jfk, so the command is weather jfk.
4
votes
2answers
3k views

Setting timezone non-interactively

What's the best approach for configuring the Time Zone non-interactively? Previously for hostname, I've used sudo raspi-config nonint do_hostname However, I am unable to locate the equivalent ...
0
votes
3answers
110 views

Raspberry Pi Random Turns Off

So, I was doing a project with PWM (Pulse-width modulation) but something unsual happens, my raspberry pi turns off. I am using a RPi model 2B, and my circuit looks as follows simulate this circuit &...
1
vote
0answers
40 views

Unwanted calls of program with GPIO

I configured a Raspberry Pi 2 with a button. I have a script in python, which will call a command, if someone press the button. The command doing a sip phone call to a phone server (cisco ...
-1
votes
1answer
229 views

Force Sensing Resistor with Raspberry Pi

I have a school project where I have to make a car park with a fully functional parking lot checking system. The FSRs job is to detect any weight and send a signal to the raspberry pi that the ...
-3
votes
1answer
283 views

How to write a script which execute multiple commands on multiple terminal windows

I am trying to make a script on the following basis: Open a terminal window (keep it open) and run cd ~/dir/dir/dir ./exec Open a second terminal window (keep it open) and run /usr/bin/xterm -font/...
0
votes
1answer
282 views

Run script to setup Socks Proxy on Pi Startup

I'm new to the Pi, and have come across heaps of streams that seem to need you to pair using the same IP before they will play - Openload etc... I read and found you can create a socks proxy that ...
1
vote
2answers
148 views

Run script on boot.

I want to know my Public IP address of PI using script and script should be start running automatically when my raspberry pi boot and Store output in some file, so that i can use later on. Actually, ...