|
From: Jaco <ja...@jd...> - 2022-10-13 10:16:29
|
OK so basically there is nothing I have to do on the linusb side of things to keep the device alive. What you are saying is I have to look at the application level to see what “new” data is sent to the device to keep it awake? Regards Jaco. From: David Grayson <dav...@gm...> Sent: Thursday, October 13, 2022 9:19 AM To: Jaco <ja...@jd...> Cc: Libusb Mailing List <lib...@li...> Subject: Re: [libusb] Loosing connection to USB devices. The SOF packets are not directly controlled by software. Since you have software that works and software that doesn't you are in a good spot: you can get a USB protocol analyzer and look at the exact packets being sent by the working software and make sure your own software does the same thing. --David On Wed, Oct 12, 2022, 11:13 PM Jaco <ja...@jd... <mailto:ja...@jd...> > wrote: Hi David. Does the host send the SOF packets or is it something I should do in the code? I am not sure if it is the code or what but I have to start looking somewhere to see why is it doing this. I also think that the inverter firmware is the issue but you know how it goes. They say nope it is not our side as our own software works fine. Some other third-party software also seems to work fine but it uses the Linux HIDRAW file based driver. So I am not sure if the HID driver does something else I use libusb and I see it will disconnect the kernel HIDRAW driver when my program starts. This is super frustrating as it all has been working for years and now on the new units we see this. From: David Grayson <dav...@gm... <mailto:dav...@gm...> > Sent: Wednesday, October 12, 2022 6:29 PM To: Jaco <ja...@jd... <mailto:ja...@jd...> > Cc: lib...@li... <mailto:lib...@li...> Subject: Re: [libusb] Loosing connection to USB devices. When the USB host is running, it normally broadcasts a Start of Frame (SOF) packet every millisecond (or maybe at a different rate depending on what USB speed you are using). This should signal to all the devices that the bus is active and they need to stay awake and be ready to respond to packets they receive. You might try using a USB protocol analyzer like the Beagle from Total Phase to see if those SOF packets are actually getting sent. It's also possible that you are seeing a bug in the latest version of the inverter firmware. --David Grayson On Wed, Oct 12, 2022 at 5:56 AM Jaco <ja...@jd... <mailto:ja...@jd...> > wrote: Hi all. I am not sure if this is a libusb issue. I do not think so. I just want to ask a question as I am not a USB guru. I have been using libusb for the last 3 years to communicate with solar inverters from the raspberry pi SBC. All is working 100%. The issue I have is that I started to see that the new inverters will shut down their USB port after a while. So my question is this. Is there some sort of hardware handshake / flow control like with serial to tell the USB device not to go into sleep mode? I have not needed it up till now but we are now seeing that a lot of new devices will go into “sleep” mode. Unplugging the USB device does not help. So I am not sure if this is a hardware issue to address with the inverter manufacturer or what is going on. Kind Regards. _______________________________________________ libusb-devel mailing list lib...@li... <mailto:lib...@li...> https://lists.sourceforge.net/lists/listinfo/libusb-devel |