Hi to all,
I vave to transmit data-stream wireless (xbee) from two usb sensors to pc.
Sensors send data (from usb ports) in NMEA format (strings).
I thinked to get data from sensors with 1 arduino and send them ( by x-bee modules) to another board (arduino 2) connected to pc.
I'm thinjing to use arduino-mega because I need to interactt with two serial-channels simultaneously and with 2 different baudrate.
Arduno-mega has many serial channels and I hope I can do what I need (see):
I have already:
set xbee (series1) for communication.
confirmed both sensors streams on serial com (pc) as string-data (from terminal)
Now I have 2 main problems, so I ask some suggestions:
how to connect 2 usb sensors to arduino mega for data-serial input
how to send data (by 2nd arduino-mega as x-bee receiver) to pc splitted to 2 different COM port. (I need to send data-sensors necessarily on differents COM)
A. for 1° point I thinked to use USB Host Shield (but I need 2 of them, can Imount 2??)
B. for 2° point I thinked to use UART-TTL USB Adapter (CH340G).
So I imagined to connect 2 adapters (A) to first arduino (x-bee transmitter) and get data form sensors by rx/tx pins (different serial channels)
Than connect 2 other adapters (B) to second arduino (x-bbe receiver) and use them to send data to pc by 2 separated COM.
A would like to understand if this solution has sense, or if I understtod nothing about.
Tank you.
You wrote to access two USB devices so you don't need serial ports.
That depends a lot on the exact device type. As you failed to post a link to the devices we cannot help further. You might use the USB Host Shield 2.0 but that will work only if someone wrote a driver for your device.
That won't work, at least not with a Mega. You might get it to work with a Leonardo but don't expect support for that in the standard library. As you proved in your post that you know extremely little about USB and it's internals I would recommend against that solution.
No, you don't need two of it, an USB can have several devices connected.
OK, that's what your serial ports above were for? In that case you connect your Mega to the PC with 3 (!) USB connections. Not impossible but very uncommon.
At the beginning you wrote about USB sensors and now you want to connect them by rx/tx pins? Somethings wrong here.
As I wrote, that's possible but extremely ugly.
I tend to the second option, unfortunately.
You should tell us much more details about your project. What exact sensors are we talking about? (links)
Why do you have to have separate COM ports on the PC. Don't you have control over the software on the PC?
Maybe I'm little confused about this project, I'm trying to do many things and I don't know very much about every single step.
So, I start step by step, and I hope to solve one point at time.
I have two sensor: one gps and one underwater acoustic sensor, both with usb output.
both of them, streams NMEA sentences in string format.
I tried to plug the second one to pc and I succeed to read, by arduino terminal, sentences as I was conected an arduino (no drivers asked).
So, in my mind, I figured out to plug them (in some way) and get strings by Arduino, then send data by xbee connection to pc. UPDATE: I succeed to get data by a raspberry from both sensors by serial comminication (with arduino ide and with python). So I'm pretty sure, both devices have USB only as serial-to-USB converter. They should be only serial devices (converted with usb-plug)
The second step wolud be to send data to pc, but the software designated to use (and merge) data from the two devices needs data separated from 2 different com.
So i figured two scenarios:
send data from arduino to pc with two usb ports (spit again sentences of the two devices)
send all data from Arduino standard usb connecction and then spit them by some script (python, or java) in some way (and I'm looking how to do that also in this way)
I didn't realized all points you showed me, and I acknowledge I'm really unknowing about single critical issues
First of all, I think I have to prove in some way how to plug 2 devices to Arduino and get data stream.
I thinked also to usa a raspberry to do that (because it has usb ports) and stream data by xbee to an Arduino (pc connected).
Tank you for your support @pylon and every other suggestion is really appreciated.
And what chip do they use for this conversion? The Arduino USB Host Shield software doesn't have all drivers Linux or even Windows have. While you connect them to Linux, the following command line will give you some more information:
lsusb
or much more verbose:
lsusb -v
May we ask for links to the used devices?
That software (again, a link would help) doesn't allow a source other than a serial port?
Would a solution using the Raspberry Pi not be viable? You can use ser2net (on the Linux side) and something like HW VSP3 on the Windows side to emulate the COM ports (rfc2217) to forward the serial port over WiFi, given that is available.