Can you plug the RICOH THETA V directly into the Jetson Nano USB port on the Nano and then use another port for the HUB and your other peripherals?
The Jetson Nano can power the THETA V over the USB cable without a powered hub as long as you’re not streaming in 4K (which you’re not).
There is no configuration on the THETA V. The technique will not work on the SC2.
I am not familiar with usb_modeswitch
.
This technique with the USB cable to power on the device is not in the official RICOH documentation and is a community workaround. I’m not sure what is actually happening with the camera. However, if you physically unplug and plug the USB cable into a PC/Mac/Nano or other device then you can see that the camera will turn on. It must be in a power off state (not sleep).
Based on this behavior, we can work backwards and try to replicate the unplug and plug-in behavior in software. There is no configuration on the THETA V needed, but we also don’t know what is being sent to the camera over the USB cable for it to turn on. I think it is just an electrical signal, not data.
The test below is done with a Jetson Nano on a “toy” robot to simulate industrial use.
There is a separate Windows kiosk that is connected to the network. I’m using ssh from the Windows PC to send a command to the Jetson Nano to control the RICOH THETA Z1, including power on. In this demo, the Jetson is connected to the network with Wi-Fi.
The small application that I used is below.
/****************
* Tested on Jetson Nano running JetPack 4.4
* The RICOH THETA V and Z1 will turn on from a power off state when
* the USB cable is plugged into a port. This example will power cycle
* the USB ports of the Nano. You must have libusb-1.0-0-dev installed
* on the Nano and link to it.
*
* Additional information on using libusb_control_transfer is below.
* https://www.cs.unm.edu/~hjelmn/libusb_hotplug_api/group__syncio.html
*****************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <libusb-1.0/libusb.h>
unsigned vid = 0x0bda;
unsigned pid = 0x5411;
int power_cycle(libusb_device_handle *hub_devh)
{
int ret = -1;
/*ep0 vendor command enable*/
ret = libusb_control_transfer(hub_devh, 0x40, 0x02, 0x01, ((0x0B<<8)|(0xDA)), 0, 0, 100000);
if (ret < 0) {
printf("[error]:ep0 vendor command enable fail.\n");
return ret;
}
/*ep0 vendor command disable*/
libusb_control_transfer(hub_devh, 0x40, 0x1, 0x08, 0, NULL, 0, 100);
libusb_control_transfer(hub_devh, 0x40, 0x3, 0x08, 0, NULL, 0, 100);
libusb_control_transfer(hub_devh, 0x40, 0x02, 0x00, ((0x0B<<8)|(0xDA)), 0, 0, 100000);
return ret;
}
int main(int argc, char *argv[])
{
int ret=0;
libusb_device_handle *hub_devh;
libusb_context *context;
ret = libusb_init(&context);
if (ret != 0){
printf("[error]:libusb init fail.\n");
return ret;
}
hub_devh = libusb_open_device_with_vid_pid(context, vid, pid);
if (!hub_devh) {
printf("[error]:open device %04x:%04x fail.\n", vid, pid);
return -1;
}
ret = power_cycle(hub_devh);
return ret;
}
build
$ sudo apt-get install libusb-1.0-0-dev
$ gcc -o power_cycle reset_jetson_usb_power.c -lusb-1.0
$ sudo ./power_cycle