The widget Network Speed is not showing any value. Checked the log and find this:
myDevices - ERROR - TestDownload:<urlopen error [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)>
My system is:
- Rapsberry 3 model B;
- Linux raspberrypi 4.19.58-v7+ #1245 SMP Fri Jul 12 17:25:51 BST 2019 armv7l GNU/Linux
try running this and share the output:
from urllib import request
request.urlretrieve('[https://updates.mydevices.com/test/10MB.zip','/etc/myDevices/test')
request.urlcleanup()
I am not a expert in Python. I created a file name teste.py used “chmod +x teste.py” an execute with “Python teste.py”. Here is the result:
Traceback (most recent call last):
File "teste.py", line 2, in <module>
from urllib import request
ImportError: cannot import name request
I also tried this:
import urllib2
urllib2.urlopen('https://updates.mydevices.com/test/10MB.zip','/etc/myDevices/test')
urllib2.request.urlcleanup()
result
Traceback (most recent call last):
File "teste.py", line 5, in <module>
urllib2.urlopen('https://updates.mydevices.com/test/10MB.zip','/etc/myDevices/test')
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
context=self._context)
File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:727)>
try this:
import urllib2
response = urllib2.urlopen('http://python.org/')
html = response.read()
What version of Python 3 are you running? You can get that by running:
python3 --version
Also what do you get if you run this command?
sudo python3 -c "import json, urllib.request; print(json.loads(urllib.request.urlopen('https://www.howsmyssl.com/a/check').read().decode('UTF-8'))['tls_version'])"
Can you try the following code as well:
import requests
r = requests.get('https://updates.mydevices.com/test/10MB.zip')
with open('/tmp/download_test', 'wb') as f:
f.write(r.content)
Save that to a file, e.g. test.py, and run it with sudo python3 test.py
then let us know if you get any errors.
2 Likes
After reviewing the logs for why the agent restarts every 24 hours I found that it was a result of the download_speed.py test failing with the error reported above. Looking in the to issue I found that the Site https://updates.mydevices.com/ is only offering TLS1.0 and nothing more secure. If I update my /etc/ssl/openssl.cnf to a value MinProtocol = TLSv1.0 instead of the new default MinProtocol = TLSv1.2 then this works without issue, however that is not a good solution to the issue.
Cayenne Developers can you look at one of two options that may be a better way to fix this issue.
- Update the site https://updates.mydevices.com to support modern TLS standards
or
- Implement a config value in the download_speed.py process that would allow only this process to define a different minimum TLS version for the purpose of the test so that the system default does not have to be altered.
thanks @cjls190-pi will put it across the developer.
@cjls190-pi we have updated the TSL. Can you verify it and see if any error occurs.
The update to the TLS configuration on the website has resolved the error and the agent restarting every 24 hours.
How do you update the TLS config? I’m new…
You should not have too. Cayenne updated the server settings so you should not make any changes.
1 Like