Go Down

Topic: Using an Ethernet Shield on Arduino Yun as Switch (Read 1 time) previous topic - next topic

ZepHakase

Hi all.

I do not know if a crazy idea! I would try to use the Arduino Ethernet Shield on a Yun  in switch mode writing a openwrt driver for swconfig. Is there any experience with this?


sonnyyu

#1
Nov 22, 2014, 05:55 pm Last Edit: Nov 22, 2014, 06:19 pm by sonnyyu
You can not use Arduino Ethernet Shield since it is on arduino side MCU, openwrt driver for swconf is needed at CPU side.


CPU at Arduino Yun is AR9331, the AR9331 includes a MIPS 24K processor, five-port IEEE 802.3 Fast Ethernet. Switch with MAC/PHY.

The hardware design team of Yun decides only break out only one port.  if you have to have more than one ethernet port, using Ethernet USB Dongle.





ZepHakase

Thanks Sonnyyu,
I understand what you say and I agree, of course.
But my question is different and I really don'n know the answer 'cause I haven't begun to study the problem. Is it possible using the Arduino Ethernet lib to build by myself an swconfig driver at cpu side for openwrt to show the arduino ethenet shield or a pool of Arduino Ethernet Shield as a vlan to configure it as a switch on the bus of the AR9331? Sincerely I don't know but my stomach think No.
But a better question could be: Is it possible bypass the Arduino Ethernet lib to command directly the WiZNet Wi5100 on board at the Ethernet Shield ? In this case my stomach could become possibilist...

Zep

ShapeShifter

It could be possible, but it will be difficult and probably have poor performance.

The issue is that any Ethernet shields would only be visible to the 32U4 processor, while a swconfig driver would run on the AR9331 side. So, basically, the driver would have to field requests, pass them to the 32U4, and let it pass it on to the Ethernet shield(s). Communications would take place over the serial port that is shared by the processors.

It would be slow sending all of the data back and forth over the serial port. However, since the shield uses the SPI interface, and the AR9331 can also drive the SPI interface, that portion of it might be able to be sped up by bypassing the Arduino code. You would still have to drive the chip selects and other signals from the 32U4 side, and would still need to communicate those controls over the serial port.

In essence, you will need code on the Arduino side to control most of the pins, a protocol to send commands and status over the serial port, and a very customized driver on the Linux side. Of course, you won't be able to use the Arduino Ethernet shield library, so you will have to understand the internals of how the Ethernet chip works.

A very interesting project, which would be quite a learning experience. But it will be an expensive proposition in both hardware and time. A more practical solution could be to get a commercial router and load OpenWRT on it.

sonnyyu

#4
Nov 23, 2014, 01:52 pm Last Edit: Nov 24, 2014, 04:24 am by sonnyyu
What are you asked is ethernet over uart or ethernet over spi.

AR9331 MAC/PHY's speed is  100 Mbps.
AR9331 has USB2 port which give you 480 Mbps.

SPI              0.89 Mbps
UART           0.50 Mbps
USB 2.0   480.0 Mbps (Megabits per second)
USB 3.0 4800.0 Mbps  10 times faster than USB 2.0.  


ethernet over USB 2.0 is OK, but not ethernet over uart nor ethernet over spi.

raloc

Hi all.
I need to have a second Ethernet port on my Arduino Yun.
The solution may be an Ethernet USB Dongle.
Do you know some model of USB to Ethernet dongel with tested Arduino Yun device compatibility?
Thank you in advance.
Carlo

sonnyyu

#6
Nov 25, 2015, 10:39 am Last Edit: Nov 25, 2015, 10:42 am by sonnyyu
Hi all.
I need to have a second Ethernet port on my Arduino Yun.
The solution may be an Ethernet USB Dongle.
Do you know some model of USB to Ethernet dongel with tested Arduino Yun device compatibility?
Thank you in advance.
Carlo
OP ask
Quote
writing a openwrt driver for swconfig.
Second Ethernet port at Yun:






Go Up