Piaware error: couldn't open /var/cache/piaware/location.new

error bugs the heck out of me that keeps scrolling in the terminal window while piaware is running.

got ‘couldn’t open “/var/cache/piaware/location.new”: permission denied’ trying to update location files

how do i change the permission?

thanks.

How are you starting piaware? How did you install it? What is the system it is running on?

rpi3 mod b : noobs/raspbian : installation instructions from flightaware.
in terminal window without options, pi@raspberry$ piaware

A package install of piaware will install a systemd service file that starts piaware automatically. You don’t need to start it from the shell. The error you see is because you’re trying to start it by hand as the wrong user (it is meant to run as a separate less-privileged user that is set up during package install)

thanks for the idea. i’ll reinstall to see if it gets fixed. but that’s how it was install from flightaware originally.
but
here’s what i just found. piaware and cgps (have an adafruit ultimate gps installed yesterday) are competing for gpsd to get location. so how is this problem get solved by piaware programmer?

The install is correct. The problem is you’re trying to start it by hand. Don’t do that, let systemd start it. You don’t need to do anything special to have that happen automatically.

here’s what i just found. piaware and cgps (have an adafruit ultimate gps installed yesterday) are competing for gpsd to get location. so how is this problem get solved by piaware programmer?

What’s the problem you see with two clients talking to gpsd?
I regularly run cgps in parallel with piaware.

first how to run piaware in systemd, i do not have a clue! noobie here! learning the rpi/linux system.

when piaware is run first, cgps does get data from the physical gps.
when cgps is run first, piaware gives the error ‘couldn’t open …’

You should not need to do anything special. The package install sets this up automatically.
Try “sudo systemctl status piaware” or “piaware-status” or look at /var/log/piaware.log to check that it is working.

when piaware is run first, cgps does get data from the physical gps.
when cgps is run first, piaware gives the error ‘couldn’t open …’

The error just means that piaware is trying to write location data that it received, but is failing because it’s been started in the wrong way.
If you still see problems after piaware is running correctly, then I can look at that, but at the moment I think it’s just another symptom not a real problem.

well, with a minimal amount of linux knowledge i search:
piaware service started - piaware does not start automatically, i ran manually
gpsd service started - cgps does not start automatically, i ran manually. piaware uses gpsd.

if piaware runs before cgps, it gives no error. but cpgs has a NO FIX or seems to try to run but goes back to the cmd prompt.
if cgps runs before piaware, it couldn’t open /var/cache…

Can you get piaware running correctly first and then we can look at the cgps problem. There’s no point in looking at it before then. But it sounds like a gpsd or cgps bug.

edit: please run these commands and report the output:



sudo systemctl status piaware
piaware-status
tail -50 /var/log/piaware.log


pi@RPi-01:~ $ sudo systemctl -l status piaware
● piaware.service - FlightAware ADS-B uploader
Loaded: loaded (/lib/systemd/system/piaware.service; enabled)
Active: active (running) since Fri 2017-02-24 04:34:55 PST; 6h ago
Docs: flightaware.com/adsb/piaware/
Main PID: 568 (piaware)
CGroup: /system.slice/piaware.service
├─568 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
├─952 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout --lat 34.450 --lon -118.621
└─967 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,localhost:30104 --results beast,listen,30105 --results ext_basestation,listen,30106 --udp-transport 70.42.6.197:6125:3394137335

Feb 24 11:15:41 RPi-01 piaware[568]: 31720 msgs recv’d from dump1090-fa (484 in last 5m); 31720 msgs sent to FlightAware
Feb 24 11:20:41 RPi-01 piaware[568]: 32080 msgs recv’d from dump1090-fa (360 in last 5m); 32080 msgs sent to FlightAware
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Receiver status: connected
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Server status: synchronized with 51 nearby receivers
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Receiver: 175.6 msg/s received 45.4 msg/s processed (26%)
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Server: 0.3 kB/s from server 0.0kB/s TCP to server 0.6kB/s UDP to server
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Results: 126.8 positions/minute
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Aircraft: 8 of 20 Mode S, 4 of 5 ADS-B used
Feb 24 11:25:41 RPi-01 piaware[568]: 32472 msgs recv’d from dump1090-fa (392 in last 5m); 32472 msgs sent to FlightAware
Feb 24 11:30:41 RPi-01 piaware[568]: 32872 msgs recv’d from dump1090-fa (400 in last 5m); 32872 msgs sent to FlightAware

pi@RPi-01:~ $ piaware-status
PiAware master process (piaware) is running with pid 568.
PiAware ADS-B client (faup1090) is running with pid 952.
PiAware mlat client (fa-mlat-client) is running with pid 967.
Local ADS-B receiver (dump1090-fa) is running with pid 563.

dump1090-fa (pid 563) is listening for connections on port 30005.
faup1090 is connected to the ADS-B receiver.
piaware is connected to FlightAware.

dump1090 is producing data on localhost:30005.

pi@RPi-01:~ $ tail -50 /var/log/piaware.log
Feb 24 10:20:42 RPi-01 piaware[568]: mlat-client(967): Receiver: 199.6 msg/s received 49.2 msg/s processed (25%)
Feb 24 10:20:42 RPi-01 piaware[568]: mlat-client(967): Server: 0.3 kB/s from server 0.0kB/s TCP to server 0.7kB/s UDP to server
Feb 24 10:20:42 RPi-01 piaware[568]: mlat-client(967): Results: 137.1 positions/minute
Feb 24 10:20:42 RPi-01 piaware[568]: mlat-client(967): Aircraft: 12 of 59 Mode S, 9 of 11 ADS-B used
Feb 24 10:25:41 RPi-01 piaware[568]: 25205 msgs recv’d from dump1090-fa (792 in last 5m); 25205 msgs sent to FlightAware
Feb 24 10:30:41 RPi-01 piaware[568]: 25780 msgs recv’d from dump1090-fa (575 in last 5m); 25780 msgs sent to FlightAware
Feb 24 10:35:41 RPi-01 piaware[568]: 26883 msgs recv’d from dump1090-fa (1103 in last 5m); 26883 msgs sent to FlightAware
Feb 24 10:35:43 RPi-01 piaware[568]: mlat-client(967): Receiver status: connected
Feb 24 10:35:43 RPi-01 piaware[568]: mlat-client(967): Server status: synchronized with 97 nearby receivers
Feb 24 10:35:43 RPi-01 piaware[568]: mlat-client(967): Receiver: 165.4 msg/s received 44.3 msg/s processed (27%)
Feb 24 10:35:43 RPi-01 piaware[568]: mlat-client(967): Server: 0.2 kB/s from server 0.0kB/s TCP to server 0.6kB/s UDP to server
Feb 24 10:35:43 RPi-01 piaware[568]: mlat-client(967): Results: 102.2 positions/minute
Feb 24 10:35:43 RPi-01 piaware[568]: mlat-client(967): Aircraft: 17 of 58 Mode S, 12 of 14 ADS-B used
Feb 24 10:40:41 RPi-01 piaware[568]: 27593 msgs recv’d from dump1090-fa (710 in last 5m); 27593 msgs sent to FlightAware
Feb 24 10:45:41 RPi-01 piaware[568]: 28143 msgs recv’d from dump1090-fa (550 in last 5m); 28143 msgs sent to FlightAware
Feb 24 10:50:41 RPi-01 piaware[568]: 28742 msgs recv’d from dump1090-fa (599 in last 5m); 28742 msgs sent to FlightAware
Feb 24 10:50:43 RPi-01 piaware[568]: mlat-client(967): Receiver status: connected
Feb 24 10:50:43 RPi-01 piaware[568]: mlat-client(967): Server status: synchronized with 96 nearby receivers
Feb 24 10:50:43 RPi-01 piaware[568]: mlat-client(967): Receiver: 173.0 msg/s received 47.1 msg/s processed (27%)
Feb 24 10:50:43 RPi-01 piaware[568]: mlat-client(967): Server: 0.3 kB/s from server 0.0kB/s TCP to server 0.7kB/s UDP to server
Feb 24 10:50:43 RPi-01 piaware[568]: mlat-client(967): Results: 147.1 positions/minute
Feb 24 10:50:43 RPi-01 piaware[568]: mlat-client(967): Aircraft: 9 of 32 Mode S, 13 of 13 ADS-B used
Feb 24 10:55:41 RPi-01 piaware[568]: 29335 msgs recv’d from dump1090-fa (593 in last 5m); 29335 msgs sent to FlightAware
Feb 24 11:00:41 RPi-01 piaware[568]: 30025 msgs recv’d from dump1090-fa (690 in last 5m); 30025 msgs sent to FlightAware
Feb 24 11:05:41 RPi-01 piaware[568]: 30604 msgs recv’d from dump1090-fa (579 in last 5m); 30604 msgs sent to FlightAware
Feb 24 11:05:43 RPi-01 piaware[568]: mlat-client(967): Receiver status: connected
Feb 24 11:05:43 RPi-01 piaware[568]: mlat-client(967): Server status: synchronized with 103 nearby receivers
Feb 24 11:05:43 RPi-01 piaware[568]: mlat-client(967): Receiver: 208.7 msg/s received 53.5 msg/s processed (26%)
Feb 24 11:05:43 RPi-01 piaware[568]: mlat-client(967): Server: 0.3 kB/s from server 0.0kB/s TCP to server 0.7kB/s UDP to server
Feb 24 11:05:43 RPi-01 piaware[568]: mlat-client(967): Results: 113.4 positions/minute
Feb 24 11:05:43 RPi-01 piaware[568]: mlat-client(967): Aircraft: 8 of 22 Mode S, 12 of 13 ADS-B used
Feb 24 11:10:41 RPi-01 piaware[568]: 31236 msgs recv’d from dump1090-fa (632 in last 5m); 31236 msgs sent to FlightAware
Feb 24 11:15:41 RPi-01 piaware[568]: 31720 msgs recv’d from dump1090-fa (484 in last 5m); 31720 msgs sent to FlightAware
Feb 24 11:20:41 RPi-01 piaware[568]: 32080 msgs recv’d from dump1090-fa (360 in last 5m); 32080 msgs sent to FlightAware
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Receiver status: connected
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Server status: synchronized with 51 nearby receivers
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Receiver: 175.6 msg/s received 45.4 msg/s processed (26%)
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Server: 0.3 kB/s from server 0.0kB/s TCP to server 0.6kB/s UDP to server
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Results: 126.8 positions/minute
Feb 24 11:20:43 RPi-01 piaware[568]: mlat-client(967): Aircraft: 8 of 20 Mode S, 4 of 5 ADS-B used
Feb 24 11:25:41 RPi-01 piaware[568]: 32472 msgs recv’d from dump1090-fa (392 in last 5m); 32472 msgs sent to FlightAware
Feb 24 11:30:41 RPi-01 piaware[568]: 32872 msgs recv’d from dump1090-fa (400 in last 5m); 32872 msgs sent to FlightAware
Feb 24 11:35:43 RPi-01 piaware[568]: 33207 msgs recv’d from dump1090-fa (335 in last 5m); 33207 msgs sent to FlightAware
Feb 24 11:35:44 RPi-01 piaware[568]: mlat-client(967): Receiver status: connected
Feb 24 11:35:44 RPi-01 piaware[568]: mlat-client(967): Server status: clock unstable
Feb 24 11:35:44 RPi-01 piaware[568]: mlat-client(967): Receiver: 124.8 msg/s received 36.1 msg/s processed (29%)
Feb 24 11:35:44 RPi-01 piaware[568]: mlat-client(967): Server: 0.1 kB/s from server 0.0kB/s TCP to server 0.5kB/s UDP to server
Feb 24 11:35:44 RPi-01 piaware[568]: mlat-client(967): Results: 58.6 positions/minute
Feb 24 11:35:44 RPi-01 piaware[568]: mlat-client(967): Aircraft: 10 of 25 Mode S, 4 of 5 ADS-B used
Feb 24 11:40:43 RPi-01 piaware[568]: 33593 msgs recv’d from dump1090-fa (386 in last 5m); 33593 msgs sent to FlightAware

Ok, so that is all running correctly; piaware is running automatically as expected and you don’t need to do anything more to start it.

Does cgps work when you run it now?

cgps gives a NO FIX or gps timeout

Ok; I suspect a bug with gpsd then; you’d need to take that up with the gpsd developers, there should be no problem with connecting multiple clients (and it works for me…)

thanks.