I am writing with Python 2.7 and call a my function :
pin = “V5”
val = str(scankWh)
write_pin(pin, val)
Its failing intermittently with
File "/home/pi/python_programs/jacobproductionnewrelaytest04012018.py", line 1289, in write_pin
r = requests.put(BLYNK_URL+BLYNK_AUTH+'/update/'+pin, data=put_body, headers=put_header)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 105, in put
return request('put', url, data=data, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 49, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 407, in send
raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', gaierror(-2, 'Name or service not known'))
An intermittent problem suggests it may not be a coding problem.
A few days ago some numpties severed two of the main subsea cables providing internet access to our island. It basically took us to sub 56K modem speeds with long ping times. Many iOT systems will not work at this level of service and same applies if you are using GPRS etc.
@Johnuready the island in question is not the UK, it’s a small island near Syria. Looks like ISP’s on the island have switched to other systems or the cables have been repaired, back to 20MB / 3MB and 100ms to UK servers which is pretty good for here.
Since Blynk for Python is in Alpha stage, and aside from that announcement we haven’t heard much more… perhaps expecting full functionality is a bit much?
@Johnuready the post above was simply pointing out that Blynk and other iOT networks will not work with poor internet connections. Nothing to do with the Blynk servers that are distributed around the globe.
Ironically a few days before the cables were severed there was an announcement in the local Press that the 5TB cables were going to be replaced with 160TB cables in the next few years at a cost of approx $350m. We went down to about 0TB for a few days.
I am still having very intermittent problems sending information to V pins from my Python Program using the method I described. I looked for other ways and found the example below in the examples library:
I am now struggling how to include this into my program without blynk.run()