C’est dingue mais je pense qu’il s’agit de la bonne piste …
J’ai modifié le fichier serial_comms.py qui initialise la com dans le plugin.
ligne 48 à 56
def connect(self):
""" Connects to the device and starts the read thread """
self.serial = serial.Serial(dsrdtr=True, rtscts=True, port=self.port, baudrate=self.baudrate,
timeout=self.timeout,*self.com_args,**self.com_kwargs)
# Start read thread
self.alive = True
self.rxThread = threading.Thread(target=self._readLoop)
self.rxThread.daemon = True
self.rxThread.start()
On remarque dsrdtr=True, rtscts=True
je modifie dsrdtr=False, rtscts=False
je relance le plugin sms et la, ça fonctionne
[2023-03-08 13:44:25][INFO] : Lancement démon sms : /usr/bin/python3 /var/www/html/plugins/sms/resources/smsd/smsd.py --device /dev/ttyUSB0 --loglevel debug --socketport 55002 --serialrate 9600 --pin 1234 --textmode no --smsc None --cycle 30 --callback http://127.0.0.1:80/plugins/sms/core/php/jeeSMS.php --apikey xxxxxx --pid /tmp/jeedom/sms/deamon.pid
[2023-03-08 13:44:25][INFO] : Start smsd
[2023-03-08 13:44:25][INFO] : Log level : debug
[2023-03-08 13:44:25][INFO] : Socket port : 55002
[2023-03-08 13:44:25][INFO] : Socket host : 127.0.0.1
[2023-03-08 13:44:25][INFO] : PID file : /tmp/jeedom/sms/deamon.pid
[2023-03-08 13:44:25][INFO] : Device : /dev/ttyUSB0
[2023-03-08 13:44:25][INFO] : Apikey : xxxxx
[2023-03-08 13:44:25][INFO] : Callback : http://127.0.0.1:80/plugins/sms/core/php/jeeSMS.php
[2023-03-08 13:44:25][INFO] : Cycle : 30.0
[2023-03-08 13:44:25][INFO] : Serial rate : 9600
[2023-03-08 13:44:25][INFO] : Pin : 1234
[2023-03-08 13:44:25][INFO] : Text mode : no
[2023-03-08 13:44:25][INFO] : SMSC : None
[2023-03-08 13:44:25][DEBUG] : Writing PID 15555 to /tmp/jeedom/sms/deamon.pid
[2023-03-08 13:44:25][DEBUG] : Init request module v2.28.2
[2023-03-08 13:44:25][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:80
[2023-03-08 13:44:25][DEBUG] : http://127.0.0.1:80 "GET /plugins/sms/core/php/jeeSMS.php?apikey=xxx HTTP/1.1" 200 0
[2023-03-08 13:44:25][DEBUG] : Socket interface started
[2023-03-08 13:44:25][DEBUG] : LoopNetServer Thread started
[2023-03-08 13:44:25][DEBUG] : Start listening...
[2023-03-08 13:44:25][DEBUG] : Listening on: [127.0.0.1:55002]
[2023-03-08 13:44:25][DEBUG] : Connecting to GSM Modem...
[2023-03-08 13:44:25][DEBUG] : Text mode false
[2023-03-08 13:44:25][DEBUG] : Enter pin code : 1234
[2023-03-08 13:44:25][INFO] : Connecting to modem on port /dev/ttyUSB0 at 9600bps
[2023-03-08 13:44:25][DEBUG] : write: ATZ
[2023-03-08 13:44:25][DEBUG] : response: ['OK']
[2023-03-08 13:44:25][DEBUG] : write: ATE0
[2023-03-08 13:44:25][DEBUG] : response: ['ATE0
', 'OK']
[2023-03-08 13:44:25][DEBUG] : write: AT+CFUN?
[2023-03-08 13:44:25][DEBUG] : response: ['+CFUN: 1', 'OK']
[2023-03-08 13:44:25][DEBUG] : write: AT+CMEE=1
[2023-03-08 13:44:25][DEBUG] : response: ['OK']
[2023-03-08 13:44:25][DEBUG] : write: AT+CPIN?
[2023-03-08 13:44:25][DEBUG] : response: ['+CPIN: READY', 'OK']
[2023-03-08 13:44:25][DEBUG] : write: AT+CLAC
[2023-03-08 13:44:25][DEBUG] : response: ['+CME ERROR: 100']
[2023-03-08 13:44:25][DEBUG] : write: AT
[2023-03-08 13:44:25][DEBUG] : response: ['OK']
[2023-03-08 13:44:25][DEBUG] : write: AT^CVOICE=?
[2023-03-08 13:44:26][DEBUG] : response: ['+CME ERROR: 100']
[2023-03-08 13:44:26][DEBUG] : write: AT+VTS=?
[2023-03-08 13:44:26][DEBUG] : response: ['+VTS: (0-9,*,#,A,B,C,D),(1-255)', 'OK']
[2023-03-08 13:44:26][DEBUG] : write: AT^DTMF=?
[2023-03-08 13:44:26][DEBUG] : response: ['+CME ERROR: 100']
[2023-03-08 13:44:26][DEBUG] : write: AT^USSDMODE=?
[2023-03-08 13:44:26][DEBUG] : response: ['+CME ERROR: 100']
[2023-03-08 13:44:26][DEBUG] : write: AT+WIND=?
[2023-03-08 13:44:26][DEBUG] : response: ['+CME ERROR: 100']
[2023-03-08 13:44:26][DEBUG] : write: AT+ZPAS=?
[2023-03-08 13:44:26][DEBUG] : response: ['+CME ERROR: 100']
[2023-03-08 13:44:26][DEBUG] : write: AT+CSCS=?
[2023-03-08 13:44:26][DEBUG] : response: ['+CSCS: ("IRA","GSM","UCS2","HEX","PCCP","PCDN","8859-1")', 'OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CNUM=?
[2023-03-08 13:44:26][DEBUG] : response: ['OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CGMI
[2023-03-08 13:44:26][DEBUG] : response: ['SIMCOM_Ltd', 'OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+DDET=1
[2023-03-08 13:44:26][DEBUG] : response: ['OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CGMI
[2023-03-08 13:44:26][DEBUG] : response: ['SIMCOM_Ltd', 'OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+ZPAS?
[2023-03-08 13:44:26][DEBUG] : response: ['+CME ERROR: 100']
[2023-03-08 13:44:26][INFO] : Unknown/generic modem type - will use polling for call state updates
[2023-03-08 13:44:26][DEBUG] : write: AT+COPS=3,0
[2023-03-08 13:44:26][DEBUG] : response: ['OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CMGF=0
[2023-03-08 13:44:26][DEBUG] : response: ['OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CSCA?
[2023-03-08 13:44:26][DEBUG] : response: ['+CSCA: "+336xxxxxxxx",145', 'OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CSMP=49,167,0,0
[2023-03-08 13:44:26][DEBUG] : response: ['OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CSCA?
[2023-03-08 13:44:26][DEBUG] : response: ['+CSCA: "+33xxxxxxxxxx",145', 'OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CPMS=?
[2023-03-08 13:44:26][DEBUG] : response: ['+CPMS: ("SM","ME","SM_P","ME_P","MT"),("SM","ME","SM_P","ME_P","MT"),("SM","ME","SM_P","ME_P","MT")', 'OK']
[2023-03-08 13:44:26][DEBUG] : write: AT+CPMS="ME","ME","ME"
[2023-03-08 13:44:27][DEBUG] : response: ['+CPMS: 0,0,0,0,0,0', 'OK']
[2023-03-08 13:44:27][DEBUG] : write: AT+CNMI=2,1,0,2
[2023-03-08 13:44:27][DEBUG] : response: ['+CMS ERROR: 325']
[2023-03-08 13:44:27][DEBUG] : write: AT+CNMI=2,1,0,1,0
[2023-03-08 13:44:27][DEBUG] : response: ['OK']
[2023-03-08 13:44:27][DEBUG] : write: AT+CLIP=1
[2023-03-08 13:44:27][DEBUG] : response: ['OK']
[2023-03-08 13:44:27][DEBUG] : write: AT+CRC=1
[2023-03-08 13:44:27][DEBUG] : response: ['OK']
[2023-03-08 13:44:27][DEBUG] : write: AT+CVHU=0
[2023-03-08 13:44:27][DEBUG] : response: ['OK']
[2023-03-08 13:44:27][DEBUG] : Waiting for network...
[2023-03-08 13:44:27][DEBUG] : write: AT+CREG?
[2023-03-08 13:44:27][DEBUG] : response: ['+CREG: 0,5', 'OK']
[2023-03-08 13:44:28][DEBUG] : write: AT+CSQ
[2023-03-08 13:44:28][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:44:28][DEBUG] : Ok
[2023-03-08 13:44:28][DEBUG] : write: AT+COPS?
[2023-03-08 13:44:28][DEBUG] : response: ['+COPS: 0,0,"Orange F"', 'OK']
[2023-03-08 13:44:28][DEBUG] : Send to jeedom : {'number': 'network_name', 'message': 'Orange F'}
[2023-03-08 13:44:28][DEBUG] : write: AT+CPMS="ME","ME","ME"
[2023-03-08 13:44:28][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:80
[2023-03-08 13:44:28][DEBUG] : http://127.0.0.1:80 "POST /plugins/sms/core/php/jeeSMS.php?apikey=xxx HTTP/1.1" 200 0
[2023-03-08 13:44:28][DEBUG] : response: ['+CPMS: 0,0,0,0,0,0', 'OK']
[2023-03-08 13:44:28][DEBUG] : write: AT+CMGD=1,4
[2023-03-08 13:44:28][DEBUG] : response: ['+CMS ERROR: 321']
[2023-03-08 13:44:28][ERROR] : Exception2: CMS 321
[2023-03-08 13:44:28][DEBUG] : write: AT+CPMS="SM","SM","SM"
[2023-03-08 13:44:28][DEBUG] : response: ['+CPMS: 4,100,4,100,4,100', 'OK']
[2023-03-08 13:44:28][DEBUG] : write: AT+CMGD=1,4
[2023-03-08 13:44:28][DEBUG] : response: ['OK']
[2023-03-08 13:44:58][DEBUG] : write: AT+CREG?
[2023-03-08 13:44:58][DEBUG] : response: ['+CREG: 0,5', 'OK']
[2023-03-08 13:44:59][DEBUG] : write: AT+CSQ
[2023-03-08 13:44:59][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:44:59][DEBUG] : write: AT+CMGL=0
[2023-03-08 13:44:59][DEBUG] : response: ['OK']
[2023-03-08 13:44:59][DEBUG] : write: AT+CSQ
[2023-03-08 13:44:59][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:44:59][DEBUG] : write: AT+CSQ
[2023-03-08 13:45:00][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:45:00][DEBUG] : write: AT+CSQ
[2023-03-08 13:45:00][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:45:00][DEBUG] : Send to jeedom : {'number': 'signal_strength', 'message': '29'}
[2023-03-08 13:45:00][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:80
[2023-03-08 13:45:00][DEBUG] : http://127.0.0.1:80 "POST /plugins/sms/core/php/jeeSMS.php?apikey=xxx HTTP/1.1" 200 0
[2023-03-08 13:45:30][DEBUG] : write: AT+CREG?
[2023-03-08 13:45:30][DEBUG] : response: ['+CREG: 0,5', 'OK']
[2023-03-08 13:45:31][DEBUG] : write: AT+CSQ
[2023-03-08 13:45:31][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:45:31][DEBUG] : write: AT+CMGL=0
[2023-03-08 13:45:31][DEBUG] : response: ['OK']
[2023-03-08 13:45:31][DEBUG] : write: AT+CSQ
[2023-03-08 13:45:31][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:46:01][DEBUG] : write: AT+CREG?
[2023-03-08 13:46:01][DEBUG] : response: ['+CREG: 0,5', 'OK']
[2023-03-08 13:46:02][DEBUG] : write: AT+CSQ
[2023-03-08 13:46:02][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:46:02][DEBUG] : write: AT+CMGL=0
[2023-03-08 13:46:02][DEBUG] : response: ['OK']
[2023-03-08 13:46:02][DEBUG] : write: AT+CSQ
[2023-03-08 13:46:02][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:46:32][DEBUG] : write: AT+CREG?
[2023-03-08 13:46:32][DEBUG] : response: ['+CREG: 0,5', 'OK']
[2023-03-08 13:46:33][DEBUG] : write: AT+CSQ
[2023-03-08 13:46:33][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:46:33][DEBUG] : write: AT+CMGL=0
[2023-03-08 13:46:33][DEBUG] : response: ['OK']
[2023-03-08 13:46:33][DEBUG] : write: AT+CSQ
[2023-03-08 13:46:33][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:47:03][DEBUG] : write: AT+CREG?
[2023-03-08 13:47:03][DEBUG] : response: ['+CREG: 0,5', 'OK']
[2023-03-08 13:47:04][DEBUG] : write: AT+CSQ
[2023-03-08 13:47:04][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:47:04][DEBUG] : write: AT+CMGL=0
[2023-03-08 13:47:04][DEBUG] : response: ['OK']
[2023-03-08 13:47:04][DEBUG] : write: AT+CSQ
[2023-03-08 13:47:04][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:47:34][DEBUG] : write: AT+CREG?
[2023-03-08 13:47:34][DEBUG] : response: ['+CREG: 0,5', 'OK']
[2023-03-08 13:47:35][DEBUG] : write: AT+CSQ
[2023-03-08 13:47:35][DEBUG] : response: ['+CSQ: 29,0', 'OK']
[2023-03-08 13:47:35][DEBUG] : write: AT+CMGL=0
[2023-03-08 13:47:35][DEBUG] : response: ['OK']
[2023-03-08 13:47:35][DEBUG] : write: AT+CSQ
[2023-03-08 13:47:36][DEBUG] : response: ['+CSQ: 29,0', 'OK']
test ok … j’y crois pas
Pas faute d’avoir dit que cela venait « possiblement » de la gestion du flow control