New software available to record dump1090 sightings into a database

Discussion in 'Feeding' started by strat-o, Apr 23, 2020.

  1. strat-o

    strat-o New Member

    I created this software yesterday and placed it here on github:
    https://github.com/marlin-mixon/adsb-logger
    It enables you to store all of your sightings into a database for later retrieval. It does ONLY that so it is not an end-to-end system, rather a means to an end.

    One nice feature is you can run this from any computer as long as you have network access to the computer running piaware, dump1090, etc. You can also, of course, install it directly on the pi but in that case I recommend you use a hard drive.

    Requirements:
    * sqlite3
    * nodejs
    * If using a raspberry pi to run this I recommend you use a USB hard drive and not store the data on an SD card. Although it will still work, the data, since it is dynamic, may cause issues with your card. Also the size will build up and may force the Raspberry Pi to fail due to lack of disk storage.

    Currently this runs only from the command line which suits my needs for right now but you may wish to set it up as a service so it will automatically restart after a reboot. Current version is 0.1a. Installation instructions are provided in the repository.

    strat-o
     
    Last edited: Apr 23, 2020
  2. jdubner

    jdubner Member

    Nice! And thank you. I'd like to do something like that too but with my dump1090-mutability and MySQL.

    From my fuzzy understanding of your service_write_sightings.js it appears you're looping once a second, right? But aircraft.json is updated once a minute, so whaaaat?

    Thanks,
    Joe
     
  3. wiedehopf

    wiedehopf Administrator Staff Member

    aircraft.json is updated once a second.

    If yours is only updating every 5 seconds or even 1 minute, then you should adjust that.

    stats.json is only updated every minute.
     
  4. jdubner

    jdubner Member

    Thanks for the clue on the timing. When I ssh into my headless Pi, I can see new data in aircraft.json a lot more frequently than once a minute -- probably once a second, as it should be.

    But when I transfer aircraft.json to my Windows PC over my LAN via SMB, things get weird and the data is stale (up to one minute before it's refreshed). I'll have to find a different way to programatically access aircraft.json from other computers on the LAN.
     
  5. wiedehopf

    wiedehopf Administrator Staff Member

    Just use http ...
    If your webinterface is at /dump1090 then the aircraft.json is here: /dump1090/data/aircraft.json
     
  6. strat-o

    strat-o New Member

    Cool I have been updating this on my local computer and transferring the improvements to adsb-logger. It's possible that I may have introduced bugs as I change it so beware that it can run a bit iffy. I'll watch this space so if you have problems let me know and I'll try to fix it. Also, I may incorporate suggestions or ideas. One change I made on my version is I abandoned Sqlite3 as the database because I wanted to continuously update the data, yet I, also wanted to be able to run analysis at the same time. Sqlite3 would lock up. I am using Postgresql now and it is much easier to manage.
     
  7. jdubner

    jdubner Member

    I'm actually using your very nice tar1090 instead. So I believe aircraft.json is at /run/dump1090-mutability.

    But this URL gives 404 errors: http://192.168.1.13:8080/run/dump1090-mutability/aircraft.json

    I guess I need to learn how to configure the web interface to serve files in /run (aircraft.json) as well as /usr/local/share (index.html).
     
  8. wiedehopf

    wiedehopf Administrator Staff Member

    Why did you add the /run and didn't use the /data as instructed?
    It's a webserver path, not a filesystem path.

    For tar1090 it will be at:
    192.168.1.13/tar1090/data/aircraft.json
     
  9. jdubner

    jdubner Member

    D'oh! You're right of course -- thanks. That works.