Closed cornflakes closed 2 years ago
Hey @cornflakes - I'm not seeing this with a Pi4. I'll deploy it to a 3B+ and see if I can recreate.
@cornflakes - I can't recreate so far. I'll leave it running, but so far it's running fine on a 3B+:
I've upped the frequency, and it's happily banging out test scores. I'm not sure how to recreate this.
I'll try using a clean version of the application and see if that does anything...
I still have problems...
This is from a completely fresh deploy done with the "Deploy with balena"-button Only setting changed was the interval set to 1200 instead of 3600
I've found something inspecting the logs of the speedtest container.
It seems the python script isn't very resilient towards errors:
Traceback (most recent call last):
File "speedtest.py", line 35, in <module>
result = speedtest.test()
File "speedtest.py", line 18, in test
print ("Timestamp = " + str(result['timestamp']))
KeyError: 'timestamp'
[2021-02-10 17:49:57.541] [error] Trying to get interface information on non-initialized socket.
[2021-02-10 17:50:13.070] [error] Configuration - Couldn't resolve host name (HostNotFoundException)
[2021-02-10 17:50:13.072] [error] Configuration - Cannot retrieve configuration document (0)
[2021-02-10 17:50:13.073] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[2021-02-10 17:50:13.074] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
{"type":"log","timestamp":"2021-02-10T17:50:13Z","message":"Configuration - Could not retrieve or read configuration (ConfigurationError)","level":"error"}
Traceback (most recent call last):
File "speedtest.py", line 35, in <module>
result = speedtest.test()
File "speedtest.py", line 17, in test
result = json.loads(response[0])
File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[2021-02-10 17:50:30.941] [error] Trying to get interface information on non-initialized socket.
So the error could indicate that I lose my connection to the internet sometimes...
I've tried using a poor mans try/except around the test and haven't had any issues so far (looking at 10+ readings)
I think the answer here would be better error handling.
@cornflakes great! Feel free to PR any features, improvements, fixes you come up with!
I've tried to use this app on a couple of devices, one RaspberryPi 3b+ 2015 and two different RaspberryPi 3b+ 2017 all of them stalls after a little while with only 4ish measurements with mqtt, influxdb, connector and dashboard running, speedtest is also status running, but it does not make any measurements and terminal does not work.
I can get it up and running again by either restarting the devices or sometimes the speedtest service.