G2 Startup file

G2 operating system and special app's (e.g. p2app) discussion only--post Thetis and piHPSDR questions in their own sub-forums
K5WC
Posts: 23
Joined: Sun Apr 16, 2023 10:59 pm

G2 Startup file

Postby K5WC » Mon Aug 28, 2023 10:48 pm

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
laurencebarker
Posts: 225
Joined: Mon Nov 11, 2019 7:39 pm

Re: G2 Startup file

Postby laurencebarker » Tue Aug 29, 2023 7:24 am

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
Laurence Barker G8NJJ
K5WC
Posts: 23
Joined: Sun Apr 16, 2023 10:59 pm

Re: G2 Startup file

Postby K5WC » Tue Aug 29, 2023 12:51 pm

Thank you, I’ll give it a look and see if I can find it. Appreciate your response.

Best 73
John
W7GES
Posts: 77
Joined: Sat Mar 13, 2021 6:56 pm
Location: Phoenix AZ

Re: G2 Startup file

Postby W7GES » Tue Aug 29, 2023 10:31 pm

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
K5WC
Posts: 23
Joined: Sun Apr 16, 2023 10:59 pm

Re: G2 Startup file

Postby K5WC » Thu Aug 31, 2023 11:35 am

I looked in the /etc/rc.local file and could not locate the part that loads the PIHPSDR on boot up.

73 ~ John
User avatar
DL1OF
Posts: 28
Joined: Tue Apr 11, 2017 12:38 pm

Re: G2 Startup file

Postby DL1OF » Thu Aug 31, 2023 12:12 pm

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
"
vk1hx
Posts: 188
Joined: Fri Sep 13, 2019 12:03 pm
Location: Australia

Re: G2 Startup file

Postby vk1hx » Fri Sep 08, 2023 11:16 pm

..
73, Phil - VK1HX
K5WC
Posts: 23
Joined: Sun Apr 16, 2023 10:59 pm

Re: G2 Startup file

Postby K5WC » Sun Sep 10, 2023 4:26 pm

Has anyone had any luck locating the proper file and deleting it? I’ve looked without success.

Thanks 73 John
W7GES
Posts: 77
Joined: Sat Mar 13, 2021 6:56 pm
Location: Phoenix AZ

Re: G2 Startup file

Postby W7GES » Tue Sep 12, 2023 11:16 pm

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
K5WC
Posts: 23
Joined: Sun Apr 16, 2023 10:59 pm

Re: G2 Startup file

Postby K5WC » Wed Sep 13, 2023 12:51 am

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

Return to “G2 Operating System & Applications”