tedsluis / dump1090.socket30003

collect dump1090 flight positions using socket30003 and save them as csv
GNU General Public License v3.0
31 stars 5 forks source link

socket30003 socket read error #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi I keep getting this error every few hours, and I have to restart the script. My dump1090 was and is still running fine:

'messagecount=3905,last message=' Not able to read data from the socket! Check whether your dump1090 is running on '127.0.0.1' port 30003 (tcp).

tedsluis commented 8 years ago

Thanks for your feedback. Annoying issue for you. It is not ment to happen unless there is something wrong. This happens when the script receives more than 100 messages in a row which does not have enough fields (which means that a message is incomplete). I have run tests with the script for weeks and I never had more than 10 incomplete messages in a row. So I set a threshold at 100 incomplete messages in a row. But my situation may be different from yours. It could be the difference in antennas or in the number of planes? In your example the script did exit after 3905 messages. In my case it handles that amount of messages in less than a minute. But in my area I spot 150 to 200 aircrafts all the time. May be you receive less different aircrafts? Or more poor messages? Could you change the threshold for example to 10000 and do a test, please? Just edit line 539 and change 100 into 10000:

if ($errorcount > 100) {

If that won't work, than there is an other reason. In the meantime I will work on a update that writes debug info the logfile.

tedsluis commented 8 years ago

Improved logging: Writes info about large amounts of incomplete messages in a row to log file. Increased threshold from 100 incomplete massages in a row to 10000 before the script exits... I hope this helps. Please let me know if you continue to experience issues.

ghost commented 8 years ago

Ok I'll try it. Yes I get about 3 flyovers a day here. And I'm near some mountains, so that reduces my message count also.

ps. what is an incomplete message? Can I tell dump1090 to filter them out?

tedsluis commented 8 years ago

3 aircraft's a day sounds like a very remote area ;-) It explains the cause of the issue.

Messages look like this:

MSG,7,111,11111,AB8C19,111111,2015/12/18,08:16:29.520,2015/12/18,08:16:29.520,,21000,,,,,,,,,,0 MSG,5,111,11111,484CC3,111111,2015/12/18,08:16:29.520,2015/12/18,08:16:29.520,,20775,,,,,,,0,,0,0 MSG,4,111,11111,4CA52B,111111,2015/12/18,08:16:29.520,2015/12/18,08:16:29.520,,,222,165,,,2432,,,,,0 MSG,8,111,11111,AA7D5D,111111,2015/12/18,08:16:29.520,2015/12/18,08:16:29.520,,,,,,,,,,,,0 MSG,6,111,11111,484CB7,111111,2015/12/18,08:16:29.521,2015/12/18,08:16:29.521,,,,,,,,744,0,0,0,0 MSG,3,111,11111,4CA8D9,111111,2015/12/18,08:16:29.521,2015/12/18,08:16:29.521,,27475,,,52.59742,2.28147,,,,,,0 MSG,8,111,11111,3946EC,111111,2015/12/18,08:16:29.521,2015/12/18,08:16:29.521,,,,,,,,,,,,0

You can find the field descriptions within the script.

Incomplete messages may be a blank line, may have less than 20 fields or may have corrupt data in their fields (for example if the altitude field contains something else as numeric characters). The script skips incomplete messages. I don't know whether dump1090 can skip them. I my situation incomplete messages are very rare.

The new version of the script exits after 10000 incomplete messages in a row. The previous version would exits after 100 incomplete messages in a row. So I think that will solve your issue. The new version also writes a message to the log file ones you have 100 and 1000 incomplete messages in a row. So you can see how often this occurs.

ghost commented 8 years ago

So far so good. Running 24 hours now, no problems.