Plugin brother DEBIAN 12

bonjour @Bad,

Au vu de la « validation » sur le fil « Compatibilité des plugins avec Debian 12 - Bookworm, php 8, python 3.11 » concernant le plugin Brother, j’ai tenté l’installation mais je vois que ça ne fonctionne pas chez moi.
Je voulais donc juste savoir si tu avais commencé à travailler sur la compatibilité du plugin où s’il fallait être patient :).

Quelques logs :
log http.error :

000|Traceback (most recent call last):
0001|File "/var/www/html/plugins/brother/resources/jeeBrother.py", line 3, in <module>
0002|from brother import Brother, SnmpError, UnsupportedModel
0003|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/brother/__init__.py", line 10, in <module>
0004|import pysnmp.hlapi.asyncio as hlapi
0005|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/hlapi/asyncio/__init__.py", line 12, in <module>
0006|from pysnmp.hlapi.asyncio.transport import *
0007|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/hlapi/asyncio/transport.py", line 9, in <module>
0008|from pysnmp.carrier.asyncio.dgram import udp, udp6
0009|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dgram/udp.py", line 35, in <module>
0010|from pysnmp.carrier.asyncio.dgram.base import DgramAsyncioProtocol
0011|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dgram/base.py", line 36, in <module>
0012|from pysnmp.carrier.asyncio.base import AbstractAsyncioTransport
0013|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/base.py", line 33, in <module>
0014|from pysnmp.carrier.asyncio.dispatch import AsyncioDispatcher
0015|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dispatch.py", line 46, in <module>
0016|class AsyncioDispatcher(AbstractTransportDispatcher):
0017|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dispatch.py", line 57, in AsyncioDispatcher
0018|@asyncio.coroutine
0019|^^^^^^^^^^^^^^^^^
0020|AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?

log Brother

0000|[2024-06-14 17:30:15] DEBUG  : #[Salon][Imprimante Salon][Rafraichir]# Command executed
0001|[2024-06-14 17:30:15] DEBUG  : #[Salon][Imprimante Salon]# Running script: LOGFILE=/var/www/html/log/brother LOGLEVEL=debug CALLBACK='http://localhost:80/plugins/brother/core/php/callback.php?apikey=nxxxxxxxxxHT&eqId=268' /var/www/html/plugins/brother/resources/venv/bin/python3 /var/www/html/plugins/brother/resources/jeeBrother.py '[Salon][Imprimante Salon]' 192.168.1.19 ink >/dev/null &

page santé :

Merci pour ton retour :slight_smile:

@bad m’avait spécifiquement indiqué que ce plugin était OK en deb12. Avant de le supprimer de la liste des compatibilités avec deb12, je laisse @bad faire un retour et s’assurer que le pb est bien lié à deb12 et pas à un autre souci

Norbert

1 « J'aime »

Je vais regarder tout ça de plus près demain !

1 « J'aime »

Bonjour à tous,

TL;DR : En effet, le plugin Brother en v9 et inférieures n’est pas compatible avec Debian 12.

 
Je viens de faire un fresh install de Debian 12.5 en VM sur ESXi,
Puis d’installer Jeedom v4.4.7 avec la procédure habituelle ici,
Et enfin d’installer le plugin Brother via le Market.

Après activation, l’installation des dépendances se passent bien :

0000|================================================================================
0001|== Jeedom 4.4.7 diy in Debian GNU/Linux 12 (bookworm) on x86_64/amd64/64bits
0002|== Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
0003|== brother v9 (2024-03-18 00:01:12) branch:stable
0004|======================================================================
0005|== 15/06/2024 15:04:21 == Dependencies installation for brother
0006|======================================================================
0007|[  0% ] : Synchronize the package index...
0008|[  9% ] : Synchronize the package index : [  OK  ]
0009|[ 10% ] : Purge dynamic contents...
0010|[ 29% ] : Purge dynamic contents : [  OK  ]
0011|[ 30% ] : Install python3 venv and pip debian packages...
0012|[ 49% ] : Install python3 venv and pip debian packages : [  OK  ]
0013|[ 50% ] : Create a python3 Virtual Environment...
0014|[ 69% ] : Create a python3 Virtual Environment : [  OK  ]
0015|[ 70% ] : Install required python3 libraries in venv...
0016|[ 99% ] : Install required python3 libraries in venv : [  OK  ]
0017|[100% ] : Finished !
0018|======================================================================
0019|== OK == Installation Successful
0020|======================================================================

L’interface est fonctionnelle et je lance un refresh de l’imprimante :

0013|[2024-06-15 15:04:21][INFO] : Installation des dépendances, voir log dédié (brother_dep)
0014|[2024-06-15 15:04:22][DEBUG] : Dépendances en cours d'installation... (30%)
0015|[2024-06-15 15:04:22][DEBUG] : Dépendances en cours d'installation... (30%)
0016|[2024-06-15 15:04:28][DEBUG] : Dépendances installées.
0017|[2024-06-15 15:06:09][DEBUG] : #[root][2d-printer][Rafraichir]# Command executed
0018|[2024-06-15 15:06:09][DEBUG] : #[root][2d-printer]# Running script: LOGFILE=/var/www/html/log/brother LOGLEVEL=debug CALLBACK='http://localhost:80/plugins/brother/core/php/callback.php?apikey=xyz&eqId=1' /var/www/html/plugins/brother/resources/venv/bin/python3 /var/www/html/plugins/brother/resources/jeeBrother.py '[root][2d-printer]' 2d-printer.local laser >/dev/null &

Mais lors du refresh, il y a en effet un problème avec la bibliothèque pysnmp :

0000|Traceback (most recent call last):
0001|File "/var/www/html/plugins/brother/resources/jeeBrother.py", line 3, in <module>
0002|from brother import Brother, SnmpError, UnsupportedModel
0003|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/brother/__init__.py", line 10, in <module>
0004|import pysnmp.hlapi.asyncio as hlapi
0005|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/hlapi/asyncio/__init__.py", line 12, in <module>
0006|from pysnmp.hlapi.asyncio.transport import *
0007|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/hlapi/asyncio/transport.py", line 9, in <module>
0008|from pysnmp.carrier.asyncio.dgram import udp, udp6
0009|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dgram/udp.py", line 35, in <module>
0010|from pysnmp.carrier.asyncio.dgram.base import DgramAsyncioProtocol
0011|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dgram/base.py", line 36, in <module>
0012|from pysnmp.carrier.asyncio.base import AbstractAsyncioTransport
0013|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/base.py", line 33, in <module>
0014|from pysnmp.carrier.asyncio.dispatch import AsyncioDispatcher
0015|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dispatch.py", line 46, in <module>
0016|class AsyncioDispatcher(AbstractTransportDispatcher):
0017|File "/var/www/html/plugins/brother/resources/venv/lib/python3.11/site-packages/pysnmp/carrier/asyncio/dispatch.py", line 57, in AsyncioDispatcher
0018|@asyncio.coroutine
0019|^^^^^^^^^^^^^^^^^
0020|AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?

30 secondes de recherche sur Google plus tard et effectivement, c’est un problème connu dans pysnmp qui ne sera pas corrigé, car pysnmp n’est plus maintenu.

J’ai du aller un peu vite lors des tests sur Debian12 pour la sortie de la version 8 du plugin.

Et il faudra donc que je passe sur un PyEnv pour supporter Debian 12 :

@ngrataloup, peux-tu modifier l’autre sujet et marquer Brother v9 non compatible avec Debian 12 ?
La prochaine version sera compatible, certainement avant la fin du mois.

Avec toutes mes excuses,
Bad

2 « J'aime »

Merci pour ces retours @Bad

Bonjour @Bad,

Je voulais savoir si tu avais pu avancer sur ce sujet ou s’il fallait patienter ? :wink:

Bonne journée :slight_smile:

Hello,

Je n’ai pas encore traité ce sujet, mais il est bien sur ma todo pour les prochaines semaines.

Merci pour ta patience :slightly_smiling_face:
Bad

1 « J'aime »

Hello @sodaveli, @ngrataloup,

Je viens de publier une nouvelle beta supportant maintenant Debian 12, cf :

Dites-moi si c’est OK et on pourra enfin fermer ce vieux sujet :slight_smile:

Bad

C’est intégré… Dans le post, Ok en beta. Je laisse ceux qui l’utilisent tester
Norbert

1 « J'aime »

Bonjour @Bad, @ngrataloup ,

Après avoir installer la dernière version, les dépendances s’installent bien et le plugin est opérationnel sur DEBIAN 12. :+1: :partying_face:

Installation des dépendances :

== brother v10 (2024-09-07 16:36:22) branch:beta
======================================================================
== 08/09/2024 09:34:04 == Dependencies installation for brother
======================================================================
[  5% ] : Clean apt...
[  9% ] : Clean apt : [0sec] : [  OK  ]
[ 10% ] : Update apt...
[ 19% ] : Update apt : [2sec] : [  OK  ]
[ 20% ] : Init python3 & prerequisites...
[ 31% ] : Init python3 & prerequisites : [1sec] : [  OK  ]
[ 32% ] : Init pyEnv...
** PyEnv not required: 3.11.2 >= 3.11 **
** python3 path: python3 **
[ 43% ] : Init pyEnv : [0sec] : [  OK  ]
[ 44% ] : Setting up virtual environment...
** Version of python in VENV: Python 3.11.2
[ 79% ] : Setting up virtual environment : [5sec] : [  OK  ]
[ 80% ] : Install the required python packages...
[ 89% ] : Install the required python packages : [2sec] : [  OK  ]
[ 90% ] : Summary of installed packages...
brother==4.3.0
certifi==2024.6.2
cffi==1.17.1
charset-normalizer==3.3.2
cryptography==43.0.1
dacite==1.8.1
idna==3.7
Jinja2==3.1.4
MarkupSafe==2.1.5
ply==3.11
pyasn1==0.4.8
pycparser==2.22
pycryptodomex==3.20.0
pysmi==1.5.0
pysnmp==6.2.5
pysnmpcrypto==0.0.4
requests==2.32.3
urllib3==2.2.1
[ 99% ] : Summary of installed packages : [0sec] : [  OK  ]
[100% ] : Finished !
======================================================================
== OK == Installation Successful [10sec]
======================================================================

Log en debug :

[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon][Rafraichir]# Command executed
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# Running script: LOGFILE=/var/www/html/log/brother LOGLEVEL=debug CALLBACK='http://localhost:80/plugins/brother/core/php/callback.php?apikey=nLxxxxxxxxxxxxxxxxxxnxxxxx&eqId=268' /var/www/html/plugins/brother/resources/venv/bin/python3 /var/www/html/plugins/brother/resources/jeeBrother.py '[Salon][Imprimante Salon]' 192.168.1.32 ink >/dev/null &
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# ❤ Thanks for using Brother v10 with Python v3.11.2 on Linux #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) ❤
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# ┌─► Loggers ◄────────────────────────────
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │                               DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ asyncio                       CRITICAL
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ brother                       DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ charset_normalizer            DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ concurrent                    DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ concurrent.futures            DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ jeebrother                    DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ pyasn1                        DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ requests                      DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ urllib3                       DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ urllib3.connection            DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ urllib3.connectionpool        DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ urllib3.poolmanager           DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ urllib3.response              DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ urllib3.util                  DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ urllib3.util.retry            DEBUG
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# └────────────────────────────────────────
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# ┌─► Script ◄─────────────────────────────
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ PID         : 1053262
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ Equipment   : [Salon][Imprimante Salon]
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ Host        : 192.168.1.32
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ Printer type: ink
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ Log file    : /var/www/html/log/brother
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ Log level   : debug
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# │ Callback url: http://localhost:80/plugins/brother/core/php/callback.php?apikey=nLxxxxxxxxxxxxxxxxxx&eqId=268
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# └────────────────────────────────────────
[2024-09-08 09:54:11] DEBUG  : #[Salon][Imprimante Salon]# Initializing device 192.168.1.32
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# Status: b'Veille', encoding: roman8
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# RAW data: {'1.3.6.1.2.1.43.7.1.1.4.1.1': '2004', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.10.0': ['0001040000025a', '02010400000139', '01010400000121', '06010400000107', '08010400000062', '070104000000a5'], '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.17.0': '1.18', '1.3.6.1.2.1.2.2.1.6.1': 'cc:5e:f8:43:2a:13', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.8.0': ['31010400000001', '32010400000001', '33010400000001', '34010400000001', '6f010400002648', '700104000024b8', '710104000024b8', '7201040000044c', '81010400000062', '8201040000005e', '8301040000005e', '8401040000000b'], '1.3.6.1.4.1.2435.2.3.9.1.1.7.0': 'MFG:Brother;CMD:HBP,PJL,URF;MDL:MFC-J5345DW;CLS:PRINTER;CID:Brother Generic Jpeg Type1;URF:SRGB24,W8,CP1,IS1,MT1-8-11,OB9,PQ3-4-5,RS200-600,OFU0,V1.5,DM3;', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.11.0': [], '1.3.6.1.2.1.43.10.2.1.4.1.1': '602', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.1.0': 'E81784K3H671420', '1.3.6.1.2.1.1.3.0': '2331935', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.4.5.2.0': 'Veille'}
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# Data: {'status': 'veille', 'uptime': datetime.datetime(2024, 9, 8, 1, 25, 32, tzinfo=datetime.timezone.utc), 'page_counter': 602, 'color_counter': 313, 'bw_counter': 289, 'duplex_unit_pages_counter': 263, 'black_ink_status': 1, 'cyan_ink_status': 1, 'magenta_ink_status': 1, 'yellow_ink_status': 1, 'black_ink_remaining': 98, 'cyan_ink_remaining': 94, 'magenta_ink_remaining': 94, 'yellow_ink_remaining': 11, 'black_ink': 98, 'cyan_ink': 94, 'magenta_ink': 94, 'yellow_ink': 11}
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# Starting new HTTP connection (1): localhost:80
[2024-09-08 09:54:12] DEBUG  : Données reçues par callback '{"black_ink_remaining": 98, "black_ink_status": 1, "black_ink": 98, "bw_counter": 289, "color_counter": 313, "cyan_ink_remaining": 94, "cyan_ink_status": 1, "cyan_ink": 94, "duplex_unit_pages_counter": 263, "magenta_ink_remaining": 94, "magenta_ink_status": 1, "magenta_ink": 94, "page_counter": 602, "status": "veille", "uptime": "2024-09-08T01:25:32+00:00", "yellow_ink_remaining": 11, "yellow_ink_status": 1, "yellow_ink": 11}'
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# data content: {"black_ink_remaining": 98, "black_ink_status": 1, "black_ink": 98, "bw_counter": 289, "color_counter": 313, "cyan_ink_remaining": 94, "cyan_ink_status": 1, "cyan_ink": 94, "duplex_unit_pages_counter": 263, "magenta_ink_remaining": 94, "magenta_ink_status": 1, "magenta_ink": 94, "page_counter": 602, "status": "veille", "uptime": "2024-09-08T01:25:32+00:00", "yellow_ink_remaining": 11, "yellow_ink_status": 1, "yellow_ink": 11}
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# null value for model
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# null value for serial
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# null value for firmware
[2024-09-08 09:54:12] INFO  : #[Salon][Imprimante Salon]# record value for status: Veille
[2024-09-08 09:54:12] INFO  : #[Salon][Imprimante Salon]# record value for counter: 602
[2024-09-08 09:54:12] INFO  : #[Salon][Imprimante Salon]# record value for black: 98
[2024-09-08 09:54:12] INFO  : #[Salon][Imprimante Salon]# record value for cyan: 94
[2024-09-08 09:54:12] INFO  : #[Salon][Imprimante Salon]# record value for magenta: 94
[2024-09-08 09:54:12] INFO  : #[Salon][Imprimante Salon]# record value for yellow: 11
[2024-09-08 09:54:12] INFO  : #[Salon][Imprimante Salon]# record value for last prints: 0
[2024-09-08 09:54:12] DEBUG  : #[Salon][Imprimante Salon]# http://localhost:80 "POST /plugins/brother/core/php/callback.php?apikey=nLnxxxxxxxxxxxx&eqId=268 HTTP/1.1" 200 0

Cependant, juste pour info, les informations suivantes ne sont pas remontées : Firmware, Modèle et N° de série

Merci Bad pour le travail réalisé :slight_smile:

1 « J'aime »

Hello et merci :heart:

Au moins tu as les niveaux de consommables :relieved:
Je vais ouvrir un ticket sur la bibliothèque Python brother pour ton modèle (MFC-J5345DW).
Ils auront peut-être une idée du pourquoi et du comment :slight_smile:

Bad

1 « J'aime »

Merci à toi,
c’est clair que le principal est d’avoir les niveaux, le reste c’était vraiment pour info :slight_smile:
je clôture ce sujet

bonne journée ! ! !

1 « J'aime »

Alors en fait, le problème est dans mon code… Avec les changements majeurs de la bibliothèque (on est passé de la v1 à la v4), ces 3 valeurs sont à un autre endroit que précédemment.
Je mets à jours la version Beta d’ici 1h.

EDIT: La dernière beta est en ligne

effectivement, tout est ok à présent :slight_smile:

Good Job ! :+1:

1 « J'aime »

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.