-
Notifications
You must be signed in to change notification settings - Fork 35
Add OpenSky-Network API example #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Free public limit is 100 calls per day and maximum of 60 seconds each or you'll get temp banned. You get 4000 calls if you login but I haven't figured out how with a microcontroller yet. They have no token system and their API is primarily built for python & curl. It's a foot in the door for public access to flight data.
i forget every single time
Website login required, uses circuitpython_base64 library for encoding. Allows for 4000 calls per day on any active available transponder in their network (about 40K aircraft). This was a somewhat requested API I took on.. and succeeded.
Figured out how to authenticate a login. It was not easy and there was almost no documentation. Authentication via REST GET is undocumented. Just figured it out from hints reading their forums. Added a public & private API. There's huge difference in the amount of calls per day and rate limiting if you're authenticated or not. |
rearranged imports to make pylint happy
Shows all flight traffic in a lat/lon area. This one is really neat!
The private_area example is while being authenticated (use website login credentials) and shows all air traffic in a lat/lon geographic area. You're going to want to review this on an S2 or S3. It will return a good amount of data depending on how large of a geographic area you select. The default area I put in is the Orlando airport area so there's always bound to be some traffic happening. |
timezone = os.getenv("timezone") | ||
tz_offset_seconds = os.getenv("timezone_offset") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two timezone related variables get created, but don't seem to be used anywhere that I can tell. Is it possible to remove them or are they necessary for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested all 3 examples successfully on a feather esp32-s3.
I did a test run without those timezone variables and it was able to run and fetch data successfully. I think we can remove those in order to avoid any confusion of someone thinking they will have some impact on the results.
Everything beyond that seems good to me. Thanks for the new examples @DJDevon3!
Oops yes. About halfway through became unsure if everything should be in 0 UTC or add the option for timezone offsets. I think all flight times are returned as 0 UTC because flights can easily cross multiple timezones. Also if a geographic area is large enough it's possible for the area itself to span multiple time zones. The example in their API is the entire country of Switzerland. No way you'd want to do the entire USA it would crash the microcontroller due to lack of ram allocation. Easier keep everything in 0 UTC and also recommend a small area. If a user wants to add the timezone for a lat/lon area that will be up to them. Will clean it up. Nice catch. Thank you. |
Removed unused timezone vars and assorted script clean up. Changed var for base64cred to be more obvious that a base64 encode is required in the request header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you @DJDevon3!
Updating https://github.com/adafruit/Adafruit_CircuitPython_BitmapSaver to 1.2.10 from 1.2.9: > Merge pull request adafruit/Adafruit_CircuitPython_BitmapSaver#28 from DJDevon3/DJDevon3_WorkingBranch Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.14.1 from 1.14.0: > Merge pull request adafruit/Adafruit_CircuitPython_Requests#133 from DJDevon3/WorkingBranch Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
Free public limit is 100 calls per day and maximum of 60 seconds each or you'll get temp banned. You get 4000 calls if you login but I haven't figured out how with a microcontroller yet. They have no token system and their API is primarily built for python & curl. It's a foot in the door for public access to flight data.