Open cranky-coder opened 4 years ago
I‘ve the same issue. Was this fixed somewhere or by someone?
I‘ve the same issue. Was this fixed somewhere or by someone?
I looked to the error messages as well as some code fragments in https://github.com/claws/dump1090-exporter/blob/master/src/dump1090exporter/exporter.py
Probably this needs a json mime type as input and not plain text: data = await resp.json()
Would it be feasible to change this to .text instead of .json?
see also https://dmitripavlutin.com/javascript-fetch-async-await/
@madzodiac good start, but you mixed up Python and Javascript 😉
Your mentioned data = await resp.json()
is the right place to change, see my #42
I am running your docker version of the code running on my ubuntu 18.04 install. I have the piaware docker running on a pi with the aircraft.json and stats.json files exposed via the web interface.
When I run the docker i get the following error.
Error fetching dump1090 aircraft data: Client error 0, message='Attempt to decode JSON with unexpected mimetype: application/octet-stream', url=URL('http://192.168.2.99:8087/data/aircraft.json'), http://192.168.2.99:8087/data/aircraft.json
However, if i put that url in to any browser or use curl it returns the JSON no problem. From what I found in searching around it seems it could be related aiohttp. Seems it's possible to tell it to ignore mime-type. I tried to modify the code and do a build on my env, but was unsuccessful getting a build so i couldn't fully test.