Mimic USB Vendor or Product ID - usb

After having been studying a USB Packet Sniffer based around the BeagleBoard xM (https://gitorious.org/beagleboard-usbsniffer/), I have been at a loss as to how the driver actually works in a certain area.
I now understand that the BeagleBoard acts as a one port USB hub for the USB host to see, so that it may view and log the packets going through it. The part i'm trying to currently understand is how exactly the BeagleBoard is able to be somewhat transparent, and able to mimic the USB Vendor/Product ID's of the device being sniffed.

There is nothing to mimic. If it behaves as a hub, it can see all the traffic going between the computer and the device under test because all the USB packets would go through the hub. Packets are received by the hub and transmitted along to the other device.

Related

Changing USB configurations/interfaces on the fly; initiated by the device

I'm working on a USB MIDI device that will function as the receiver for a wireless system. This device will communicate bi-directionally though a radio module with the transmitter, a separate piece of hardware that runs in USB host mode.
The receiver will be plugged into a PC. MIDI devices plugged into the transmitter need to show up on the PC as MIDI ports. Since the transmitter supports a USB hub, there can be multiple devices plugged in.
There are two requirements that I'm not 100% how to meet:
1.) The MIDI port names on the PC end need to reflect the name supplied by the USB device plugged into the transmitter so that it's clear which device the port is for.
2.) The set of MIDI ports on the PC needs to update when devices are plugged/unplugged from the transmitter. This is the crux of the question: is there a way to update the available USB interfaces/MIDI jacks initiated by the device?
The brute force way of doing this would be to completely reset the receiver any time it receives a message from the transmitter that there's been a change (on reset,the receiver would then poll the transmitter for current devices and supply the updated info when the host PC re-enumerates).
The transmitter/receiver hardware are both based on PIC32MZ MCUs (no RTOS). I'm good with writing the USB code to get the host/receiver end to do whatever. The question is about how, at the level of the USB protocol, to do this.
Also, just to be clear: The transmitter/receiver communication will be an ad-hoc protocol and the receiver will set up all its USB configuration data itself; the idea isn't to attempt to seamlessly enumerate devices over the wireless link.
To show the port names on the PC, just copy the USB descriptor strings over to the transmitter.
The only way for a USB device to change its configuration is to reset itself, as if it had been unplugged, and to let the host re-enumerate it. So the only way to prevent multiple devices from interfering with each other is to have multiple (virtual) USB devices on the receiver. If your hardware does not support this, then you cannot avoid the reset.

USB over wireless

this is a more HW question. I was wondering, is someone aware of a device which enables to connect a USB device to a PC over WiFi?
The idea is to plug USB device into a transmitter and have a receiver at the PC side. The data would be transferred wirelessy.
I have learned that the key word for this type of devices is WUSB. However, I am failing to find a successfully stories behind using some of these, as well as a good device.
Does someone have an experience?
Thank you in advance.
I haven't seen any USB hubs that can transmit over Wi-Fi. But there are several Wireless Hubs available. Like these
http://www.ebay.com/itm/like/131933064085?lpid=82&chn=ps&ul_noapp=true
https://jet.com/product/detail/49089829a0c7458d9d30c1ec308febef?jcmp=pla:ggl:gen_electronics_a1:networking_bridges_routers_wireless_access_points_a1_other:na:PLA_348772140_24231289500_pla-177033586620:na:na:na:2&code=PLA15&ds_c=gen_electronics_a1&ds_cid=&ds_ag=networking_bridges_routers_wireless_access_points_a1_other&product_id=49089829a0c7458d9d30c1ec308febef&product_partition_id=177033586620&gclid=CJTyuaXNjM8CFYQkgQodOLAIkA&gclsrc=aw.ds
They have an adapter you plug into the PC and the hub works just like it would if it were wired.
Why do you need it to transmit over Wi-Fi specifically?

How does USB integration work from the device end?

Hopefully I will have more luck today. I have no prior USB integration and about 8 months of learning embedded systems on Atmel devices. I am trying to use an Atmel SAM L series to connect over USB to a computer. The use case is for data transfer. Specifically, the MCU will be gathering data from it's sensors and packaging it for USB transfer.
I have searched through and read up on all of Atmel's included USB examples. I have also started reading through usb.org's class specifications for CDC.
I have running now something that lets me send data along one com port, into the target usb and then out the debugger usb to another com port. However, I don't think this is real USB.
My problem is two fold.
1.) I do not fully understand what differentiates USB from serial communication on a com port.
2.) Even if I were doing it correctly, I'm not sure how to test and verify that I have indeed created a legitimate USB device that can be accepted by a host computer.
Links to documentation(Atmel or generic) or example code would be appreciated.
1) USB is defined in the USB specifications from http://www.usb.org. Serial ports were an older and simpler interface that involved sending data back and forth asynchonously on pins with names like TX and RX. The USB CDC class and its ACM subclass allow you to make a USB device that emulates a serial port. If you make your device be a USB CDC ACM device, then you don't need to supply any drivers for Windows 10, Linux, or Mac OS X.
2) You can read the USB specification and the CDC ACM specification. You can run the USB command verifier. You can test your device with a variety of different USB hosts to make sure it works.

Wifi signal logger device

I am working on indoor gps tracking and for this I need a wifi signal logger which can receive the signals from different smartphone(whose wifi is turned on) an send it to a remote server. I wanted to know, where I can get this kind of hardware, having capability to receive signals from different smartphones and log its signal strength and mac address in a remote server.
Please let me know the details.
Thank you in advance.
Pravin Prasad
In simple terms, Wifi clients(smartphones, notebooks etc.) send periodic Probe Request packets to actively seek wifi access points and Wifi APs(routers, gateways etc.) send periodic Beacon packets to advertise the presence of WLAN network.
You can use any wifi capable device like a smartphone or notebook to log the above packets.
Configure your wireless card in monitor mode.
Use a packet sniffer(for example, wireshark) to capture the traffic on the wireless interface or write your own with libpcap. You may filter on the packet type, source, destination etc.

usb sniffing with wireshark

at the moment I am using usbmon to sniff usb. for better understandability I want to use wireshark. I've used wireshark before for sniffing ethernet packets. But what to capture to sniff USB Packets ? I meant I need to start by selecting which interface to capture in wireshark. but what wold I select there for usb ?
Grab newest wireshark.
Use lsusb before and after plugin in device so You know which usb bus its plugged into.
type in terminal:
su -c "modprobe usbmon" && su -c "wireshark"
(First load kernel module that allow for usb sniffing for root, second load wireshark as root)
Than select usbmonX, where X stand for usb bus number (lsusb show those numbers).
After than you still need to filter packets for device / vendor id, or something else device specific, as wireshark will show all packets from all devices plugged into that bus. (Again lsusb before/after plugging you device will help).
Have you taken a look at the documentation for that on the Wireshark website?
In libpcap 1.0.x, the devices for capturing on USB have the name usbn, where n is the number of the bus. In libpcap 1.1.0 and later, they have the name usbmonn.
a quick notice since I just started using wireshark to sniff usb packets on linux. as I understand you need usbmon module loaded (which if you are using it should be). Additionally I seem to recall that while wireshark can be setup to let non root users sniff ethernet packets, some limitation required root access for usb packs (at least at the time of writting).
Similar to what others have said, on my system, Ubuntu 12.10, the usb interfaces have names like "usbmon1 USB bus number 1" and so forth.
(you might look at http://biot.com/blog/usb-sniffing-on-linux)
the link listed has an image showing a filter which can be used to select only traffic to from a device number (from lsusb).
I hope thats helpful
#przemo_li You want to filter by device address to see the communication from both the host and the device. The filter for that is usb.device_address ==.