Re: [Plugin Tiers] Plugin Téléinfo
Publié : 20 avr. 2018, 11:03
alors passe le à 1200
Forum sur Jeedom
https://www.jeedom.com/forum/
Code : Tout sélectionner
[2018-04-20 11:30:39][INFO] : Vérification de l'état du service : NOK
[2018-04-20 11:30:39][INFO] : Démarrage compteur de consommation
[2018-04-20 11:30:39][INFO] : --------- Informations sur le master --------
[2018-04-20 11:30:39][INFO] : Adresse :http://192.168.1.30:80
[2018-04-20 11:30:39][INFO] : Host / Port :192.168.1.30:80
[2018-04-20 11:30:39][INFO] : Path complémentaire :
[2018-04-20 11:30:39][INFO] : Mise en forme pour le service : http://192.168.1.30:80
[2018-04-20 11:30:39][INFO] : Debug : 0
[2018-04-20 11:30:39][INFO] : Force : 0
[2018-04-20 11:30:39][INFO] : Port modem : /dev/ttyUSB0
[2018-04-20 11:30:39][INFO] : Type : conso
[2018-04-20 11:30:39][INFO] : ---------------------------------------------
[2018-04-20 11:30:39][INFO] : Fonctionnement en mode 1 compteur
[2018-04-20 11:30:39][INFO] : Exécution du service : nice -n 19 /usr/bin/python /var/www/html/plugins/teleinfo/ressources/teleinfo.py -d 0 -p /dev/ttyUSB0 -v 9600 -e http://192.168.1.30:80 -c 26bb52klq8jh5tyujnph -f 0 -t conso -r /var/www/html/plugins/teleinfo/core/class
Traceback (most recent call last):
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 405, in <module>
teleinfo.run()
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 262, in run
self.open()
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 130, in open
raise TeleinfoException(error)
NameError: global name 'error' is not defined
[2018-04-20 11:30:41][INFO] : Vérification de l'état du service : NOK
[2018-04-20 11:30:52][INFO] : Vérification de l'état du service : NOK
[2018-04-20 11:30:52][ERROR] : Impossible de lancer le démon téléinfo, vérifiez l'ip
Code : Tout sélectionner
[2018-04-20 11:34:08][INFO] : Vérification de l'état du service : NOK
[2018-04-20 11:34:08][INFO] : Démarrage compteur de consommation
[2018-04-20 11:34:08][INFO] : --------- Informations sur le master --------
[2018-04-20 11:34:08][INFO] : Adresse :http://192.168.1.30:80
[2018-04-20 11:34:08][INFO] : Host / Port :192.168.1.30:80
[2018-04-20 11:34:08][INFO] : Path complémentaire :
[2018-04-20 11:34:08][INFO] : Mise en forme pour le service : http://192.168.1.30:80
[2018-04-20 11:34:08][INFO] : Debug : 0
[2018-04-20 11:34:08][INFO] : Force : 0
[2018-04-20 11:34:08][INFO] : Port modem : /dev/ttyUSB0
[2018-04-20 11:34:08][INFO] : Type : conso
[2018-04-20 11:34:08][INFO] : ---------------------------------------------
[2018-04-20 11:34:08][INFO] : Fonctionnement en mode 1 compteur
[2018-04-20 11:34:08][INFO] : Exécution du service : nice -n 19 /usr/bin/python /var/www/html/plugins/teleinfo/ressources/teleinfo.py -d 0 -p /dev/ttyUSB0 -v 1200 -e http://192.168.1.30:80 -c 26bb52klq8jh5tyujnph -f 0 -t conso -r /var/www/html/plugins/teleinfo/core/class
Traceback (most recent call last):
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 405, in <module>
teleinfo.run()
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 262, in run
self.open()
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 130, in open
raise TeleinfoException(error)
NameError: global name 'error' is not defined
[2018-04-20 11:34:10][INFO] : Vérification de l'état du service : NOK
[2018-04-20 11:34:18][DEBUG] : Pas de calcul
[2018-04-20 11:34:20][INFO] : Vérification de l'état du service : NOK
[2018-04-20 11:34:20][ERROR] : Impossible de lancer le démon téléinfo, vérifiez l'ip
Code : Tout sélectionner
2018-04-20 11:30:40,708 INFO Try to open Teleinfo modem /dev/ttyUSB0 with speed 9600
2018-04-20 11:30:40,709 ERROR Error opening Teleinfo modem /dev/ttyUSB0 : Traceback (most recent call last):
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 123, in open
self._ser = serial.Serial(self._device, self._vitesse, bytesize=7, parity = E, stopbits=1)
AttributeError: module object has no attribute Serial
2018-04-20 11:34:09,232 INFO Try to open Teleinfo modem /dev/ttyUSB0 with speed 1200
2018-04-20 11:34:09,233 ERROR Error opening Teleinfo modem /dev/ttyUSB0 : Traceback (most recent call last):
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 123, in open
self._ser = serial.Serial(self._device, self._vitesse, bytesize=7, parity = E, stopbits=1)
AttributeError: module object has no attribute Serial
Code : Tout sélectionner
/var/www/html/plugins/teleinfo/ressources/teleinfo.py"
Code : Tout sélectionner
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
""" Read one teleinfo frame and output the frame in CSV format on stdout
"""
import serial
import os
import time
import traceback
import logging
import sys
from optparse import OptionParser
from datetime import datetime
import subprocess
import urllib2
import threading
import signal
# Default log level
gLogLevel = logging.DEBUG
# Device name
gDeviceName = '/dev/ttyUSB0'
# Default output is stdout
gOutput = sys.__stdout__
gExternalIP = ''
gCleAPI = ''
gDebug = ''
gRealPath = ''
gVitesse = ''
gMessageTemp = ''
gCanStart = 'true'
# ----------------------------------------------------------------------------
# LOGGING
# ----------------------------------------------------------------------------
class MyLogger:
""" Our own logger """
def __init__(self):
program_path = os.path.dirname(os.path.realpath(__file__))
self._logger = logging.getLogger('teleinfo')
hdlr = logging.FileHandler(program_path + '/../../../log/teleinfo_deamon')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
self._logger.addHandler(hdlr)
self._logger.setLevel(gLogLevel)
def debug(self, text):
try:
self._logger.debug(text)
except NameError:
pass
def info(self, text):
try:
text = text.replace("'", "")
self._logger.info(text)
except NameError:
pass
def warning(self, text):
try:
text = text.replace("'", "")
self._logger.warn(text)
except NameError:
pass
def error(self, text):
try:
text = text.replace("'", "")
self._logger.error(text)
except NameError:
pass
# ----------------------------------------------------------------------------
# Exception
# ----------------------------------------------------------------------------
class TeleinfoException(Exception):
"""
Teleinfo exception
"""
def __init__(self, value):
Exception.__init__(self)
self.value = value
def __str__(self):
return repr(self.value)
# ----------------------------------------------------------------------------
# Teleinfo core
# ----------------------------------------------------------------------------
class Teleinfo:
""" Fetch teleinformation datas and call user callback
each time all data are collected
"""
def __init__(self, device, externalip, cleapi, debug, realpath, vitesse):
""" @param device : teleinfo modem device path
@param log : log instance
@param callback : method to call each time all data are collected
The datas will be passed using a dictionnary
"""
self._log = MyLogger()
self._device = device
self._externalip = externalip
self._cleAPI = cleapi
self._debug = debug
self._realpath = realpath
self._vitesse = vitesse
self._ser = None
#self._stop = Event()
def open(self):
""" open teleinfo modem device
"""
try:
self._log.info("Try to open Teleinfo modem '%s' with speed '%s'" % (self._device, self._vitesse))
# if(self.vitesse == '9600'):
self._ser = serial.Serial(self._device, self._vitesse, bytesize=7, parity = 'E', stopbits=1)
# else:
# self._ser = serial.Serial(self._device, 1200, bytesize=7, parity = 'E', stopbits=1)
self._log.info("Teleinfo modem successfully opened")
except:
#error = "Error opening Teleinfo modem '%s' : %s" % (self._device, traceback.format_exc())
self._log.error("Error opening Teleinfo modem '%s' : %s" % (self._device, traceback.format_exc()))
raise TeleinfoException(error)
def close(self):
""" close telinfo modem
"""
self._log.info("Try to close Teleinfo modem")
#self._stop.set()
if self._ser != None and self._ser.isOpen():
self._ser.close()
self._log.info("Teleinfo modem successfully closed")
def terminate(self):
print "Terminating..."
self.close()
#sys.close(gOutput)
sys.exit()
def read(self):
""" Fetch one full frame for serial port
If some part of the frame is corrupted,
it waits until th enext one, so if you have corruption issue,
this method can take time but it enures that the frame returned is valid
@return frame : list of dict {name, value, checksum}
"""
#Get the begin of the frame, markde by \x02
resp = self._ser.readline()
is_ok = False
#frame = []
#frameCsv = []
Content = {}
while not is_ok:
try:
while '\x02' not in resp:
resp = self._ser.readline()
#\x02 is in the last line of a frame, so go until the next one
#print "* Begin frame"
resp = self._ser.readline()
#A new frame starts
#\x03 is the end of the frame
while '\x03' not in resp:
#Don't use strip() here because the checksum can be ' '
if len(resp.replace('\r','').replace('\n','').split()) == 2:
#The checksum char is ' '
name, value = resp.replace('\r','').replace('\n','').split()
checksum = ' '
else:
name, value, checksum = resp.replace('\r','').replace('\n','').split()
#print "name : %s, value : %s, checksum : %s" % (name, value, checksum)
if self._is_valid(resp, checksum):
#frame.append({"name" : name, "value" : value, "checksum" : checksum})
#frameCsv.append(value)
Content[name] = value;
else:
self._log.error("** FRAME CORRUPTED !")
#This frame is corrupted, we need to wait until the next one
#frame = []
#frameCsv = []
while '\x02' not in resp:
resp = self._ser.readline()
self._log.error("* New frame after corrupted")
resp = self._ser.readline()
#\x03 has been detected, that's the last line of the frame
if len(resp.replace('\r','').replace('\n','').split()) == 2:
#print "* End frame"
#The checksum char is ' '
name, value = resp.replace('\r','').replace('\n','').replace('\x02','').replace('\x03','').split()
checksum = ' '
else:
name, value, checksum = resp.replace('\r','').replace('\n','').replace('\x02','').replace('\x03','').split()
if self._is_valid(resp, checksum):
#frame.append({"name" : name, "value" : value, "checksum" : checksum})
#frameCsv.append(value)
#print "* End frame, is valid : %s" % frame
is_ok = True
else:
self._log.error("** Last frame invalid")
resp = self._ser.readline()
except ValueError:
#Badly formatted frame
#This frame is corrupted, we need to wait until the next one
#frame = []
#frameCsv = []
while '\x02' not in resp:
resp = self._ser.readline()
#self._log.info(Content)
return Content
def _is_valid(self, frame, checksum):
""" Check if a frame is valid
@param frame : the full frame
@param checksum : the frame checksum
"""
#print "Check checksum : f = %s, chk = %s" % (frame, checksum)
datas = ' '.join(frame.split()[0:2])
my_sum = 0
for cks in datas:
my_sum = my_sum + ord(cks)
computed_checksum = ( my_sum & int("111111", 2) ) + 0x20
#print "computed_checksum = %s" % chr(computed_checksum)
return chr(computed_checksum) == checksum
def run(self):
""" Main function
"""
Donnees = {}
_Donnees = {}
_RAZ = datetime.now()
_RazCalcul = 0
_Separateur = " "
_SendData = ""
#global gMessageTemp
def target():
self.process = None
self.process = subprocess.Popen(self.cmd + _SendData, shell=True)
self.process.communicate()
self.timer.cancel()
def timer_callback():
#logger.debug("Thread timeout, terminate it")
if self.process.poll() is None:
try:
self.process.kill()
except OSError as error:
#logger.error("Error: %s " % error)
self._log.error("Error: %s " % error)
self._log.warning("Thread terminated")
else:
self._log.warning("Thread not alive")
# Open Teleinfo modem
try:
self.open()
except TeleinfoException as err:
self._log.error(err.value)
self.terminate()
return
# Read a frame
while(1):
_RazCalcul = datetime.now() - _RAZ
if(_RazCalcul.seconds > 60):
_RAZ = datetime.now()
for cle, valeur in Donnees.items():
Donnees.pop(cle)
_Donnees.pop(cle)
_SendData = ""
frameCsv = self.read()
for cle, valeur in frameCsv.items():
if(cle == 'PTEC'):
valeur = valeur.replace(".","")
valeur = valeur.replace(")","")
Donnees[cle] = valeur
elif(cle == 'OPTARIF'):
valeur = valeur.replace(".","")
valeur = valeur.replace(")","")
Donnees[cle] = valeur
else:
Donnees[cle] = valeur
if(self._externalip != ""):
self.cmd = "curl -L -s -G --max-time 15 " + self._externalip +"/plugins/teleinfo/core/php/jeeTeleinfo.php -d 'api=" + self._cleAPI
_Separateur = "&"
else:
self.cmd = 'nice -n 19 timeout 15 /usr/bin/php ' + self._realpath + '/../php/jeeTeleinfo.php api=' + self._cleAPI
_Separateur = " "
for cle, valeur in Donnees.items():
if(cle in _Donnees):
if (Donnees[cle] != _Donnees[cle]):
_SendData += _Separateur + cle +'='+ valeur
_Donnees[cle] = valeur
else:
_SendData += _Separateur + cle +'='+ valeur
_Donnees[cle] = valeur
if (_SendData != ""):
_SendData += _Separateur + "ADCO=" + Donnees["ADCO"]
if(self._externalip != ""):
try:
_SendData += "'"
if (self._debug == '1'):
print self.cmd + _SendData
self._log.debug(self.cmd + _SendData)
thread = threading.Thread(target=target)
self.timer = threading.Timer(int(5), timer_callback)
self.timer.start()
thread.start()
except Exception, e:
errorCom = "Connection error '%s'" % e
else:
try:
if (self._debug == '1'):
print self.cmd + _SendData
self._log.debug(self.cmd + _SendData)
thread = threading.Thread(target=target)
self.timer = threading.Timer(int(5), timer_callback)
self.timer.start()
thread.start()
except Exception, e:
errorCom = "Connection error '%s'" % e
self.terminate()
def exit_handler(self, *args):
self.terminate()
self._log.info("[exit_handler]")
#------------------------------------------------------------------------------
# MAIN
#------------------------------------------------------------------------------
if __name__ == "__main__":
usage = "usage: %prog [options]"
parser = OptionParser(usage)
parser.add_option("-o", "--output", dest="filename", help="append result in FILENAME")
parser.add_option("-p", "--port", dest="port", help="port du modem")
parser.add_option("-e", "--externalip", dest="externalip", help="ip de jeedom")
parser.add_option("-c", "--cleapi", dest="cleapi", help="cle api de jeedom")
parser.add_option("-d", "--debug", dest="debug", help="mode debug")
parser.add_option("-r", "--realpath", dest="realpath", help="path usr")
parser.add_option("-v", "--vitesse", dest="vitesse", help="vitesse du modem")
parser.add_option("-f", "--force", dest="force", help="forcer le lancement")
parser.add_option("-t", "--type", dest="type", help="type du deamon")
(options, args) = parser.parse_args()
if options.port:
try:
gDeviceName = options.port
except:
error = "Can not change port %s" % options.port
raise TeleinfoException(error)
if options.externalip:
try:
gExternalIP = options.externalip
except:
error = "Can not change ip %s" % options.externalip
raise TeleinfoException(error)
if options.debug:
try:
gDebug = options.debug
except:
error = "Can not set debug mode %s" % options.debug
#raise TeleinfoException(error)
if options.cleapi:
try:
gCleAPI = options.cleapi
except:
error = "Can not change ip %s" % options.cleapi
raise TeleinfoException(error)
if options.realpath:
try:
gRealPath = options.realpath
except:
error = "Can not get realpath %s" % options.realpath
raise TeleinfoException(error)
if options.vitesse:
try:
gVitesse = options.vitesse
except:
error = "Can not get vitesse %s" % options.vitesse
raise TeleinfoException(error)
if options.force:
try:
if options.force == '0':
if os.path.isfile("/tmp/teleinfo_" + options.type + ".pid"):
filetmp = open("/tmp/teleinfo_" + options.type + ".pid", 'r')
filepid = filetmp.readline()
filetmp.close()
if filepid != "":
_log = MyLogger()
_log.warning('Deamon deja lance')
gCanStart = 'false'
except:
error = "Can not get file PID"
raise TeleinfoException(error)
if gCanStart == 'true':
pid = str(os.getpid())
file("/tmp/teleinfo_" + options.type + ".pid", 'w').write("%s\n" % pid)
teleinfo = Teleinfo(gDeviceName, gExternalIP, gCleAPI, gDebug, gRealPath, gVitesse)
signal.signal(signal.SIGTERM, teleinfo.exit_handler)
teleinfo.run()
sys.exit()
ok, j’espère que cela va avancé vite car mon linky est passé en mode tic standard depuis hier...
Code : Tout sélectionner
Lancement de l'installation/mise à jour des dépendances Téléinfo
Raffraichissement du système
Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Reading package lists...
Installation de la librairie ftdi pour modem 2 compteurs
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package python-ftdi
Reading package lists...
Building dependency tree...
Reading state information...
python-ftdi1 is already the newest version (1.3-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already satisfied: pylibftdi in /usr/local/lib/python2.7/dist-packages
Installation de la librairie serial
Requirement already satisfied: serial in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: iso8601>=0.1.12 in /usr/local/lib/python2.7/dist-packages (from serial)
Requirement already satisfied: pyyaml>=3.12 in /usr/local/lib/python2.7/dist-packages (from serial)
Requirement already satisfied: future>=0.16.0 in /usr/local/lib/python2.7/dist-packages (from serial)
Mise à jour de cmdline ou inittab suivant système
Désactivation de la sortie serie vers la console
Everything is successfully installed!
Code : Tout sélectionner
[2018-04-21 16:44:43][INFO] : Exécution du service : nice -n 19 /usr/bin/python /var/www/html/plugins/teleinfo/ressources/teleinfo.py -d 0 -p /dev/ttyUSB0 -v 1200 -e http://192.168.0.30:80 -c ini380ruv6d6dumif3dt -f 0 -t conso -r /var/www/html/plugins/teleinfo/core/class
Traceback (most recent call last):
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 407, in <module>
teleinfo.run()
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 264, in run
self.open()
File "/var/www/html/plugins/teleinfo/ressources/teleinfo.py", line 132, in open
raise TeleinfoException(error)
NameError: global name 'error' is not defined
Code : Tout sélectionner
Lancement de l'installation/mise à jour des dépendances Téléinfo
Rafraîchissement du système
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:3 https://deb.nodesource.com/node_8.x stretch InRelease
Reading package lists...
Installation de la librairie ftdi pour modem 2 compteurs
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package python-ftdi
Reading package lists...
Building dependency tree...
Reading state information...
python-ftdi1 is already the newest version (1.3-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already satisfied: pylibftdi in /usr/local/lib/python2.7/dist-packages
[b]Installation de la librairie serial
Collecting serial
Using cached https://files.pythonhosted.org/packages/ba/59/904d924f6340a7d5747d3d7866eed459fabc97f98be1fff2ca25f798f550/serial-0.0.64-py2.py3-none-any.whl
Requirement already satisfied: iso8601>=0.1.12 in /usr/local/lib/python2.7/dist-packages (from serial)
Requirement already satisfied: pyyaml>=3.12 in /usr/local/lib/python2.7/dist-packages (from serial)
Requirement already satisfied: future>=0.16.0 in /usr/local/lib/python2.7/dist-packages (from serial)
Installing collected packages: serial
Successfully installed serial-0.0.64[/b]
Mise à jour de cmdline ou inittab suivant système
Désactivation de la sortie serie vers la console
Everything is successfully installed!
Code : Tout sélectionner
import serial
Code : Tout sélectionner
pi@Pi3Jeedom:/usr/local/lib/python2.7 $ sudo pip uninstall pyserial
Uninstalling pyserial-3.4:
/home/pi/.local/bin/miniterm.py
/home/pi/.local/bin/miniterm.pyc
/home/pi/.local/lib/python2.7/site-packages/pyserial-3.4.dist-info/DESCRIPTION.rst
/home/pi/.local/lib/python2.7/site-packages/pyserial-3.4.dist-info/INSTALLER
/home/pi/.local/lib/python2.7/site-packages/pyserial-3.4.dist-info/METADATA
/home/pi/.local/lib/python2.7/site-packages/pyserial-3.4.dist-info/RECORD
/home/pi/.local/lib/python2.7/site-packages/pyserial-3.4.dist-info/WHEEL
/home/pi/.local/lib/python2.7/site-packages/pyserial-3.4.dist-info/metadata.json
/home/pi/.local/lib/python2.7/site-packages/pyserial-3.4.dist-info/top_level.txt
/home/pi/.local/lib/python2.7/site-packages/serial/__init__.py
/home/pi/.local/lib/python2.7/site-packages/serial/__init__.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/aio.py
/home/pi/.local/lib/python2.7/site-packages/serial/aio.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/rfc2217.py
/home/pi/.local/lib/python2.7/site-packages/serial/rfc2217.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/rs485.py
/home/pi/.local/lib/python2.7/site-packages/serial/rs485.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/serialcli.py
/home/pi/.local/lib/python2.7/site-packages/serial/serialcli.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/serialjava.py
/home/pi/.local/lib/python2.7/site-packages/serial/serialjava.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/serialposix.py
/home/pi/.local/lib/python2.7/site-packages/serial/serialposix.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/serialutil.py
/home/pi/.local/lib/python2.7/site-packages/serial/serialutil.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/serialwin32.py
/home/pi/.local/lib/python2.7/site-packages/serial/serialwin32.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/threaded/__init__.py
/home/pi/.local/lib/python2.7/site-packages/serial/threaded/__init__.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/__init__.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/__init__.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/hexlify_codec.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/hexlify_codec.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_common.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_common.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_linux.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_linux.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_osx.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_osx.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_posix.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_posix.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_windows.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/list_ports_windows.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/tools/miniterm.py
/home/pi/.local/lib/python2.7/site-packages/serial/tools/miniterm.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/__init__.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/__init__.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_alt.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_alt.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_hwgrep.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_hwgrep.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_loop.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_loop.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_rfc2217.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_rfc2217.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_serve-rfc2217.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_serve-rfc2217.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_socket.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_socket.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_spy.py
/home/pi/.local/lib/python2.7/site-packages/serial/urlhandler/protocol_spy.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/win32.py
/home/pi/.local/lib/python2.7/site-packages/serial/win32.pyc
Proceed (y/n)? y
Successfully uninstalled pyserial-3.4
pi@Pi3Jeedom:/usr/local/lib/python2.7 $
Code : Tout sélectionner
pi@Pi3Jeedom:/usr/local/lib/python2.7 $ sudo pip uninstall serial
Uninstalling serial-0.0.64:
/home/pi/.local/lib/python2.7/site-packages/serial-0.0.64.dist-info/DESCRIPTION.rst
/home/pi/.local/lib/python2.7/site-packages/serial-0.0.64.dist-info/INSTALLER
/home/pi/.local/lib/python2.7/site-packages/serial-0.0.64.dist-info/METADATA
/home/pi/.local/lib/python2.7/site-packages/serial-0.0.64.dist-info/RECORD
/home/pi/.local/lib/python2.7/site-packages/serial-0.0.64.dist-info/WHEEL
/home/pi/.local/lib/python2.7/site-packages/serial-0.0.64.dist-info/metadata.json
/home/pi/.local/lib/python2.7/site-packages/serial-0.0.64.dist-info/top_level.txt
/home/pi/.local/lib/python2.7/site-packages/serial/errors.py
/home/pi/.local/lib/python2.7/site-packages/serial/errors.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/hooks.py
/home/pi/.local/lib/python2.7/site-packages/serial/hooks.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/meta.py
/home/pi/.local/lib/python2.7/site-packages/serial/meta.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/model.py
/home/pi/.local/lib/python2.7/site-packages/serial/model.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/properties.py
/home/pi/.local/lib/python2.7/site-packages/serial/properties.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/request.py
/home/pi/.local/lib/python2.7/site-packages/serial/request.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/test.py
/home/pi/.local/lib/python2.7/site-packages/serial/test.pyc
/home/pi/.local/lib/python2.7/site-packages/serial/utilities.py
/home/pi/.local/lib/python2.7/site-packages/serial/utilities.pyc
Proceed (y/n)? y
Successfully uninstalled serial-0.0.64
pi@Pi3Jeedom:/usr/local/lib/python2.7 $
Code : Tout sélectionner
pi@Pi3Jeedom:/usr/local/lib/python2.7 $ pip install pyserial
Collecting pyserial
Using cached https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl
Installing collected packages: pyserial
Successfully installed pyserial-3.4
pi@Pi3Jeedom:/usr/local/lib/python2.7 $