MATLAB/JAVA code to connect to multiple USB wifi network interface cards

2 visualizaciones (últimos 30 días)
Hello, I am working on a project were I want to connect to multiple robots (Brookstone Rover) at once. The issue is that all robots have the same IP address (it cannot be changed). They only differ by the ssid of the adhoc network. I've written some pure MATLAB code were I can connect to a robot by creating a tcip object and then control it. But now I want connection to more than one robot at a time.
So to solve part of the problem, I've purchased several USB wifi dongles, and I connect each robot to an individual dongle by means of the ssid. Then, I managed to connect to a specific USB dongle (NIC) by using the JAVA SocketChannel library imported into MATLAB, and then binding to my dongle by telling my socket the name of my USB dongle, and then use the 'bind' JAVA function. But for some reason I cannot send commands to the robot after I've successfully connected. I get an error that says that my 'write' function is not defined for the object I've created. So then I looked at your MATLAB code, and I was wondering if you have any idea how I could use your code to attain my goal of connected to a specific wifi dongle, and then be able to send the commands to the robot through each dongle.
If you could tell me how to use your code for this, it would be of great help to me!
Thank you very much!!!!
  2 comentarios
Walter Roberson
Walter Roberson el 2 de Ag. de 2012
The documentation for the Spy Tank indicates that only one of the devices may be used at a time.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 2 de Ag. de 2012
In a previous life, I did have to do something vaguely vaguely related to this.
The mechanism I used at the time involved multiple (hardware) firewalls with Network Address Translation enabled. Each device with a fixed IP address was connected to an external interface of the firewall, and then interface-specific address translation tables were used on the inside. The fixed IP address was translated in an interface-specific way into distinct IP addresses for use in the internal networks. Since the internal network only saw distinct IP addresses, the internal network could work without problems. Packets going back out were distinguished by the IP address they had for the destination, each mapping into a different subnet and the subnet associated with a different interface and the interface-specific Network Address Translation would then translate the internal IP to the fixed IP needed by the devices.
You could probably do roughly the same thing these days using ipchains or whatever the equivalent is for OS-X.

Categorías

Más información sobre Motion Planning en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by