Single Board Computer with two OTG USB interfaces. Suggestions?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Single Board Computer with two OTG USB interfaces. Suggestions?

steve jenkin-2
I’m looking at playing with “protocol breaks” and wanted a cheap ARM computer that had two USB OTG ports so I could connect two computers via one USB Host port on each.

I can’t use Ethernet, as IP over Ethernet is the protocol I’m ‘breaking’ (not forwarding directly).
I could use IP over serial, but that fails as well: there’s no break in the protocol.

I might be able to find a robust, well tested non-IP serial protocol, but most devices only push to 115kbps, which seems a little slow.
I’d like higher than 1Mbps.
I looked at the native bus on some of the popular SBC’s, but all the solutions I saw used ‘bit banging’ by the main CPU, leaving no cycles over to do any other work. USB controllers offload the link layer work.

I don’t want to design & build a USB switch to share a single OTG port between two hosts.
If someone knows of a ‘shield’ or ‘cape' that does this, or a standalone circuit board that can be controlled by digital lines, assembled or not, that’d work for me, kinda sorta, but is not my first choice.

The Raspberry Pi model A has one OTG port from my reading, not enough to simultaneously connect to two computers.
I could buy two USB-Host to USB-OTG adaptors, but haven’t found any that are ~$5. [If you know of one, that’s a solution]

The ~US$49 Beaglebone Black has ethernet, one OTG or USB Client and one USB 2.0 Host port.

I’m not sure of the specs of BeagleBone boards.
this page suggests a single OTG port. It also uses ‘USB 2.0 Client’ for some models, which may be the same, or not.
<http://beagleboard.org/boards>

===============

More info about “Protocol Break” is buried in this Wikipedia article:
<https://en.wikipedia.org/wiki/Unidirectional_network>

--
Steve Jenkin, IT Systems and Design
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA

mailto:[hidden email] http://members.tip.net.au/~sjenkin


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Single Board Computer with two OTG USB interfaces. Suggestions?

Robert Edwards
On 09/03/17 20:33, steve jenkin wrote:
> I’m looking at playing with “protocol breaks” and wanted a cheap ARM computer that had two USB OTG ports so I could connect two computers via one USB Host port on each.
>
> I can’t use Ethernet, as IP over Ethernet is the protocol I’m ‘breaking’ (not forwarding directly).
> I could use IP over serial, but that fails as well: there’s no break in the protocol.
>
> I might be able to find a robust, well tested non-IP serial protocol, but most devices only push to 115kbps, which seems a little slow.
> I’d like higher than 1Mbps.
> I looked at the native bus on some of the popular SBC’s, but all the solutions I saw used ‘bit banging’ by the main CPU, leaving no cycles over to do any other work. USB controllers offload the link layer work.
>

Hi Steve,

I am not aware of devices that are both "cheap" and have two OTG ports.

A "cheap" solution might be to use two embedded devices, each with an
OTG port and then use the ethernet port (or the serial port) to actually
transfer the data (in only one direction!) between them.

Serial would be better, as you can physically disconnect the reverse
channel, and you don't need all the IP layers - it's only the data that
you need to move back and forth. But, as you say, the speed would be
limited.

> I don’t want to design & build a USB switch to share a single OTG port between two hosts.

That wouldn't work in any case - USB is a one host (master), multiple
device protocol. This suggestion implies that two masters can both
connect to the same USB device at the same time - the protocol
specifically doesn't allow that.

cheers,

Bob Edwards.

> If someone knows of a ‘shield’ or ‘cape' that does this, or a standalone circuit board that can be controlled by digital lines, assembled or not, that’d work for me, kinda sorta, but is not my first choice.
>
> The Raspberry Pi model A has one OTG port from my reading, not enough to simultaneously connect to two computers.
> I could buy two USB-Host to USB-OTG adaptors, but haven’t found any that are ~$5. [If you know of one, that’s a solution]
>
> The ~US$49 Beaglebone Black has ethernet, one OTG or USB Client and one USB 2.0 Host port.
>
> I’m not sure of the specs of BeagleBone boards.
> this page suggests a single OTG port. It also uses ‘USB 2.0 Client’ for some models, which may be the same, or not.
> <http://beagleboard.org/boards>
>
> ===============
>
> More info about “Protocol Break” is buried in this Wikipedia article:
> <https://en.wikipedia.org/wiki/Unidirectional_network>
>
> --
> Steve Jenkin, IT Systems and Design
> 0412 786 915 (+61 412 786 915)
> PO Box 48, Kippax ACT 2615, AUSTRALIA
>
> mailto:[hidden email] http://members.tip.net.au/~sjenkin
>
>


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
jm
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Single Board Computer with two OTG USB interfaces. Suggestions?

jm
In reply to this post by steve jenkin-2
On 9/03/2017 20:33, steve jenkin wrote:
> The Raspberry Pi model A has one OTG port from my reading, not enough to simultaneously connect to two computers.
> I could buy two USB-Host to USB-OTG adaptors, but haven’t found any that are ~$5. [If you know of one, that’s a solution]
>
> The ~US$49 Beaglebone Black has ethernet, one OTG or USB Client and one USB 2.0 Host port.
>
> I’m not sure of the specs of BeagleBone boards.
> this page suggests a single OTG port. It also uses ‘USB 2.0 Client’ for some models, which may be the same, or not.
> <http://beagleboard.org/boards>
>

Two thought of dubious value:

 1. Have you looked a the SPI bus? That is fast enough to support
ethernet interfaces. This could be connected between two boards then the
onboard ethernet used to connect to the two networks.

2. The Beagle Bone Green comes with four USB ports and the Samsung
Arktik various numbers of USB ports depending on the model.


Jeff.


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Single Board Computer with two OTG USB interfaces. Suggestions?

Robert Edwards
On 10/03/17 11:20, jm wrote:
> Two thought of dubious value:
>
>  1. Have you looked a the SPI bus? That is fast enough to support
> ethernet interfaces. This could be connected between two boards then the
> onboard ethernet used to connect to the two networks.

Good point. SPI would be (much) faster than Serial and you could simply
not connect the reverse channel, so just a clock and the data in one
direction.

As with any data diode, you would have to be very careful not to drop
bytes at the receiver as there is no way to signal a retransmit...

Another way to do it would be to use the Ethernet port, but connect to
a dummy switch port (to get the link status signal). Then "tap" the
TxD line from the sender into the RxD of the receiver, which would be
operating in promiscuous mode.

>
> 2. The Beagle Bone Green comes with four USB ports and the Samsung
> Arktik various numbers of USB ports depending on the model.

http://wiki.seeed.cc/BeagleBone_Green/ says 1 x USB client (also used
for power) and 1 x USB host.

cheers,

Bob Edwards.

>
>
> Jeff.
>
>


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
jm
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Single Board Computer with two OTG USB interfaces. Suggestions?

jm
On 10/03/2017 11:54, Bob Edwards wrote:
>>
>> 2. The Beagle Bone Green comes with four USB ports and the Samsung
>> Arktik various numbers of USB ports depending on the model.
>
> http://wiki.seeed.cc/BeagleBone_Green/ says 1 x USB client (also used
> for power) and 1 x USB host.

The one in front of me is actually the BeagleBone Green Wireless.

  https://beagleboard.org/green-wireless

but from that page it's only one port with a built in hub,

      USB host with 4-port hub

Looks like four ports.

Jeff.


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Single Board Computer with two OTG USB interfaces. Suggestions?

steve jenkin-2
In reply to this post by Robert Edwards

> On 10 Mar 2017, at 11:54, Bob Edwards <[hidden email]> wrote:
>
> Good point. SPI would be (much) faster than Serial and you could simply
> not connect the reverse channel, so just a clock and the data in one
> direction.

Bob & Jeff,

Thanks very much for your suggestions and help. much appreciated.
The USB client + power of the beaglebone Green & friends means I have to figure that out.

When I mentioned hardware to switch USB connections, I was thinking of the USB client being able to disconnect from one host, then connect to the other.
Under software control of the ‘bridge’ board, presumably initiated by a user and not constantly “polling”.

After spending most of the day researching SPI, I’m now tending towards using inbuilt USB-serial devices.

SPI was my first thought, but when I looked for code, I didn’t find anything like the USB hardware + device driver, which I haven’t tested but hope do all the byte send/receive and buffering away from the CPU.

The code I found was a loop that did ‘bit banging’ to send & receive. It used most of the CPU doing that and wouldn’t tolerate
Could be that I'm confusing it with Arduino code I read. The Arduino supposedly has some embedded hardware to support SPI transfers, with pins allocated.

This article has some good links and discussion. Describes Linux kernel devices & device drivers (e.g. /dev/spi0.1)
The BBB has two SPI buses, but SPI1 needs HDMI to be disabled. I still need to trawl the Beaglebone reference docs.
<https://www.linux.com/learn/how-access-chips-over-spi-beaglebone-black>

SPI is designed as a master/slave bus with the master providing both Clock and Chip Select, with the SBC or microcontroller assumed to be master and peripheral devices setup as slaves.

These USB-SPI products are almost all masters. They have a US$187 board that’ll be a slave.
<https://diolan.com/usb-spi-adapters>
<https://diolan.com/dln-4s>

This page, near the middle, describes connecting two Arduino’s using SPI, one Master, one Slave.
<http://www.gammon.com.au/spi>

This short conversation seems to suggest an SBC or microcontroller will only serve as an SPI slave using a tight loop and ‘bit banging’.
<https://groups.google.com/forum/#!topic/beagleboard/UC6pUfQXsWg>
> I don’t think any Linux SPI drivers support slave mode, and there is even an explanation available from Linus Torvalds if you search the web.
> If you need interrupts for more demanding performance, you will have to write your own driver.

The spidev kernel doco doesn’t contain that explanation and my google-fu failed to find it.
<https://www.kernel.org/doc/Documentation/spi/spidev>

From 2016:
spi: Add slave mode support to Linux SPI subsystem
<https://lwn.net/Articles/700433/>
> Author notes problems of being the slave, not master.

and
SPI slave driver implementation [Google Summer of Code]
<https://github.com/pmezydlo/SPI_slave_driver_implementation/wiki>
> SPI slave driver implementation. The task is to create a driver controlling SPI hardware controller in slave mode, and to ensure optimal performance through the use of DMA and interrupt.
> Creating an easy to implement realization of SPI slave would definitely help the BeagleBone community members to write applications based on SPI much more easily.


If you have some better examples of SPI device drivers that allow two masters (beaglebone’s) to communicate, I’d very much appreciate that.

cheers
steve
--
Steve Jenkin, IT Systems and Design
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA

mailto:[hidden email] http://members.tip.net.au/~sjenkin


--
linux mailing list
[hidden email]
https://lists.samba.org/mailman/listinfo/linux
Loading...