Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power ports for USB #5319

Closed
garbled1 opened this issue Nov 7, 2020 · 7 comments · Fixed by #5362
Closed

Power ports for USB #5319

garbled1 opened this issue Nov 7, 2020 · 7 comments · Fixed by #5362
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@garbled1
Copy link

garbled1 commented Nov 7, 2020

Environment

  • Python version: 3.6
  • NetBox version: 2.9.8

Proposed Functionality

USB style power ports/plugs/etc

Would want the same ones offered in console ports:

USB Type A
USB Type B
USB Type C
USB Mini A
USB Mini B
USB Micro A
USB Micro B

(I'm not sure, is that actually all the USB types these days?)

Use Case

Many smaller devices these days use things like USB-A, MicroUSB, mini-usb, USB-C etc etc for power. While a single PI might be powered directly by a wall-wart adapter, multiple ones might be powered by something like a USB charger, which has one NEMA style plug, and then 10 USB ports. You can code this into netbox by just saying everything is type OTHER, but that's not very precise.

It's very difficult for me to accurately track IOT style devices or PI-Clusters, etc etc accurately without this.

Database Changes

External Dependencies

@ypid
Copy link
Contributor

ypid commented Nov 8, 2020

I assume you only checked out interface ports. Checkout console ports. All your USB types are supported. I misread this "Would want the same ones offered in console ports:", sorry. Also, this "You can code this into netbox by just saying everything is type OTHER, but that's not very precise." confused me.

However, I think for your use case power outlets would be more suitable. Refer to https://netbox.readthedocs.io/en/stable/core-functionality/device-types/ for the details. And there is no "Other" port type for power. I would propose to extend the PowerPortTypeChoices with "Other". As USB powering is not really common (in the data center), I would propose to not model all the USB types as power outlets. At a maximum USB type C because of the USB Power Delivery (USB PD) (rather don’t do that because USB type C does both, data and power). Every other type use is probably violating the USB spec anyway. Using the Netbox power model would also allow you to track power usage of your USB devices, see https://netbox.readthedocs.io/en/stable/core-functionality/power/

Modeling external power supplies that are just for one device is easy. You can just abstract it away and think of it as being part of the device itself. Your use case with multiple outlets is kind of a PDU that can be modeled like this https://netbox.readthedocs.io/en/stable/core-functionality/power/, considering that there is a "Other" type.

On the other hand, I feel this is slightly related to #1099 because USB is basically a console port (compared to an interface as in #1099) that can also provide power. But again, I feel this is too uncommon in the data center.

@garbled1
Copy link
Author

garbled1 commented Nov 8, 2020

I agree this isn't necc. common in a datacenter, but is netbox only designed for datacenters? I'm using it to map my homelab out, and it's very useful for this.

Maybe it's a spec violation, but the fact remains that I have a bunch of objects that I model in Netbox that have a USB-something power port, and then plug into something else. Sometimes that's a wall-wart. Sometimes I have direct charging ports on outlets, sometimes I have multiple-port USB power systems.

These are not consoles, they are power. I have USB consoles, which I do use the modelling for, and it's great.

@ypid
Copy link
Contributor

ypid commented Nov 8, 2020

My current use case for Netbox is also not the typical data center. Still, https://netbox.readthedocs.io/en/stable/#keep-it-simple applies (at least how I see it, I am not a Netbox dev). So would you agree with my proposal to just add a "Other" power outlet type? Note that I once had a feature request that was also a bit special which is actually related to yours, see #5013. Maybe the description field together with the "Other" type solves it? We don’t need to overdo it, right ;-) ?

@jeremystretch jeremystretch added status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Introduction of new functionality to the application labels Nov 9, 2020
@garbled1
Copy link
Author

I think "Other" type power port is certainly useful in general. I can imagine things like 48v systems or 12v systems that aren't as easily covered. But at this point USB used as power is becoming kind of a standard. They sell 19" rackmount USB PDU's (a few of which I've been eyeing). I have 1 rackmount PDU that has 2 USB charging ports on it. I mean "Other" is certainly better than saying all my PI's are using nema15's into some kind of magical PDU instead of a giant charging station, but its also obnoxious. The device has 2 type C's and 8 type A's, so, how do I differentiate that? The point is I want to go into netbox and look and say "oh, ok, I have a free type C there, so I can plug in this device on that power unit"

It's not impossible to work around, and it doesn't make netbox useless or anything silly like that, but the reality is a bunch of stuff is just powered by USB now, and I suspect this will only continue to grow as power requirements get lower for things.

@jeremystretch
Copy link
Member

jeremystretch commented Nov 16, 2020

IMO it makes sense to add USB ports and outlets as types in the same right as the existing types. However, further thought needs to be given to what specific USB types qualify as power outputs (outlets) and consumers (ports). I'm tagging this as "needs owner" for whoever would like to volunteer.

@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Nov 16, 2020
@ndom91
Copy link
Contributor

ndom91 commented Nov 19, 2020

I've done a little research, and next to the typical USB Type A port, it looks like theres only a few others than can act as outlets, including micro-USB and the newer USB-C.

image

https://en.wikipedia.org/wiki/USB#Power

All others can receive power afaik.

I can go ahead and add those are power outlets / power ports in a separate section in the types dropdown. Anything else that needs to be watched out for here?

@jeremystretch
Copy link
Member

@ndom91 sounds good, I'll assign this to you. 👍

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Nov 19, 2020
jeremystretch added a commit that referenced this issue Nov 24, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants