The USB can either be in device mode or in OTG mode. You cannot have OTG on the same USB bus as a host like a computer.
Multiple OTG devices can switch between host & device mode using "HNP" (Host negotiation protocol) but you can't do that with a pure host.
You would need two separate USB busses - one between the PC and the PIC, and one between the PIC and the devices. I don't think there is any PIC device that has 2 distinct USB interfaces.
I would suggest using a second device along side the PIC32 to act as a USB device to connect to the PC, and use the PIC32's USB in OTG mode to talk to the devices. This other device could be as simple as a FTDI chip to talk to the PIC32 through RS232, or something more powerful like another PIC (maybe a PIC18 with USB support) so you can talk through other protocols like I²C or SPI.
For the software, I definitely think that Linux would be the way to go. The reasons I would choose it over android are threefold:
- Linux has a much easier way of handling file systems than Android. It was built as a server operating system, as opposed to android which was built to run on phones and tablets, so is less file-oriented, despite essentially being a Linux distro at its core.
- There are many platforms running Linux that you could use for a base. Embedded Linux devices are everywhere, whereas android devices are few and far between. I would heartily recommend starting with one of these platforms, as they will help get this off the ground much faster.
- Yes, you are correct about Linux being less prone to viruses.
The GUI problem is a major consideration. However, you are in luck. If you (or someone in your team) is familiar with C, writing a GUI in GTK+ would be the easy way out. This requires installing a bit more software (X, GNOME) than is ideal for an embedded platform, but all things considered I think it is the best way.
Hope this helps!
Best Answer
The host initiates all communication on the bus, the device only responds when asked by the host. For Details see the specs on usb.org.
One must behave as the host and the other as the device. Details can be found in the USB OTG Specs.
For example, many Android phones and tablets can (requires Android 3+). The "magic" is in the On-the-Go cable/adapter, which switches the phone into host mode by pulling the ID pin to GND.