Ryde watchdog and reset

Discussions about the Ryde "Set-top Box" Style Digital ATV Receiver. See https://wiki.batc.org.uk/Ryde_Receiver
g8lce
Posts: 346
Joined: Sun Dec 06, 2015 10:26 am

Ryde watchdog and reset

Post by g8lce » Thu Dec 17, 2020 4:21 pm

Working on the Ryde for GB3NQ I would like to reset the Ryde if there are problems probably every day. The Ryde has kept going for days in tests but can sometimes get into 'LongMynd not loaded' if there is any power hiccups. There are power watchdogs around that can be controlled using the I2C bus but require a GPIO pin to pulse them and they are like hens teeth on the Ryde. The way I was thinking of doing it was to earth pin 26 (Hardware Shutdown) then after 20 seconds turn power off for ten seconds then on again. I am sure this will work but requires some sort of electronics, 555's or microcontroller? It should be a simple thing to do.
What have others done? GB3ZZ uses relays etc. I was hoping for an off the shelf answer.

Martin G8LCE

g8lce
Posts: 346
Joined: Sun Dec 06, 2015 10:26 am

Re: Ryde watchdog and reset

Post by g8lce » Thu Dec 17, 2020 4:57 pm

For example here is a board that would work and do all the watchdog and rebooting schedule but it uses GPIO 4 !!

http://www.uugear.com/doc/WittyPi3_UserManual.pdf



Martin G8LCE

g8lce
Posts: 346
Joined: Sun Dec 06, 2015 10:26 am

Re: Ryde watchdog and reset

Post by g8lce » Thu Dec 17, 2020 5:16 pm

I have had a thought that maybe for a repeater the button GPIO i/os could be ignored and then if the WittyPi3 was used the the Valid RX Signal GPIO 4 could be moved and the Witty would work. Also not sure about GPIO 7.

Any thoughts or comments?
I know the Pi4 takes more current.
If anyone thinks this may be useful for repeater use then it would be good to get some form of agreement on a standard or shoot it down in flames!

Martin G8LCE

g8lce
Posts: 346
Joined: Sun Dec 06, 2015 10:26 am

Re: Ryde watchdog and reset

Post by g8lce » Sat Dec 19, 2020 10:35 am

I am now looking at other ways of making a watchdog for a Ryde at a repeater although I have the watchdog board on order ( https://thepihut.com/collections/uugear ... spberry-pi ). As that board uses GPIO it may not be able to be used unless the Ryde has a 'repeater version' of the software. That would make life easier and a repeater version easier ( in my opinion )
With a arduino the I2C from the Pi could be used to monitor the Ryde with a small subroutine added to the Ryde programming. If it fails then the arduino could issue a hardware shut down to the RPi and then a power off/on cycle via a relay (on an arduino hat )
The problem I can see with both of these solutions is that in my experience the main problem with the Ryde crashing is that it ends up in the ' Longmynd not Loaded ' condition. In this state the RPi is not actually crashed completely as you can still SSH to it so it may still tell any watchdog that it is OK.
Maybe instead of ' Longmynd not Loaded ' the program just needs, at that message point, to go to a reboot condition if the message is there for a few seconds?

Any thoughts?

Martin G8LCE

G8GKQ
Site Admin
Posts: 2810
Joined: Sun Mar 22, 2009 1:21 pm

Re: Ryde watchdog and reset

Post by G8GKQ » Sat Dec 19, 2020 9:35 pm

Martin

I think that we have now reached the stage where persistent "LongMynd not Loaded" only occurs when there is a hardware fault.

What I propose is that I add the code that is used in the Portsdown Repeater Transmitter, which reboots the unit safely at 3 pm and 3 am UTC every day. This reboot is managed at a system level (it's a "cron" job), so will work even if everything else on the RPi has locked up. I can be selected to happen ot not happen from the ssh menu. Would that fulfuill the requirement?

I do not want to create a separate "Repeater Version" of the Ryde, as that would almost double the work involved (for me) in system upgrades. Instead, the one and only Ryde version will be able to be configured for repeater use.

Dave

g8lce
Posts: 346
Joined: Sun Dec 06, 2015 10:26 am

Re: Ryde watchdog and reset

Post by g8lce » Sat Dec 19, 2020 11:34 pm

That sounds like it would solve lots of problems that may or may not happen!
Thanks Dave.
I am still looking at further watchdog ideas as once you look into this area you find that you could also monitor other things as people before me have.
I was also thinking that using one of the button GPIO inputs as a pulse output would work as a heartbeat. The pulse could be short and any button press would not be missed so would work in both Repeater and Home modes.
The "LongMynd not Loaded" is definitely due to a hardware fault but from my experience in testing it can be the slightest voltage wobble on the minitiouner supply even from switching on other equipement around it. Big pulses due to linears maybe? So it is not the software's problem but nice to know the software can bring it back again (even if only every 12 hours)
Please let me know when I can try it out.

Martin G8LCE

g8lce
Posts: 346
Joined: Sun Dec 06, 2015 10:26 am

Re: Ryde watchdog and reset

Post by g8lce » Tue Dec 29, 2020 10:11 am

On 28th December 2020 one of my two Rydes went 'LongMynd not Loaded'. (BATC stream g8lce top left of quad split 437MHz). I don't know why it crashed as it has been running for days. However I waited until the next reset and sure enough the Ryde reset itself and all was restored. This is using Dave's latest development software where you can set the Ryde to reset at 3am and 3pm.
I am working on the Ryde as the next receiver for GB3NQ and hope to have it working in the repeater soon. The quad split is for when two or more inputs to the repeater are received on different frequencies so more like zoom.
There is more work to be done on the watchdog front and I am looking at Arduino Uno's for that.

Martin G8LCE

g8lce
Posts: 346
Joined: Sun Dec 06, 2015 10:26 am

Re: Ryde watchdog and reset

Post by g8lce » Tue Jan 19, 2021 12:11 am

I have been looking at the 'Longmynd not loaded' problem for some time now. It seems to be the only thing that causes any problems with the Ryde and is usually a problem from the USB and Minitiouner. It can be a voltage spike or something and would be a problem on a repeater as the Ryde would need to be rebooted. This is partly solved by Dave's introduction of the 3am and 3pm reboot if selected and does work. However on a repeater this may be too long a time between crash and reboot so I looked for another way of detecting it. By using the I2C of the RPi 4 and linking it to an Arduino and inserting some python code into the playback.py section of the Ryde software, I can detect the crash at 'Longmynd not loaded'. The Arduino can then shutdown the RPi and power it down then up again in a timely fashion. The Arduino can also be used to shut down the RPi incase of power failure with a bit of electronics and a battery or capacitor.

Martin G8LCE

User avatar
g7kpm
Posts: 49
Joined: Sat Feb 23, 2008 9:00 pm

Re: Ryde watchdog and reset

Post by g7kpm » Wed Jan 20, 2021 11:54 pm

Hi Martin,

Sounds like really interesting idea. I am planning to build some Ryde receivers for CT soon and would be interested in anything which can improve reliability and reduce the need for user intervention upon failure.
Are you planning to do any sort of write up on your watchdog idea?

73s, Jason G7KPM

MW0RUD
Posts: 97
Joined: Fri Apr 24, 2020 3:09 pm

Re: Ryde watchdog and reset

Post by MW0RUD » Thu Jan 21, 2021 12:07 am

I thought I should probably point out before people spend too much effort coming up with external solutions that getting Ryde to auto-restart longmynd is already on the todo list https://github.com/eclispe/rydeplayer/issues/48

This should improve the reliability significantly for people with unreliable power supplies etc but will by no means make it "bomb proof"

As with all things on the todo list they will be done when they are done, however the "popularity" of the issues is one of the key points I look at when deciding what to fix next :)

Tim

Post Reply

Return to “The Ryde Digital ATV Receiver”