Network based (remote) radio power on/off

G2 operating system and special app's (e.g. p2app) discussion only--post Thetis and piHPSDR questions in their own sub-forums
K1VL
Posts: 5
Joined: Mon Aug 28, 2023 9:00 pm
Location: Shrewsbury, Vermont

Network based (remote) radio power on/off

Postby K1VL » Thu Sep 21, 2023 12:34 pm

I was wondering if there is a software feature (or a plan for a feature) that would allow for the G2 to be remotely turned on and off. Right now after I apply 12 volts to the radio I have to physically push the power button to turn it on. To turn it off gracefully I have to push the power button once momentarily to allow graceful shutdown of the Pi and then long press again to power off the radio, so there is some logic in the power switch function. As I almost exclusively run my G2 (no front panel) in a rack at a distance from my operating position it would great to have it stay in a lower power standby mode with software on/off capability for the radio and Pi.

I have Flexradio 6000 series radio and there is a graceful remote on/off capability by way of an external relay. I use a web enabled switch to control that function.

Carmine K1VL
Carmine K1VL
User avatar
w-u-2-o
Posts: 5919
Joined: Fri Mar 10, 2017 1:47 pm

Re: Network based (remote) radio power on/off

Postby w-u-2-o » Thu Sep 21, 2023 1:57 pm

Knowing that the G2 uses a CM4 GPIO pin to facilitate safe shutdown, it should be possible to create a script to shut it completely down. However, there is no way to get it to turn back on again because the CM4 is completely shut down and powered off.

The best approach is probably to use the same type of external relay you are using with the Flex. Obviously you'll have to add an external connection across the terminals of the main power switch.
ct1iqi
Posts: 45
Joined: Thu Jul 06, 2023 4:01 pm

Re: Network based (remote) radio power on/off

Postby ct1iqi » Fri Sep 22, 2023 9:18 am

Had same question and came to same conclusion on basis of circuit diagram: no go. Once off but with supply voltage present one cannot switch the G2 on, other than by the button. Am experimenting with this item:
aliexpress.com/item/1005005526322149.html which I happen to use in other applications and is very reliable. It can work from 5-24 V, connects to LAN, and has commands to close a relay for ~1/2 s, or 1, or multiple seconds. It has two relays, so one left for something else.
Software: https://github.com/cryxli/sr201 and https://sr-201-relay.sourceforge.io/
The copper trace distances on the PCB for the two relays are OK for 12V but would not trust it at 230V AC.
The short/long press timing of the power button is depending on RC values, so not very exact. I hope the shortest and fixed 1/2 s relay timing will fall well within the button timing for 'short' press.
ct1iqi
Posts: 45
Joined: Thu Jul 06, 2023 4:01 pm

Re: Network based (remote) radio power on/off

Postby ct1iqi » Fri Sep 22, 2023 3:26 pm

some results:
with the above mentioned 2-relay board one can indeed reliably switch the G2 on.
But when giving the 1/2 second shorting of the power button to turn off, this turns out to be to long. The power is switched off immediately.
The 'short' button press needs to be quite short. For now I'll issue a shutdown command to the CM4 per ssh, prior to operating the relay for 'off'. Alternatively one could use the second relay to signal the CM4, without influencing the power switch circuit itself. The CM4' OS has GPIO26 configured as input and associated with the shutdown command. It is present on pin 37 of the 2x20 header. As I am not using the XLR microphone connector, I used it as feed through for the 2-lead cable to the external relay board, so as for the time being not to have to drill a hole and damage the G2. Also the connection of the relay wire to the switch wiring can be done in a reversible way by preparing two short leads that have on one side a single pin male header connector, and on the other a female, and half-way the relay wire soldered. Now can switch everything on from a bash script that first switches on the power supply, using a Sonoff MQTT mains switch, followed by switching the G2 on via the relay board, followed by starting pihpsdr on the PC. An 'off' script makes pihpsdr on the PC do an exit, storing its settings, followed by a ssh command to the G2 to shutdown ( sudo /sbin/shutdown now' ), followed by the relay board powering off the G2, followed by powering off the power supply per Sonoff switch. To prevent ssh having to login per password, the PC's RSA public certificate is put in a 'authorized_keys' file in /home/pi/.ssh
g6phf
Posts: 22
Joined: Fri Oct 11, 2024 9:23 am

Re: Network based (remote) radio power on/off

Postby g6phf » Sat Nov 09, 2024 9:56 pm

I’ve been setting up remote connection to my pc with thetis and mumble, but only really just thought about power on.
Can’t believe there isn’t a standard way to do this remotely that does not require jumping through these hoops!
Michael
Posts: 56
Joined: Fri Sep 13, 2024 7:27 pm

Re: Network based (remote) radio power on/off

Postby Michael » Thu Feb 20, 2025 4:29 pm

After some try and error I decided to put a powerful PC next to the G2 and to operate it remtoely using Chrome Remote Desktop. The PC can be swicthed on using Wake-On-Lan. In order to switch on and off the G2 I consider yo use an USB Relay connected to the PC and prpogrammed for the required G2 On/Off sequences.

Has anybody doen this before? I assume that only the power cable of the G2 internal switch need to be switched (through the parallel connection of the USBrelay. Is this correct or need other cables be switched, too?

73, Michael, DF2RQ
laurencebarker
Posts: 304
Joined: Mon Nov 11, 2019 7:39 pm

Re: Network based (remote) radio power on/off

Postby laurencebarker » Thu Feb 20, 2025 7:02 pm

I'm about to prototype a change to the power management that might enable this. I have planned to make the front panel pushbutton contact accessible so that it can be operated by a relay.

The difference from now is: you will be able to have the relay operate for longer. It won't cause the power to swich off again.

I don't know yet whether it would be a DIY modification though!
Laurence Barker G8NJJ
Michael
Posts: 56
Joined: Fri Sep 13, 2024 7:27 pm

Re: Network based (remote) radio power on/off

Postby Michael » Mon Feb 24, 2025 8:09 am

Thanks, Laurence - I will give it a try with a single USB controlled USB relay, just switching the 12V by a software programmed for the timing sequence needed for the G2.

Best regards,

Michael
Michael
Posts: 56
Joined: Fri Sep 13, 2024 7:27 pm

Re: Network based (remote) radio power on/off

Postby Michael » Tue Apr 08, 2025 11:14 am

Just realized that I never provided feedback.

The solution with the relay works flawless. If you are interested in the Python Script and the switching duration, just PM me.

Cheers,

Michael

Return to “G2 Operating System & Applications”