Re: Libusb-win32 code to control Ricoh Theta
Kevin Cain <[email protected]>
| Newsgroups | gmane.comp.lib.libusb.devel.windows |
|---|---|
| Message-ID | <CACnUKRtQkRSXG7QKW8_HQvpHB2xXM3PNCRcEnR0JHVgH5bcRtQ@mail.gmail.com> |
Hello, Ekkehard, I had the same thought about using a USB 'sniffer' to see how PTP requests should be formed, but unfortunately Ricoh's PC software does not control the camera. It mostly updates firmware -- and here is the log I recorded while updating firmware using USBTrace (similar to USBSnoop): www.insightdigital.org/Ricoh_Theta_Device_Log_USBTrace.html The connection statistics with the device are here: www.insightdigital.org/Theta_log.html I also tried the various permutations of buffer string length you suggested, to no avail. Thanks again, -Kevin On Mon, Jul 21, 2014 at 12:24 AM, Ekkehard <[email protected]> wrote: > Hi, > the trailing 0x00 was just a guess since often text strings are "zero > terminated". I dont have any closer information about what you are doing, > sorry. > If you have a sample program that can trigger the capture, you may try to > use "UsbSnoop" to see the data transmitted. > > http://sourceforge.net/projects/usbsnoop/ > > Best regards > Ekkehard > > > Kevin Cain wrote > > Thank you for your suggestions, Ekkehard, > > > > The 'memset(buffer, 0, 64)' command I send should fill the buffer with > '0' > > values, unless I'm making a fundamental error. I will try your variants. > > Your suggestion that the camera may require a trailing '0' is > interesting > > -- I will try that as well, is there any reference to support that? > > > > I suspect my problem is in correctly deducing the parameters required to > > send messages to the Theta via libusb, e.g.: > > > > *int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, > > int > > value, int index, char *bytes, int size, int timeout);* > > > > I used USBTrace to detect the Ricoh-provided driver and uploaded the > > results here: > > www.insightdigital.org/Ricoh_Theta_Device_Log_USBTrace.html > > > > However, I don't yet see how to find the request details for the camera > in > > question. I assume this comes up each time a programmer wishes to > control > > a new device with libusb -- are there any resources that might help me? > > > > Any help divining the correct syntax and message protocol parameters > would > > be wonderful. > > > > Thanks, > > > > -Kevin > > > > > > On Sun, Jul 20, 2014 at 3:25 AM, Ekkehard < > > > edomning@ > > > > > > wrote: > > > >> Hi, > >> I have'nt done anything with the camara matter. From the programmers > >> view, > >> there is one thing I dont understand. > >> The used bytes the buffer are only 15 = "trigger-capture", but you are > >> sending 64 bytes. If the command detection algo in the camera validating > >> the > >> length of the buffer first, than the command will not be recognised. > >> So maybe you can try > >> int result = usb_control_msg(devHandle, 0x21, 9, 0x2, 0x0, > (char*)buffer, > >> 15, 100); if (result == 15) cout << "Successfully sent all bytes to > >> camera" > >> << endl; > >> or, if the camera may expect one zero at the end of the command > >> int result = usb_control_msg(devHandle, 0x21, 9, 0x2, 0x0, > (char*)buffer, > >> 16, 100); if (result == 16) cout << "Successfully sent all bytes to > >> camera" > >> << endl; > >> > >> A minor thing, as far as I know there is no need to claim the interface > >> since the control mesaages are not related to any interface. > >> > >> Best regards > >> Ekkehard > >> > >> > >> > >> > >> -- > >> View this message in context: > >> > http://libusb.6.n5.nabble.com/Libusb-win32-code-to-control-Ricoh-Theta-tp5713450p5713451.html > >> Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com. > >> > >> > >> > ------------------------------------------------------------------------------ > >> Want fast and easy access to all the code in your enterprise? Index and > >> search up to 200,000 lines of code with a free copy of Black Duck > >> Code Sight - the same software that powers the world's largest code > >> search on Ohloh, the Black Duck Open Hub! Try it now. > >> http://p.sf.net/sfu/bds > >> _______________________________________________ > >> Libusb-win32-devel mailing list > >> > > > [email protected] > > >> https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > >> > > > > > ------------------------------------------------------------------------------ > > Want fast and easy access to all the code in your enterprise? Index and > > search up to 200,000 lines of code with a free copy of Black Duck > > Code Sight - the same software that powers the world's largest code > > search on Ohloh, the Black Duck Open Hub! Try it now. > > http://p.sf.net/sfu/bds > > _______________________________________________ > > Libusb-win32-devel mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > > > > > > -- > View this message in context: > http://libusb.6.n5.nabble.com/Libusb-win32-code-to-control-Ricoh-Theta-tp5713450p5713455.html > Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > Libusb-win32-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel > ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Libusb-win32-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel