Activesync connection between two USB-host controllers - networking

For a hobby project I wish to develop some stuff for a WinCE 6.0 device. Ideally, I would have an activesync connection to debug from Visual Studio. The OS appears to have all the prerequisites in place, but I'm not sure about the transport. What are my options?
The device has a USB port which can be used to connect e.g. flash drives for mp3 playback, so this seems to be a USB host port. Can I use this to obtain an activesync connection? I guess using a usb-to-serial cable on both pc and WinCE device could work. Or is there a RNDIS way perhaps?
If possible I rather not disassemble the unit, but if my chances of finding a USB client port or wired ethernet are nonzero I could consider that. Any thoughts?

You can not use USB host port for Activesync connection.
But if it is USB OTG (Both host and client) port, you can use activesync using USB OTG or USB Client functionality.
Your BSP should support USB Serial Client functionality (Search SYSGEN_USBFN_SERIAL sysgen variable in catalog items).
Also, your USB driver (lower level driver) should support USB Client functionality.

ActiveSync will work on a serial cable, so the idea of using an USB-to-serial adapter may work. But you need to have drivers for it in the OS image. There are some CDC drivers and FTDI provides drivers for their chips. You may be able to load them on the device, copying them using a USB thumbdrive and modifying the registry using a registry editor for windows CE, but that's not granted. Windows CE also supports RNDIS compatible USB to ethernet adapter but honestly I don't know if any device of this kind is currently available on the market. If your device has wi-fi connectivity you can skip using ActiveSync and debug over the network.

Related

Recreating the FTDI configuration with wireshark

I would like to write a linux driver for a piece of hardware that has an FTDI (0403:6001) built in. There is a driver for Windows.
I was able to sniff the usb-traffic using wireshark and a virtual machine. Like this, I could filter out the serial messages sent, but don't know how to configure baudrate etc. Also, the default values from pyserial do not work.
Is there a way to read out the configuration of the FTDI from the USB sniffs?
when an FTDI is attached to linux machine the kernel modules ftdi_sio and usbserial are loaded
source code is in https://github.com/torvalds/linux/blob/master/drivers/usb/serial/ftdi_sio.c and https://github.com/torvalds/linux/tree/master/drivers/usb/serial
if you want to talk to the FTDI chips directly you can use the libftdi library on linux https://www.intra2net.com/en/developer/libftdi/
for sniffing the USB protocol communication of an FTDI chip with wireshark see this : https://www.wireshark.org/lists/wireshark-bugs/201511/msg00579.html
you have to load usbmon kernel module for sniffing the FTDI https://wiki.wireshark.org/CaptureSetup/USB

Underlying hardware beneath virtual Com port

I have a device connected to USB port via USB cable to my PC and in device Manager it says - > "XYZ corp Virtual COM port (COM A)"
Is this is same as Serial Com Port.?What is the underlying hardware under it both at device side and Host Side - a Uart or a USB or both at either end respectively?
It sounds like your USB device uses a driver that provides a serial port interface inside your computer. This means that other software can use the serial port APIs that Windows provides to connect to it and use it as a serial port. That software doesn't need to know the details of your USB device; it just needs to know about using serial ports in Windows. Windows ships with a driver that is often used to do this, and that driver is named usbser.sys. Your device might be using usbser.sys or it might be using some other driver.
The serial data is transferred via your computer's USB port and a USB cable. If you look at the signals on the USB cable, you will not see typical serial signals: you will see regular USB packets that just happen to be carrying that data needed for a serial port.
The USB device on the end of that cable might then translate that data into serial signals and act like a normal serial port, or that data might just be used directly inside the device. Without a link to the product in question, it is hard to tell you more than that.

Developing my own modem

I would like to develop my own modem for a custom communication network that will be detectable on the serial port by PC automatically. What I'm uncertain about is the protocol part of the AT commands and how to make it work seamlessly so that computer will detect the modem automatically.
I plan to use ftdi UART to USB converter to interface my microcontroller with the PC using standard serial interface. The PC will then use AT commands to communicate with the microcontroller that will in turn connect to another microcontroller over radio tranceiver and establish a two way serial connection over radio. The idea is that the PC on the other end will run PPPD and listen on it's own modem connection for incoming call and then bridge the connection with it's other internet interface that is connected to internet. The first computer will get it's own IP address using PPPD and will be connected to internet over this custom microcontroller based modem.
But how do I implement the communication protocol between my controller and PC? What commands do I absolutely need to implement? How do I make sure that the computer recognises my controller which is connected over ftdi usb to serial adapter as a functional modem?
Where can I find a speciffication of the minimum command set that is required of a modem?
In practice linux usually discovers a 3G modem automatically for example. Does that have to do with the actual USB identifier of the modem? Is it possible to have linux automatically discover an ordinary serial port modem? I'm thinking that the modem will be sending an AT idle ping repeatedly when it's plugged in so that linux should be able to detect it.

Virtual com communications with no usb2uart bridge?

I'd like to connect a beagleboard-like (custom developed) omap board to a Windows PC using a virtual-com setup. That is, i'd like the board to appear to Windows as a com device and get the COM to send data to our application on the board. The main reason for that is to use virtual-com drivers on windows, since the usb drivers we use now to directly sent data over usb between the host and the board seem not to work properly.
I have done this using the FTDI driver on the past but as far as i know it worked because the device had an FTDI chip that translated the usb protocol to serial signals (am i right ?).If there's no USB to UART bridge on the board, how could i do that ?
By the way, how USB Communication Device Classes fits here ? Should develop a CDC driver for the board ? What should I use then on Windows side ?
I'm kind of confused, so any help will be greatly appreciated :)
Well, i answer myself :)
The solution lies in the Linux USB Gadget Subsystem.
Gadget API

Create connection based on usb cable between 2 computers

I have 2 linux computers. For security, I want to setup a link between them, then program a library for sending/receiving data over this connection. I know that we can use USB networking cable for connection. But I am not sure is it possible to send and receive data on this link, does it depend on cable manufacturer? And Can I program library without using cable driver?
You can't use a USB cable to connect two computers with standard USB interfaces. Standard USB interfaces on computers are host interfaces and you can only connect a host to a device, not another host.
The "cable" described in the article it's not just a cable, the correct name would be USB host-host bridge controller and it powered by a chip designed and manufactured by Prolific - PL 2501. It's described also in the article.
As David Schwarz said with dumb cable (only the wires) you cannot setup a link between two PCs, because USB it's master/slave bus, where a device it's the slave and other the host. The PC it's designed to always be the host (the master).
The response it is that you cannot setup a link or do networking between two PCs using a dumb USB cable. You can do this only using a bridge like the one described in the article.

Resources