Brandawg93 / PeaNUT

A tiny dashboard for Network UPS Tools
Apache License 2.0
323 stars 7 forks source link

[Bug]: Device Manufacturer/ Model/ Serial/ Runtime is missing #52

Closed iskandarluqman closed 4 months ago

iskandarluqman commented 4 months ago

Describe the bug

Hello. Before that I would like to say everything besides that is showing perfectly screencapture-192-168-0-40-2300-2024-05-15-13_07_21

Just only some of it are missing and not showing the name is kinda bothering me. I am migrating from webNUT to peaNUT.

screencapture-192-168-0-40-6543-UPS-2024-05-15-13_10_28

Webnut shows the model no issue. So far if I recalled correctly, there isnt any configuration file for webnut so the name must be from the device itself. Just I dont know why peaNUT is not showing the name.

Debug Output

Missing Device Manufacturer/ Model/ Serial/ Runtime

Steps to reproduce

  1. Just create a new docker container with this add-on of configuration
    • WEB_PORT=443
    • USERNAME=admin
    • PASSWORD=admin
    • BASE_PATH=test.example.com

networks: default: name: custom1 external: true

Device Type

Desktop

UPS Device

offline / line interactive, nutdrv_qx

Last Working Version

No response

Brandawg93 commented 4 months ago

That's interesting. What do you see when using the API?

iskandarluqman commented 4 months ago

How do I test the API actually? Sorry I am not familiar. I tried by clicking the API docs screencapture-ups-viperlake-org-api-docs-2024-05-16-15_53_08

I am not sure what is the device ID.

EDIT: I think I found it

screencapture-ups-viperlake-org-api-v1-devices-2024-05-16-16_52_56

I got 33 entries from the API, same as from webnut. I guess my UPS just isnt giving enough information? But now I am just curious how webnut got my UPS name

EDIT 2: Upon checking my ups.conf file, I set the desc field as the model name, that is where webnut is using as the device name. Any ideas how do I solve it?

Brandawg93 commented 4 months ago

Hm. I've never seen a ups that didn't report its model. I've published a new test version that should use your device description in the event that there is no model. Could you try it out? brandawg93/peanut:test

iskandarluqman commented 4 months ago

screencapture-192-168-0-40-2300-2024-05-17-02_02_13

That definitely did the trick. Thank you so much! However I did messed around with changing the driver for my UPS, as I lookup for my UPS, nutdrv_qx was the one to be used as my UPS comes with Viewpower software. Even nut scanner recommended this. Then I decided to try random drivers and I end up with blazer_usb driver. Somewhat this driver is better as it show device.model etc. screencapture-192-168-0-40-2300-2024-05-17-02_08_27

Not sure why but hey it works in the end. Just though letting you know. Thank you again!

Brandawg93 commented 4 months ago

Even better! Thanks for testing my changes, though. I'll close this as completed since your problem is resolved but will still publish a new official version for anyone else with this issue.