Bonjour,
Merci de votre aide
En fait j’étais déjà en mode DEBUG (mode debug forcé demporaire) mais pas beaucoup de trace.
Au lancement j’ai uniquement ça:
[2023-08-07 20:27:26][INFO] : GLOBAL------Start teleinfod
[2023-08-07 20:27:26][INFO] : GLOBAL------Cycle Sommeil : 0.5
[2023-08-07 20:27:26][INFO] : GLOBAL------Socket port : 55062
[2023-08-07 20:27:26][INFO] : GLOBAL------Socket host : 127.0.0.1
[2023-08-07 20:27:26][INFO] : GLOBAL------Log level : debug
[2023-08-07 20:27:26][INFO] : GLOBAL------Callback : http://127.0.0.1:81/plugins/teleinfo/core/php/jeeTeleinfo.php
[2023-08-07 20:27:26][INFO] : GLOBAL------Vitesse : 1200
[2023-08-07 20:27:26][INFO] : GLOBAL------Apikey :
[2023-08-07 20:27:26][INFO] : GLOBAL------Cycle : 0.3
[2023-08-07 20:27:26][INFO] : GLOBAL------Port : /dev/ttyUSB0
[2023-08-07 20:27:26][INFO] : GLOBAL------Type : conso
[2023-08-07 20:27:26][INFO] : GLOBAL------Mode : historique
[2023-08-07 20:27:26][DEBUG] : Writing PID 14043 to /tmp/jeedom/teleinfo/teleinfo_conso.pid
[2023-08-07 20:27:26][DEBUG] : Init request module v2.21.0
[2023-08-07 20:27:26][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:81
Et quand je stoppe le démon:
[2023-08-07 20:27:26][INFO] : GLOBAL------Start teleinfod
[2023-08-07 20:27:26][INFO] : GLOBAL------Cycle Sommeil : 0.5
[2023-08-07 20:27:26][INFO] : GLOBAL------Socket port : 55062
[2023-08-07 20:27:26][INFO] : GLOBAL------Socket host : 127.0.0.1
[2023-08-07 20:27:26][INFO] : GLOBAL------Log level : debug
[2023-08-07 20:27:26][INFO] : GLOBAL------Callback : http://127.0.0.1:81/plugins/teleinfo/core/php/jeeTeleinfo.php
[2023-08-07 20:27:26][INFO] : GLOBAL------Vitesse : 1200
[2023-08-07 20:27:26][INFO] : GLOBAL------Apikey :
[2023-08-07 20:27:26][INFO] : GLOBAL------Cycle : 0.3
[2023-08-07 20:27:26][INFO] : GLOBAL------Port : /dev/ttyUSB0
[2023-08-07 20:27:26][INFO] : GLOBAL------Type : conso
[2023-08-07 20:27:26][INFO] : GLOBAL------Mode : historique
[2023-08-07 20:27:26][DEBUG] : Writing PID 14043 to /tmp/jeedom/teleinfo/teleinfo_conso.pid
[2023-08-07 20:27:26][DEBUG] : Init request module v2.21.0
[2023-08-07 20:27:26][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:81
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.7/http/client.py", line 1260, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output
self.send(msg)
File "/usr/lib/python3.7/http/client.py", line 970, in send
self.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in connect
conn = self._new_conn()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x75cd4a50>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=81): Max retries exceeded with url: /plugins/teleinfo/core/php/jeeTeleinfo.php?apikey= (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x75cd4a50>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/html/plugins/teleinfo/ressources/jeedom/jeedom.py", line 134, in test
response = requests.get(self.url + '?apikey=' + self.apikey, verify=False)
File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=81): Max retries exceeded with url: /plugins/teleinfo/core/php/jeeTeleinfo.php?apikey= (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x75cd4a50>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 815, in <module>
if not globals.JEEDOM_COM.test():
File "/var/www/html/plugins/teleinfo/ressources/jeedom/jeedom.py", line 140, in test
logging.error('Callback result as a unknown error: %s. Please check your network configuration page'% (e.message,))
AttributeError: 'ConnectionError' object has no attribute 'message'
[2023-08-07 20:30:20][DEBUG] : Signal 15 caught, exiting...
[2023-08-07 20:30:20][INFO] : GLOBAL------Shutdown
[2023-08-07 20:30:20][INFO] : Removing PID file /tmp/jeedom/teleinfo/teleinfo_conso.pid
[2023-08-07 20:30:20][DEBUG] : Exit 0
En fait je m’aperçoit que personne n’écoute sur le port 81 alors que le démon est sensé se binder dessus de ce que je comprends:
ps -ef|grep tele
www-data 17000 1 1 20:32 ? 00:00:01 /usr/bin/python3 /var/www/html/plugins/teleinfo/ressources/teleinfo.py --type conso --port /dev/ttyUSB0 --vitesse 1200 --apikey [supprime] --mode historique --socketport 55062 --cycle 0.3 --callback http://127.0.0.1:81/plugins/teleinfo/core/php/jeeTeleinfo.php --loglevel debug --cyclesommeil 0.5
root 17366 32554 0 20:33 pts/0 00:00:00 grep tele
root@jeedom4:/var/log# netstat -an|grep 81
unix 2 [ ] DGRAM 19481
unix 2 [ ] DGRAM 14811
Le problème à l’arrêt et juste un effet de bord je suppose du fait que personne n’écoute sur ce port.