G2 Startup file
G2 Startup file
Looking for some guidance on how to change the startup on my G2 with screen if possible to NOT load up PIHPSDR. I am not very Linux savvy, but can follow directions. I did the updates this morning without trouble. I am fine if I still need to click the P2APP for Thetis and PIHPSDR to load it just not auto starting PI each time the rig is turned on. Thanks 73 John
-
- Posts: 227
- Joined: Mon Nov 11, 2019 7:39 pm
Re: G2 Startup file
loading programs at startup is controlled by the /etc/rc.local file.
The instructions below are from the manual and tell you how to add or edit the settings for p2app. I suspect your file will instead have something to run piHPSDR (eg ./pihpsdr) in the red section. Find that line and delete it.
It is possible to set programs to run automatically after power up. This is a standard linux function and seek advice from websites covering the Raspberry Pi if in doubt. These instructions cover running the p2app application, but others can be started similarly.
Please be careful when doing this: it requires administrator permission, and can cause harm if incorrectly completed.
Use your favourite text editor to edit the /etc/rc.local file so it comes out like this:
pi@raspberrypi:~ $ sudo geany /etc/rc.local
#!/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.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
cd /home/pi/github/Saturn/sw_projects/P2_app
./p2app &
exit 0
Then save the file and and exit
The instructions below are from the manual and tell you how to add or edit the settings for p2app. I suspect your file will instead have something to run piHPSDR (eg ./pihpsdr) in the red section. Find that line and delete it.
It is possible to set programs to run automatically after power up. This is a standard linux function and seek advice from websites covering the Raspberry Pi if in doubt. These instructions cover running the p2app application, but others can be started similarly.
Please be careful when doing this: it requires administrator permission, and can cause harm if incorrectly completed.
Use your favourite text editor to edit the /etc/rc.local file so it comes out like this:
pi@raspberrypi:~ $ sudo geany /etc/rc.local
#!/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.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
cd /home/pi/github/Saturn/sw_projects/P2_app
./p2app &
exit 0
Then save the file and and exit
Laurence Barker G8NJJ
Re: G2 Startup file
Thank you, I’ll give it a look and see if I can find it. Appreciate your response.
Best 73
John
Best 73
John
Re: G2 Startup file
I opened the /etc/rc.local file and it doesn't run anything at startup on my G2 100 front panel.
I also checked crontab -e and the crontab service is not setup.
For my third strike I tried /etc/xdg/autostart and the only executable file was a script that prompts a password change when ssh is enabled and the password is still defaulted.
George / W7GES
I also checked crontab -e and the crontab service is not setup.
For my third strike I tried /etc/xdg/autostart and the only executable file was a script that prompts a password change when ssh is enabled and the password is still defaulted.
George / W7GES
Re: G2 Startup file
I looked in the /etc/rc.local file and could not locate the part that loads the PIHPSDR on boot up.
73 ~ John
73 ~ John
Re: G2 Startup file
It seems you just have to add the path with the executable to the file above the 'exit 0'
Here is an example:
"...............
#!/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.
/usr/bin/tool # a programm
/usr/local/bin/script.sh # a shellskript
/etc/init.d/dienst start # a service
exit 0
"
Here is an example:
"...............
#!/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.
/usr/bin/tool # a programm
/usr/local/bin/script.sh # a shellskript
/etc/init.d/dienst start # a service
exit 0
"
Re: G2 Startup file
Has anyone had any luck locating the proper file and deleting it? I’ve looked without success.
Thanks 73 John
Thanks 73 John
Re: G2 Startup file
Try editing the /etc/xdg/lxsession/LXDE-pi/autostart file. This worked on my G2 with front panel display.
Comment out either pihpsdr (if you have a G2 Front panel and don’t want pihpsdr to start) or p2app.
You will need to use the sudo command to run as root to edit the file.
A # sign at the beginning of the line will comment out that line.
For example sudo nano /etc/xdg/lxsession/LXDE-pi/autostart will open the file. Put your cursor at the beginning of the line that starts p2app and add a #. Press control + x to exit. A message will ask if you would like to save the file press Y and then the enter key and it will save.
Restart your pi and the G2 should start with the desktop view.
George / W7GES
Comment out either pihpsdr (if you have a G2 Front panel and don’t want pihpsdr to start) or p2app.
You will need to use the sudo command to run as root to edit the file.
A # sign at the beginning of the line will comment out that line.
For example sudo nano /etc/xdg/lxsession/LXDE-pi/autostart will open the file. Put your cursor at the beginning of the line that starts p2app and add a #. Press control + x to exit. A message will ask if you would like to save the file press Y and then the enter key and it will save.
Restart your pi and the G2 should start with the desktop view.
George / W7GES
Re: G2 Startup file
Thank you George it worked just fine. Now I can fire up the rig and opens to the Home Screen. Really appreciate your response!
73~ John
73~ John