vdomos / domogik-plugin-onewired

Another Domogik (no xPL) plugin for 1-wire bus
2 stars 0 forks source link

Plugin ne démarre plus, sans vraiment de raison OW.init #12

Closed tikismoke closed 7 years ago

tikismoke commented 7 years ago

HO un truc pas cool m'arrive... J'ai fait quelques nouveaux devices dans d'autres plugins, donc je redémarre domogik comme d'hab (avec une longue pause )

2017-01-13 20:22:24,856 domogik-onewired ERROR ### Access to onewire device is not possible: Traceback (most recent call last): File "/var/lib/domogik/domogik_packages/plugin_onewired/lib/onewired.py", line 69, in init ow.init(dev) File "/usr/lib/python2.7/dist-packages/ow/init.py", line 224, in init raise exNoController exNoController

Access to onewire device is not possible: Traceback (most recent call last): File "/var/lib/domogik/domogik_packages/plugin_onewired/lib/onewired.py", line 69, in init ow.init(dev) File "/usr/lib/python2.7/dist-packages/ow/init.py", line 224, in init raise exNoController exNoController

2017-01-13 20:22:24,857 domogik-onewired DEBUG force_leave called

Pourtant en python pur un:

import ow ow.init('u') s=ow.Sensor ( '/28.9CEB2B030000' ) print s /28.9CEB2B030000 - DS18B20 root = owSensor( '/' ) print len( [ s for s in root.find( all = True,type = 'DS18B20' ) ] ) 9

vdomos commented 7 years ago

Ah, vraiment étrange et je vois pas trop.

Aprés ton test en python, as tu relancé le plugin pour voir si cela passait, ? Peut-être que le dongle USB n'était pas "relaché".

Pourrais tu me donner les log au début du démarrage du plugin, lorsqu'il lit le '1-wire_device' ? Histoire de voir si le paramètre est bien 'u' mais il n'aurait pas de raison que cela change

Exemple:, tu devrai avoir 'u' au lieu de ' hera:4304'

2017-01-09 23:38:34,282 domogik-onewired INFO Value for '1-wire_device' is : hera:4304
2017-01-09 23:38:34,282 domogik-onewired INFO Casting value for key '1-wire_device' in type 'string'...
2017-01-09 23:38:34,282 domogik-onewired INFO Value is : hera:4304

Et au niveau de la base aussi:

(localhost) [domogik]> select * from core_plugin_config where id='onewired' ;
+----------+--------+----------+---------------+-----------+
| id       | type   | hostname | key           | value     |
+----------+--------+----------+---------------+-----------+
| onewired | plugin | hades    | 1-wire_cache  | Y         |
| onewired | plugin | hades    | 1-wire_device | hera:4304 |
| onewired | plugin | hades    | auto_startup  | Y         |
| onewired | plugin | hades    | configured    | True      |
+----------+--------+----------+---------------+-----------+
4 rows in set (0.00 sec)

N'as tu aucune erreur sur le dongle dans dmesg ?

tikismoke commented 7 years ago

` 2017-01-13 22:51:07,717 domogik-onewired INFO Looking for launched instances of 'onewired' 2017-01-13 22:51:07,741 domogik-onewired INFO No existing process. 2017-01-13 22:51:07,744 domogik-onewired DEBUG watcher fork 2017-01-13 22:51:07,746 domogik-onewired INFO ---------------------------------- 2017-01-13 22:51:07,747 domogik-onewired INFO Starting client 'onewired' (new manager instance) 2017-01-13 22:51:07,748 domogik-onewired INFO Python version is sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0) 2017-01-13 22:51:07,750 domogik-onewired DEBUG Send client status : starting 2017-01-13 22:51:07,752 domogik-onewired DEBUG Send client status : starting 2017-01-13 22:51:07,756 domogik-onewired DEBUG Write pid file for pid '13264' in file '/var/run/domogik/onewired.pid' 2017-01-13 22:51:07,757 domogik-onewired INFO Read the json file and validate id 2017-01-13 22:51:07,762 domogik-onewired INFO The json file is valid 2017-01-13 22:51:07,789 domogik-onewired INFO Check if there are pictures for the defined products 2017-01-13 22:51:07,789 domogik-onewired INFO There is no products defined for this client 2017-01-13 22:51:07,789 domogik-onewired INFO End init of the global client part 2017-01-13 22:51:07,790 domogik-onewired DEBUG Init config query(mq) instance 2017-01-13 22:51:07,791 domogik-onewired INFO Request query config for client onewired : key configured 2017-01-13 22:51:07,794 domogik-onewired DEBUG Process informations|python_version=2.7|psutil_version=4.3.1|domogik_version=0.5.2|component=plugin-onewired|component_version=1.0|pid=13264|cpu_percent_usage=0.0|memory_total=16084.0|memory_percent_usage=0.1|memory_rss=12.0|memory_vsz=204.0|num_threads=5|num_file_descriptors_used=18|platform=x86_64|num_core=8|git_branch=develop|git_revision=d0b0b2f 2017-01-13 22:51:07,800 domogik-onewired DEBUG Query config : successfull response : <MQMessage(action=config.result, data='{u'status': True, u'name': u'onewired', u'reason': u'', u'value': True, u'host': u'domogik', u'key': u'configured', u'type': u'plugin'}')> 2017-01-13 22:51:07,801 domogik-onewired INFO The client is configured. Continuing (hoping that the user applied the appropriate configuration ;) 2017-01-13 22:51:07,801 domogik-onewired INFO Request query config for client onewired : key 1-wire_device 2017-01-13 22:51:07,810 domogik-onewired DEBUG Query config : successfull response : <MQMessage(action=config.result, data='{u'status': True, u'name': u'onewired', u'reason': u'', u'value': u'u', u'host': u'domogik', u'key': u'1-wire_device', u'type': u'plugin'}')> 2017-01-13 22:51:07,810 domogik-onewired INFO Value for '1-wire_device' is : u 2017-01-13 22:51:07,810 domogik-onewired INFO Casting value for key '1-wire_device' in type 'string'... 2017-01-13 22:51:07,810 domogik-onewired INFO Value is : u 2017-01-13 22:51:07,811 domogik-onewired INFO Request query config for client onewired : key 1-wire_cache 2017-01-13 22:51:07,819 domogik-onewired DEBUG Query config : successfull response : <MQMessage(action=config.result, data='{u'status': True, u'name': u'onewired', u'reason': u'', u'value': u'Y', u'host': u'domogik', u'key': u'1-wire_cache', u'type': u'plugin'}')> 2017-01-13 22:51:07,819 domogik-onewired INFO Value for '1-wire_cache' is : Y 2017-01-13 22:51:07,819 domogik-onewired INFO Casting value for key '1-wire_cache' in type 'boolean'... 2017-01-13 22:51:07,819 domogik-onewired INFO Value is : True 2017-01-13 22:51:07,820 domogik-onewired INFO Retrieve the devices list for this client... 2017-01-13 22:51:07,924 domogik-onewired INFO - id : 1 / name : rez-de-chaussée / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,925 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,925 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,925 domogik-onewired INFO - id : 50 / name : Salle de bain 1er étage / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,925 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,925 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,925 domogik-onewired INFO - id : 51 / name : Chambre Tobias / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,926 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,926 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,926 domogik-onewired INFO - id : 52 / name : Chambre Noelyne / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,926 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,926 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,926 domogik-onewired INFO - id : 53 / name : Chambre parents / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,926 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,926 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,927 domogik-onewired INFO - id : 54 / name : Bureau / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,927 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,927 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,927 domogik-onewired INFO - id : 55 / name : Couloir deuxieme étage / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,927 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,927 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,927 domogik-onewired INFO - id : 56 / name : Couloir premier étage / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,928 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,928 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,928 domogik-onewired INFO - id : 57 / name : Salle de bain 2e étage / device type id : onewire.thermometer_temp 2017-01-13 22:51:07,928 domogik-onewired INFO xpl_stats features : 2017-01-13 22:51:07,928 domogik-onewired INFO xpl_commands features : 2017-01-13 22:51:07,929 domogik-onewired INFO ==> OWFS version : 2.8p15-1.18 2017-01-13 22:51:08,025 domogik-onewired ERROR ### Access to onewire device is not possible: Traceback (most recent call last): File "/var/lib/domogik/domogik_packages/plugin_onewired/lib/onewired.py", line 69, in init ow.init(dev) File "/usr/lib/python2.7/dist-packages/ow/init.py", line 224, in init raise exNoController exNoController

Access to onewire device is not possible: Traceback (most recent call last):

File "/var/lib/domogik/domogik_packages/plugin_onewired/lib/onewired.py", line 69, in init ow.init(dev) File "/usr/lib/python2.7/dist-packages/ow/init.py", line 224, in init raise exNoController exNoController

2017-01-13 22:51:08,025 domogik-onewired DEBUG force_leave called 2017-01-13 22:51:08,025 domogik-onewired DEBUG Send client status : stopped 2017-01-13 22:51:08,026 domogik-onewired INFO The thread send_status_loop was not registered, killing it 2017-01-13 22:51:08,075 domogik-onewired INFO Thread send_status_loop stopped. 2017-01-13 22:51:08,075 domogik-onewired INFO The thread send_process_info was not registered, killing it 2017-01-13 22:51:08,075 domogik-onewired INFO Thread send_process_info stopped. 2017-01-13 22:51:08,105 domogik-onewired DEBUG Delete the file /var/run/domogik//onewired_return_code_13246 2017-01-13 22:51:08,106 domogik-onewired DEBUG del Single client 2017-01-13 22:51:08,107 domogik-onewired DEBUG force_leave called `

vdomos commented 7 years ago

Si tu fais un lsof comme ci-dessous quand le plugin est arrété pour voir si aucun process ne tourne sur le device usb ?

Meme en mode device 'u', il doit ouvrir le device usb du dongle, je pense.

$ lsusb | grep 1-Wire Bus 001 Device 013: ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1 Fob, 1-Wire adapter

# lsof |grep '/dev/bus/usb'
owserver   7786             root    3u      CHR     189,12       0t0      56701 /dev/bus/usb/001/013
owserver   7786 7594        root    3u      CHR     189,12       0t0      56701 /dev/bus/usb/001/013
owserver   7786 9720        root    3u      CHR     189,12       0t0      56701 /dev/bus/usb/001/013
tikismoke commented 7 years ago

Sur l’hôte: root@serveur:/root# lsof |grep /dev/onewire root@serveur:/root# lsusb | grep 1-Wire Bus 001 Device 006: ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1 Fob, 1-Wire adapter

lsof sur le conteneur idem :(

Je pige pas du tout, ça fonctionnait bien depuis un bou de temps et là plus rien du tout.

Python 2.7.3 (default, Jun 21 2016, 18:38:19) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import ow ow.init("u") ow.Sensor("/").sensorList() [Sensor("/28.D4152C030000"), Sensor("/28.2C1B2C030000"), Sensor("/28.9CEB2B030000"), Sensor("/28.62002C030000"), Sensor("/28.6A548B030000"), Sensor("/28.56262C030000"), Sensor("/28.B6372C030000"), Sensor("/28.551F2C030000"), Sensor("/28.BD052C030000"), Sensor("/81.AA4B30000000")] x = ow.Sensor("/28.551F2C030000") print x.type, x.temperature DS18B20 22.0625

tikismoke commented 7 years ago

Et j'ai pourtant toutes les mesure :(

x = ow.Sensor("/28.551F2C030000") print x.type, x.temperature DS18B20 22.0625 x = ow.Sensor("/28.D4152C030000") print x.type, x.temperature DS18B20 16.9375 x = ow.Sensor("/28.B6372C030000") print x.type, x.temperature DS18B20 20.8125 x = ow.Sensor("/28.2C1B2C030000") print x.type, x.temperature DS18B20 22.9375 x = ow.Sensor("/28.551F2C030000") print x.type, x.temperature DS18B20 22.0625 x = ow.Sensor("/28.9CEB2B030000") print x.type, x.temperature DS18B20 19.6875 x = ow.Sensor("/28.BD052C030000") print x.type, x.temperature DS18B20 18.6875 x = ow.Sensor("/28.62002C030000") print x.type, x.temperature DS18B20 24.5 x = ow.Sensor("/28.6A548B030000") print x.type, x.temperature DS18B20 20.6875 x = ow.Sensor("/28.56262C030000") print x.type, x.temperature DS18B20 20.375

vdomos commented 7 years ago

Ce serait pas plutot :

root@serveur:/root# lsof |grep /dev/bus/usb/001/006

A moins que tu es mis une regle udev pour

Dernière cartouches:

tikismoke commented 7 years ago

BON effectivement avec le user domogik le code python de base me jettes ;(

Python 2.7.3 (default, Jun 21 2016, 18:38:19)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ow
>>> ow.init('u')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 224, in init
    raise exNoController
ow.exNoController
tikismoke commented 7 years ago

Ha non mon adaptateur à disparu ;( plus rien dans lsusb. Je l'avais enlever cette après-midi pour voir.

tikismoke commented 7 years ago

OK I confirm an USB adapter hardware problems.

Was available throw root only, when unplugged replugged it was no more available in lsusb on host.

I add to reboot the host to see it again and all works as before.

vdomos commented 7 years ago

Si me souviens bien déjà eu un cas similaire avec le dongle suite au branchement d'un autre appareil USB genre usb/série. Aprés le serveur owserver ne voyait plus les sondes, obligé de rebooté.