tag:blogger.com,1999:blog-9007601562606157016.post7682667565476226114..comments2023-05-11T16:21:37.725+01:00Comments on <Stuff about="code" />: Read PiAware Flight Data with PythonMartin O'Hanlonhttp://www.blogger.com/profile/03047799173301971515noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-9007601562606157016.post-45928099990047167732017-09-04T22:42:41.246+01:002017-09-04T22:42:41.246+01:00@Jay - I was able to solve it by assigning the air...@Jay - I was able to solve it by assigning the aircraft list a separate variable and then iterating through that variable in the loop...<br /><br />def parse_flightdata_json(json_data):<br /> aircraft_list = []<br /> ac_identified = json_data['aircraft']<br /> for each_ac in ac_identified:<br /> aircraftdata = AirCraftData(<br /> .. <br /> ..<br />Benderhttps://www.blogger.com/profile/07404672009337283708noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-15465080372641384242017-08-18T21:42:35.944+01:002017-08-18T21:42:35.944+01:00Thanks John, much appreciated. I will see if I can...Thanks John, much appreciated. I will see if I can figure out how to get the radar working. Cheers!Jayhttps://www.blogger.com/profile/13455472476639917515noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-66529354263419324412017-08-18T20:34:10.689+01:002017-08-18T20:34:10.689+01:00here is a link to the program I created. it reads ...here is a link to the program I created. it reads the json file periodically and sends me an email if an aircraft of interest has been picked up. Mostly I use this to help me get pictures of some WWII aircraft from the Hamilton Warplane Museum that often pass overhead. <br />I tried to post the code, but was told my post was too long. Here's a link to it:<br />https://www.dropbox.com/s/2awljgkict5jjas/flights.py?dl=0<br />JohnAhttps://www.blogger.com/profile/12443178795469312379noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-4021674473025351922017-08-18T19:37:29.347+01:002017-08-18T19:37:29.347+01:00I see. If we were able to send the python file it ...I see. If we were able to send the python file it would be great, or anything that could help me figure out how to get it to run. Otherwise, I'll need to figure out how to install older version of raspbian and pi aware back to when it worked. As you can imagine, I would like to avoid this if possible.Jayhttps://www.blogger.com/profile/13455472476639917515noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-70631632544220780762017-08-17T20:54:08.793+01:002017-08-17T20:54:08.793+01:00yes I did. It was a while ago though. i'm not ...yes I did. It was a while ago though. i'm not sure I could tell you what I did. I now get an email when flights of interest are picked up my by PiAware receiver.JohnAhttps://www.blogger.com/profile/12443178795469312379noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-74455554004971199452017-08-17T18:47:43.390+01:002017-08-17T18:47:43.390+01:00Have you been able to go around the string indices...Have you been able to go around the string indices error? I validated the JSON to be good, which I expected to be, so not sure what the python code is doing wrong. I'm running python 3.4.2Jayhttps://www.blogger.com/profile/13455472476639917515noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-30178631363620820852017-03-20T17:06:02.956+00:002017-03-20T17:06:02.956+00:00Hi there,
I am planing to create the same.. i am ...Hi there,<br /><br />I am planing to create the same.. i am new in rasberry pi.. i would like to see, if there is anyway to track the vessels.. what is the range of your tracks and what equipment do i need to do all this. <br /><br />I have rasberry pi3, usb gps, usb antenna and also stratux software.. can you advise pleaseAnonymoushttps://www.blogger.com/profile/08285651173115667243noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-56451925455675586942016-09-24T00:57:23.795+01:002016-09-24T00:57:23.795+01:00Hi again. I inserted "print(json.dumps(json_...Hi again. I inserted "print(json.dumps(json_data,sort_keys=<br />True,indent=5))" just before the "for aircraft in json_data:" and it dumped the current json file OK. So we seem to be connecting. <br /><br />Come to think of it, when I ran this the very first time, I got a 404 error, which is what made me change the URL in the first place.<br /><br />Thanks!<br />......John<br />JohnAhttps://www.blogger.com/profile/12443178795469312379noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-11824664756518353882016-09-24T00:18:10.016+01:002016-09-24T00:18:10.016+01:00It moved with V3. you can access mine Pi via a pro...It moved with V3. you can access mine Pi via a proxy on my main site, if you'd like to do so for testing. (the proxy uses "adsb" but Piaware is /dump1090-fa/data/aircraft. the 8080 port will still work on the Piaware, but it simply forwards to port 80 where lighttpd is running.<br /><br /> andersononline.net/adsb/data/aircraft.jsonJohnAhttps://www.blogger.com/profile/12443178795469312379noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-68853047590096873852016-09-23T23:47:15.198+01:002016-09-23T23:47:15.198+01:00I suspect you are using the wrong file location (h...I suspect you are using the wrong file location (hence getting None back) I just had a quick look on my piaware machine and "http://localhost:8080/data.json" still takes you to a valid location. Do you know the file location has changed? I'll have a look at piaware v3 at somepoint mine is still 2.1-5Martin O'Hanlonhttps://www.blogger.com/profile/03047799173301971515noreply@blogger.comtag:blogger.com,1999:blog-9007601562606157016.post-57131938766985622782016-09-23T23:07:32.139+01:002016-09-23T23:07:32.139+01:00Hi Martin... thanks for this...it's what I was...Hi Martin... thanks for this...it's what I was looking for. I have updated the URL to the new PiAware V3 location for the json file (localhost/dump1090-fa/data/aircraft.json). It threw an error on the decode(). Said it couldn't be None. I changed the line to set it to utf8, which is the json default I think. Got past that and hung up on line 66 in flightdata.py where it tries to parse the array. Error is TypeError: String indicies must be integers. I will admit to zero python experience, so that's likely the problem! Any thoughts? thanks. John JohnAhttps://www.blogger.com/profile/12443178795469312379noreply@blogger.com