FlightAware Discussions

Restart pi when nothing happens on port 30003

Setup:
Raspberry Pi 3 running PiAware, Flightaware Pro Stick Plus and an antenna from a private person (idk if I’m allowed to name it).

I have an issue since 28th Feb 2019. My Pi stopped feeding repeatedly. It happens on average every 20 minutes and then the outage continues for 65 minutes. I thought I fixed the issue by unplugging everything and plugging everything back in. It worked for 4 days until the same problems started again yesterday. The problems started out of nowhere, I didn’t update my pi or installed any other programs that could’ve had an impact.

My suspicion is that the pro stick plus is not working as it’s intended, because PiAware is up and running the whole time but he doesn’t receive any signals. Due to me being on vacation for the next few days I’m unable to swap the pro stick.

Now to my actual question :smiley:
Would it be possible to setup a program that’s monitoring port 30003 every few seconds and when there are no messages anymore it restarts my Pi automaticly?

It’s more likely that the power supply isn’t providing enough power and that’s why the receiver hangs.
Of course it could also be a defective receiver.

I’ve written a bandaid script for that type of problem:
Dump1090-fa stops sending messages after some time

(Note that you need to press enter after ctrl-o, otherwise nano will not save the file)

Instead of systemctl restart dump1090-fa you could of course put reboot -f
Then instead of killing off dump1090-fa and restarting it which should normally be enough it will just reboot the pi.
In case it ever hangs in an endless reboot loop i would just delete the wedge.sh file and after the next reboot it won’t reboot anymore :slight_smile:

Note also that this script checks for piaware saying that the SDR isn’t working correctly.
It doesn’t check port 30003 like you suggested.

Also moved your topic to the correct category.

1 Like

I was about to make the same suggestion.
A soft PSU will power the Pi, but the dongle doesn’t get the volts required for its own voltage regulator.

It’s cute that the Pi runs on 5V USB, but it also tries to supply 5V for its own USB ports - any voltage drop across the Pi and a marginal PSU just causes problems.

1 Like

That could be it. My original power supply actually broke and now my pi is running of an USB port on my server. I’ll try to replace it and see if that fixes it.

1 Like

Third mention for power supply here. TLDR the Raspberry Pi branded power adaptor fixed that same problem for me.

I had a Pi Zero W that would keep running but just collect no positions after a few hours. I suspected power; I had been running off the charger from an old ASUS tablet or from the USB power port on an IKEA power strip. I ordered the actual Raspberry Pi power adaptor. My temporary solution while I waited was to set up a cron job to reboot the machine every two hours, that helped for a few days but then it got worse and would only run for 10-20 minutes. The problem was solved instantly when the power adaptor arrived.

The Pi Zero W died only a few days later, but I think it was damaged in the earlier runs. I exchanged it for a Pi 3 B+ and with the right power it’s running great since (3 days 14 hours so far, 0.35 load, 25.7C temperature in a 2C garage)

2 Likes

I just searched my electronics drawer and I found a power supply that COULD fit. It has 12V 1A which is 12W. The original power supply has 5V 2,5A which is 12,5W. Would it be bad if I’d run my pi for a few days with 12V 1A?

A 12V power supply will kill a Raspberry Pi instantly!

2 Likes

The ones dedicated for the RPi are the way to go.

They ignore the USB specification and provide 5.2V so the voltage drop through the cable and protection circuitry is compensated.

RPi just have a very bad power design.

(there is the “Official” Raspberry Pi 3 power supply and i believe the Canakit one marketed in the USA is also good)
official rpi 3 power supply amazon com listing: https://www.amazon.com/Official-Raspberry-Foundation-Power-Supply/dp/B0793FR8ZJ
canakit listing: https://www.amazon.com/CanaKit-Raspberry-Supply-Adapter-Listed/dp/B00MARDJZ4/

(i personally use an adjustable meanwell powersupply but that probably isn’t a good choice for people who don’t know much about electricity :stuck_out_tongue: https://www.amazon.de/Schaltnetzteil-Netzteil-25W-MeanWell-RS-25-5/dp/B00MWQDBM4)

2 Likes

Thanks for the recommendations. I also found another power supply with 12V 3A. What I also found is a converter from 12V to 5V 3A. That would fit for the pi. But what I don’t know is if I should install the 1A or 3A power supply to that converter?

Depends on how efficient the converter is :slight_smile:
Probably both would work but if they are laying around i’d just use the 12V 3A one.
(At full load and 100% efficiency a converter capable of 5V 3A would draw 15W which is 1.25A at 12V. If it is less efficient it will convert some power to heat and draw more current on the 12V. I wouldn’t expect it to draw more than 1.5A though. Also you are not using the full 3A at 5V so the 12V 1A power supply would probably work but i wouldn’t risk it)

Imagine voltage as water pressure and current (Amps) as how much water a power supply can flow.
The devices state which pressure they need and what maximum amount of water they will flow.
If the powersupply is the correct “pressure” that’s fine and the flow capacity should be sufficient.
If the powersupply can flow more (amperage) it’s not a problem.
But using 12V on a 5V device will destroy it just like using too high a water/air pressure on stuff not made for it.

Also i’d probably check the output of the converter with multimeter before using it on the RPi.

How will you connect it to the Pi anyway? You should connect it via the mini-USB socket meant for power.
If you connect via the pin header you lose power input protection which should be avoided.

Anyway if you don’t know that 12V power supply will kill the Pi i somehow doubt the wisdom of wiring up a 12V power supply with converter.
Yes it works in theory but if you screw it up it will still kill the Pi :stuck_out_tongue_winking_eye:

Ok that sounds a little bit too complicated :smiley:

I’ll just order a power supply and tell my dad to install it. He SHOULD be able to do this :smiley:

Still thanks for the help.

Plugging in the USB power supplies is easy. Pretty much nothing you can do wrong there.

The converter you mention, if it has a USB outlet then it should be easy to use as well.

But you would still need to supply the converter with power from the 12V power supply and i would imagine that involves some cabling which requires correct polarity.
Otherwise magic smoke is on.

Anyway learn about electricity it’s good to know. (But don’t touch the mains obviously. And low voltage can be a fire hazard as well, so with learn i don’t mean play around.)

I’ve actually had electric as a school subject for two years. But thats already a few years back :smiley:

Trotzdem danke für deine Hilfe :wink:

A 12V dc supply for 5V dc rated Pi will sure fry the Pi.

Excessive over voltage can kill the device. The devices normally can survive an over voltage of say 10% max, but anything more than that is risky.

Didn’t want to discourage you from using the converter you found.

The problem is when you use a device that is unattended and runs 24/7.
That’s not a good scenario for an overheating component or whatever may go wrong.

Also replacing the RPi is annoying so it’s probably best to wait for a power supply.

You could always try to use a shorter/better mini-USB cable or try an USB hub to power the RPi.
If you have a fairly recent mobile phone charger that should also work for powering the RPi.

1 Like

I’ve now ordered a new power supply. It should arrive tomorrow so my dad can install it. In the meantime I found a phone charger with the following readings:
3,6V-6,5V 3A/6,5V-9V 2A/9V-12V 1A

That charger should work?

That’s a USB charger with those ratings?

Didn’t mean old phone charger, meant the USB kind.
(That’s why i wrote fairly recent :P)

Anyway any USB power supply should do they put out 5V when the phone doesn’t communicate with them.

I don’t have a usb power supply. Only phone chargers. The one I mentioned is the Aukey PA-T9.

Yeah that doesn’t have the right plug to connect it, does it?

So no don’t use that one.

It has a usb post. I can just plug in a USB type A to Micro USB cable