I am trying to send data to Jetson nano via the mini USB port. I need to send a bunch of numbers from a USB port on a Windows laptop to be received on jetson nano via the mini USB port.
Speed is a critical element in my application. I have to send the data packet which is a list of numbers (between 9 to 25) in less than 0.5 ms.
I am using Python on both ends. I’ve been experimenting with pyusb but no success so far. I have tried to run the pyusb tutorial example as below and I get the device information as shown below the python code and I get the AssetionError.
Can anyone tell me where I am going wrong? Do I need to know more information about the USB port on the nano side?
import usb.core
import usb.util
#- find our device
dev = usb.core.find(idVendor=0x0955, idProduct=0x7020)
print(dev._get_full_descriptor_str())
#- was it found?
if dev is None:
raise ValueError(‘Device not found’)
#- set the active configuration. With no arguments, the first #- configuration will be the active one
dev.set_configuration()
#- get an endpoint instance
cfg = dev.get_active_configuration()
intf = cfg[(0,0)]
intf = cfg[(0,0)]
ep = usb.util.find_descriptor(
intf,
# match the first OUT endpoint
custom_match =
lambda e:
usb.util.endpoint_direction(e.bEndpointAddress) ==
usb.util.ENDPOINT_OUT)
Yes, the Jetson’s micro-USB port will create a virtual ethernet connection when plugged into a PC, and your Jetson will have a static IP of 192.168.55.1. Using sockets to transmit the data over this virtual network will probably be easier than writing a USB driver to accomplish the same.
Thanks for your response. Speed is a critical element in my application. I have to send the data packet which is a list of numbers (between 9 to 25) in less than 0.5 ms. Is this achievable using the virtual network?
So the ‘AssertionError’ is removed now by accessing the endpoint as below:
ep = dev[0].interfaces()[1].endpoints()[1]
instead of:
ep = usb.util.find_descriptor(
intf,
# match the first OUT endpoint
custom_match =
lambda e:
usb.util.endpoint_direction(e.bEndpointAddress) ==
usb.util.ENDPOINT_OUT)
But now I am getting this error:
NotImplementedError: Operation not supported or unimplemented on this platform
Any idea why? Could this be a kernel issue? I am sending data from a Windows 10 laptop.
So I decided to provide this update in case it is useful for someone. I decided to change from the mini USB port to USB A port. That is, now I am sending data from USB A on my pc to a USB A on Jetson Nano. To make the connection possible, I am using two USB to TTL converters as below where RXD from one converter is connected to TXD from the other converter, in the same way, TXD is connected to RXD, and GND to GND.
I am obviously bound to limits of the converters now, but depending on the type of the converter it could still be several Mbps.
Code:
This is the code that worked for me and is a bit different from what has been provided in the pyusb tutorial. I used this code at the PC end. Depending on your converters, IN and OUT endpoints should be identified. Something similar can be used at the Jetson Nano end to receive and send data:
import usb.core
dev = usb.core.find(idVendor=0x0403, idProduct=0x6001)
Thanks for this information. Could anyone please provide me any new information or documntation webpage link on the complete usability of microUSB in jetson nano.