Apr-11-2017, 05:30 PM
here's the log
Error:Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.4/socket.py", line 530, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 284, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0xb6324590>: Failed to establish a new connection: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.thingspeak.com', port=443): Max retries exceeded with url: /apps/thinghttp/send_request?api_key=HNB5SQVTCB6IT5N6 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0xb6324590>: Failed to establish a new connection: [Errno -2] Name or service not known',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/Documents/PY/citofono.py", line 51, in <module>
client.loop_forever()
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 1378, in loop_forever
rc = self.loop(timeout, max_packets)
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 897, in loop
rc = self.loop_read(max_packets)
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 1177, in loop_read
rc = self._packet_read()
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 1766, in _packet_read
rc = self._packet_handle()
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 2239, in _packet_handle
return self._handle_publish()
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 2414, in _handle_publish
self._handle_on_message(message)
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 2574, in _handle_on_message
self.on_message(self, self._userdata, message)
File "/home/pi/Documents/PY/citofono.py", line 18, in on_message
m = requests.get(url)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.thingspeak.com', port=443): Max retries exceeded with url: /apps/thinghttp/send_request?api_key=HNB5SQVTCB6IT5N6 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0xb6324590>: Failed to establish a new connection: [Errno -2] Name or service not known',))