Hi Josh,

I'm not finding this Microchip firmware example online at the moment, but there 
was once a PIC sample project that implemented USB HID PDC, which is the 
protocol the NUT usbhid-ups driver speaks. I think the OpenUPS product 
(somewhat misleadingly named IMHO; the firmware is not open source, as far as I 
know) has similar HID descriptors to that example project, and it is one of the 
models with custom variables.

https://networkupstools.org/docs/man/usbhid-ups.html

https://github.com/networkupstools/nut/blob/v2.8.0/drivers/openups-hid.c

As long as you have a good USB HID vendor example project to work from, you 
should be good to go. HID PDC is fairly straightforward, just with a lot of 
different names and variables. For basic system shutdown, there are just a few 
bits in UPS.PowerSummary.PresentStatus that need to be implemented.

Related: I haven't followed ESR's "upside" project in a while, so not sure if 
it will provide a good starting point. If nothing else, there might be some 
good UPS engineering information in the wiki: https://gitlab.com/esr/upside

-- 
Charles Lepple
clepple@gmail

> On Sep 16, 2022, at 3:34 PM, Joshua Quesenberry via Nut-upsuser 
> <nut-upsuser@alioth-lists.debian.net> wrote:
> 
> Good Afternoon,
>  
> I’m part of team that’s been tasked with building an embedded system that 
> does, among other things, battery management, including behaving like a UPS. 
> We’d like to take full advantage of integrating with NUT and hopefully also 
> it offers some support for running custom queries of the device? Can some 
> point me in a good direction for writing firmware that works seamlessly with 
> NUT? Are there any existing firmware frameworks that are open source that I 
> can look at? We haven’t selected a microcontroller/microprocessor yet, but 
> we’re familiar with Microchip and NXP, so if one of those would provide a 
> shorter path to results or you have a 3rd recommendation to consider, please 
> let me know.
>  
> Thanks!
>  
> Josh Q
>  
> 

P.S. please subscribe to the list using the URL below. Gmail allows you to 
easily create filters for list traffic, and once you are subscribed, you can 
turn off delivery (or change to daily digest mode), but in any event, emails 
from subscribers won't need to be manually approved.

> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser


_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to