Connecting two Beaglebone Blacks

I have a need to connect two Beaglebone Blacks together. One will act as a desktop computer that will send commands to the second one. The second Beaglebone will process the command, create a file and send that file back to the first Beaglebone. The two Beaglebones will be in one container and may or may not be connected to a separate computer.

Does anyone know a simple and inexpensive way to accomplish this?

Thanks,

Mike Pitman

On Thu, 9 Nov 2017 13:11:25 -0500, M Pitman
<mpitman1976@gmail.com> declaimed the
following:

I have a need to connect two Beaglebone Blacks together. One will act as a
desktop computer that will send commands to the second one. The second
Beaglebone will process the command, create a file and send that file back
to the first Beaglebone. The two Beaglebones will be in one container and
may or may not be connected to a separate computer.

Does anyone know a simple and inexpensive way to accomplish this?

  At the level of your description, the use of BBB is irrelevant. ANY two
computers with a communication channel could be used.

  Is the "commands" a limited list, or can it be anything (ie; are you
talking about sending shell commands, or something more like options from a
menu)?

  For the second... Plug a short cross-over cable into the ethernet jacks
(or expand the housing to include a small 4-port switch so you can connect
an external device to the system), Run a web-server on the "second", and
have the controlling system make http requests encoding the command and any
needed options, return any file as properly MIME encoded response contents.

  If ad-hoc commands to a shell... Python pexpect on the controller to a
SSH connection on the slave, along with (s)ftp server running on the slave
(so when the SSH session indicates the command is complete and data is
ready, an FTP connection can be made to retrieve the file... Depends on the
file contents -- if pure text, you could just "cat" it to the console/SSH
connection and have the controller copy everything to a local file until
the EOF.

  Somewhere in-between? I suppose one could try to port the Arduino
Firmata library to Linux C++...

I’m assuming you are not taking the cost of the Beaglebones themselves into consideration as the 2 would be them most expensive parts of this project. Here are three ways of connecting 2 BBB together there are tradeoffs with each approach.

  1. (not expensive, not the simplest) Connect the 2 boards via a UART channel; this will provide point to point communication between the two. Your software on each will have to handle all the communication details and functionality to receive commands and send files over UART. There is probably code out there to do some of this but you have to integrate it together for your application. Once cable between the two boards and you still have your ethernet port available for external connection. This is my least favorite option.

  2. (Simple, not least expensive) Connect the two with a cheap ethernet switch. This allows you to use built in command line functions to control and copy files (ssh, scp). You can get a pretty inexpensive 5 port switch, which will maintain the ability to communicate to both BBBs. TP-Link 5-Port Fast Ethernet Unmanaged Switch | Plug and Play | Desktop (TL-SF1005D) or Brash Networks 5-Port 10/100 Mbps Full Duplex Desktop Unmanaged Fast Ethernet Switch BN-FE105 are a couple of ethernet switches that are under $10. You could remove the boards from their enclosure if it makes it easier to repackage. While not the least expensive it’s really not that expensive either.

  3. (Simple, not expensive) You could also connect both with an ethernet crossover cable. This would eliminate the need of a switch at the expense of losing the ability to connect to them externally via ethernet. You do have the USB ports to connect to them I suppose. This would allow you to use ssh/scp while eliminating the cost of the switch; simple to connect, inexpensive to implement. Buhbo 1 ft CAT5e Crossover Cable UTP, Gray Wire with Green Boot

Adam

No you don’t need a crossover cable. I can’t remember the last time I used one. Ethernet ports have automatically handled that for some time now.

As for the original question, if you can program I would go with using a udp socket.