Giter Site home page Giter Site logo

Comments (16)

bieniu avatar bieniu commented on August 29, 2024

noSuchName means that the library is not able to find the device in the network. Use IP address.

from brother.

andyboeh avatar andyboeh commented on August 29, 2024

Thanks for the quick response. Unfortunately, the output is exactly the same.
I can ping the device (by name and by IP address) and I can see open ports (161/udp is amongst the list).

from brother.

bieniu avatar bieniu commented on August 29, 2024

Sorry, I was wrong, "nosuchname" means some OIDs are not available for your printer. You can check what OIDs are used here https://github.com/bieniu/brother/blob/master/brother/const.py#L86-L95

from brother.

andyboeh avatar andyboeh commented on August 29, 2024

Thanks, that helped: I tried all of the OIDs with snmpwalk -v2c -c public IP OID and all but one OID reported data (including ATTR_COUNTERS). The failing one is ATTR_FIRMWARE. I noticed that I'm not on the latest Network firmware (1.0.4 vs. 1.0.5), I'll try an update and see if that helps. If not,

from brother.

andyboeh avatar andyboeh commented on August 29, 2024

The firmware update makes no difference. If I remove ATTR_FIRMWARE, the output is as follows:

DEBUG:asyncio:Using selector: EpollSelector
DEBUG:brother:Using host: 192.168.17.118
DEBUG:brother: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.8.0': ['110104000061a8', '31010101410101', '03630101035401', '01016601010135', '01010136010101', '62010101'], '1.3.6.1.4.1.2435.2.3.9.1.1.7.0': 'MFG:Brother;CMD:PJL,PCL,PCLXL;MDL:HL-5350DN series;CLS:PRINTER;', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.11.0': ['41010400000000', '82010400000000', '7301040000777d', '8601040000961e', '7701040001205a', '78010400010af6', '8101040000777d', '8901040000777d'], '1.3.6.1.2.1.43.10.2.1.4.1.1': '69411', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.1.0': 'A3J574454', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.4.5.2.0': 'ENERGIESPAREN   \rTROMMEL ERSETZ. ', '1.3.6.1.2.1.1.3.0': '8590', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.10.0': ['00010400010f23']}
RAW data: %s {'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.8.0': ['110104000061a8', '31010101410101', '03630101035401', '01016601010135', '01010136010101', '62010101'], '1.3.6.1.4.1.2435.2.3.9.1.1.7.0': 'MFG:Brother;CMD:PJL,PCL,PCLXL;MDL:HL-5350DN series;CLS:PRINTER;', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.11.0': ['41010400000000', '82010400000000', '7301040000777d', '8601040000961e', '7701040001205a', '78010400010af6', '8101040000777d', '8901040000777d'], '1.3.6.1.2.1.43.10.2.1.4.1.1': '69411', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.1.0': 'A3J574454', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.4.5.2.0': 'ENERGIESPAREN   \rTROMMEL ERSETZ. ', '1.3.6.1.2.1.1.3.0': '8590', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.10.0': ['00010400010f23']}
DEBUG:brother:Data: {'model': 'HL-5350DN', 'serial': 'A3J574454', 'status': 'energiesparen   \rtrommel ersetz.', 'uptime': datetime.datetime(2022, 4, 16, 15, 30, 37, tzinfo=datetime.timezone.utc), 'page_counter': 69411, 'drum_counter': 25000, 'black_toner_status': 21037313, 'drum_remaining_pages': 0, 'laser_unit_remaining_pages': 30589, 'pf_kit_mp_remaining_pages': 38430, 'pf_kit_1_remaining_pages': 73818, 'fuser_unit_remaining_pages': 30589}
Model: HL-5350DN
Firmware: None
trommel ersetz.sparen   
Serial no: A3J574454
Sensors data: {'model': 'HL-5350DN', 'serial': 'A3J574454', 'status': 'energiesparen   \rtrommel ersetz.', 'uptime': datetime.datetime(2022, 4, 16, 15, 30, 37, tzinfo=datetime.timezone.utc), 'page_counter': 69411, 'drum_counter': 25000, 'black_toner_status': 21037313, 'drum_remaining_pages': 0, 'laser_unit_remaining_pages': 30589, 'pf_kit_mp_remaining_pages': 38430, 'pf_kit_1_remaining_pages': 73818, 'fuser_unit_remaining_pages': 30589}
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-3' coro=<handle_timeout() running at <string>:4> wait_for=<Future pending cb=[Task.task_wakeup()]>>

Is the black_toner_status as expected?

There are some other OIDs that report the firmware version (and model number etc.) that I found while capturing the firmware update traffic:

1.3.6.1.4.1.2435.2.4.3.99.3.1.6.1.2.1 reports MODEL="HL-5350DN series"
1.3.6.1.4.1.2435.2.4.3.99.3.1.6.1.2.2 reports SERIAL="A3J574454"
1.3.6.1.4.1.2435.2.4.3.99.3.1.6.1.2.3 reports SPEC=""
1.3.6.1.4.1.2435.2.4.3.99.3.1.6.1.2.4 reports FIRMID="MAIN"
1.3.6.1.4.1.2435.2.4.3.99.3.1.6.1.2.5 reports FIRMVER="1.18"
1.3.6.1.4.1.2435.2.4.3.99.3.1.6.1.2.6 reports FIRMID="BRNET"
1.3.6.1.4.1.2435.2.4.3.99.3.1.6.1.2.7 reports FIRMID="1.0.5"

from brother.

bieniu avatar bieniu commented on August 29, 2024

Is the black_toner_status as expected?

No

Do other values match those in the printer's web panel?

from brother.

andyboeh avatar andyboeh commented on August 29, 2024

Yes, the other counters match. The black toner is at about 60%, it's hard to tell from the web page.
According to various discussions, this printer does not support displaying the toner level via SNMP. It might just report empty or OK or nothing at all. The display string is the most important information on that.

from brother.

github-actions avatar github-actions commented on August 29, 2024

Stale issue message

from brother.

bieniu avatar bieniu commented on August 29, 2024

Will be fixed

from brother.

github-actions avatar github-actions commented on August 29, 2024

Stale issue message

from brother.

bieniu avatar bieniu commented on August 29, 2024

Will be fixed

from brother.

bieniu avatar bieniu commented on August 29, 2024

Hi, could you install brother package with this command:

pip install --upgrade git+https://github.com/bieniu/brother.git@gen-oids#brother==2.0.0

and test it with your printer?

from brother.

andyboeh avatar andyboeh commented on August 29, 2024

I tried the test script example.py and it seems to look good:

DEBUG:asyncio:Using selector: EpollSelector
DEBUG:brother:Initializing device BRN001BA9E7CE21
DEBUG:brother: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': ['00010400011029'], '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.8.0': ['110104000061a8', '31010101410101', '03630101035401', '01016601010135', '01010136010101', '62010101'], '1.3.6.1.4.1.2435.2.3.9.1.1.7.0': 'MFG:Brother;CMD:PJL,PCL,PCLXL,POSTSCRIPT;MDL:HL-5350DN series;CLS:PRINTER;', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.11.0': ['41010400000000', '82010400000000', '73010400007677', '8601040000961e', '77010400011fb1', '78010400010abb', '81010400007677', '89010400007677'], '1.3.6.1.2.1.43.10.2.1.4.1.1': '69673', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.5.1.0': 'A3J574454', '1.3.6.1.4.1.2435.2.3.9.4.2.1.5.4.5.2.0': 'ENERGIESPAREN   \rTROMMEL ERSETZ. ', '1.3.6.1.2.1.1.3.0': '7060'}
DEBUG:brother:Data: {'model': 'HL-5350DN', 'serial': 'A3J574454', 'firmware': None, 'status': 'energiesparen   \rtrommel ersetz.', 'uptime': datetime.datetime(2022, 9, 8, 7, 29, 27, tzinfo=datetime.timezone.utc), 'page_counter': 69673, 'drum_counter': 25000, 'black_toner_status': 21037313, 'drum_remaining_pages': 0, 'laser_unit_remaining_pages': 30327, 'pf_kit_mp_remaining_pages': 38430, 'pf_kit_1_remaining_pages': 73649, 'fuser_unit_remaining_pages': 30327}
Model: HL-5350DN
Firmware: None
trommel ersetz.sparen   
Serial no: A3J574454
Sensors data: BrotherSensors(model='HL-5350DN', serial='A3J574454', belt_unit_remaining_life=None, belt_unit_remaining_pages=None, black_counter=None, black_drum_counter=None, black_drum_remaining_life=None, black_drum_remaining_pages=None, black_ink_remaining=None, black_ink_status=None, black_ink=None, black_toner_remaining=None, black_toner_status=21037313, black_toner=None, bw_counter=None, color_counter=None, cyan_counter=None, cyan_drum_counter=None, cyan_drum_remaining_life=None, cyan_drum_remaining_pages=None, cyan_ink_remaining=None, cyan_ink_status=None, cyan_ink=None, cyan_toner_remaining=None, cyan_toner_status=None, cyan_toner=None, drum_counter=25000, drum_remaining_life=None, drum_remaining_pages=0, drum_status=None, duplex_unit_pages_counter=None, firmware=None, fuser_remaining_life=None, fuser_unit_remaining_pages=30327, image_counter=None, laser_remaining_life=None, laser_unit_remaining_pages=30327, magenta_counter=None, magenta_drum_counter=None, magenta_drum_remaining_life=None, magenta_drum_remaining_pages=None, magenta_ink_remaining=None, magenta_ink_status=None, magenta_ink=None, magenta_toner_remaining=None, magenta_toner_status=None, magenta_toner=None, page_counter=69673, pf_kit_1_remaining_life=None, pf_kit_1_remaining_pages=73649, pf_kit_mp_remaining_life=None, pf_kit_mp_remaining_pages=38430, status='energiesparen   \rtrommel ersetz.', uptime=datetime.datetime(2022, 9, 8, 7, 29, 27, tzinfo=datetime.timezone.utc), yellow_counter=None, yellow_drum_counter=None, yellow_drum_remaining_life=None, yellow_drum_remaining_pages=None, yellow_ink_remaining=None, yellow_ink_status=None, yellow_ink=None, yellow_toner_remaining=None, yellow_toner_status=None, yellow_toner=None)
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-3' coro=<AsyncioDispatcher.handle_timeout() running at /home/andy/projects/brother/venv/lib/python3.10/site-packages/pysnmp/carrier/asyncio/dispatch.py:56> wait_for=<Future pending cb=[Task.task_wakeup()]>>

from brother.

andyboeh avatar andyboeh commented on August 29, 2024

With one minor thing: the status contains two lines and the lines are separated only with a CR, not a LF. The output is overwritten in the test script, so
"trommel ersetz.sparen"

should actually read

"energiesparen
trommel ersetz."

from brother.

bieniu avatar bieniu commented on August 29, 2024

Yes, I plan to add function to clean status (remove \r and unwanted spaces).

Thanks for testing and sorry that you have to wait so long 😀

from brother.

andyboeh avatar andyboeh commented on August 29, 2024

No worries, thanks for having a look at this!

from brother.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.