Raspberry pi with auto start

265 Views Asked by At

Can anyone point me in the right direction please? My C and Python skills are limited, but I have set up a R-pi3b to run a python program at boot and it is fine. I have also added a script to shut it down easily using GPIO3.

My problem is that once running, the keyboard is ineffective and I cannot get out of the script except by SSH and killing the process, which is fine if the network remains the same, but it has to move between different locations. This means I cannot access the existing Wi-fi I.P. address from the new location.

Is there a simple way (maybe using an IO interrupt) to exit the program and get back to terminal or the GUI so that I can manually alter the wi-fi details and then be able to SSH in?

The Python script running is "picframe" based on 3piD viewer as detailed here: https://www.thedigitalpictureframe.com/how-to-add-crossfading-slide-transitions-to-your-digital-picture-frame-using-pi3d/ which works very well by the way.

I am using Raspbian Buster release as suggested in the above link. PC is Windows 10 64bit.

I have tried various suggestions to allow access by re-writing some parts of the sd card from windows, and tried to follow some tunneling ideas but none have been successful. The only way I seem to be able to change the address is by reloading the whole OS and the program again which is frustrating and time consuming.

As I cannot get to the terminal at bootup there is no way to access it, unless I have missed something very obvious, using the keyboard and the external SSH will not connect either.

Any help would be appreciated.

2

There are 2 best solutions below

0
dangerous2A On

I missed the obvious! USE THE LAN PORT! Then access via PuTTY and set the new WI FI details, but I would still value help on quitting the program and returning to the GUI or terminal while the program is running. Ctrl + C or Z have no effect and it seems as though the keyboard is totally bypassed.

Sorry for the stupid question!

0
dangerous2A On

How are you running your program at boot? Have you tried to exit the program with Ctrl + C? Have you tried opening another terminal window with Alt + Ctrl + F2, for example?

It is a service that starts from systemd/user and is a python script.

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys

from picframe.start import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())  

I had not come across Alt + Ctrl + F2 but will try it as soon as I get back to it. Thanks