Is posible receiving data using Wifi and Sending using Ethernet in Arduino YUN

HI…i am doing small project on Arduino YUN

the components include an Arduino Yun board , a wireless router and a network switch.

the main process to happen is, i have to connect my Arduino to the wireless router via WIFI of YUN and acquire data from another device connected to the same router with the help of IP address and send the acquired data through the Ethernet port of YUN to a network switch and depending upon the encoded IP address data should be sent to a particular device. i came across some examples with seperate wifi shields but i am not able to get a clear knowledge on YUN…CAN ANYONE HELP ME WITH THIS…I AM TOO CONFUSED ON THIS ONE…Any help is highly appreciated…

I have attached the block diagram for better understanding, if i am not clear…

Thank You in advance…

Help me, please...!!!!

Yes, the Yun can easily handle communicating on the WiFi and Ethernet ports at the same time.

Well, maybe "easily" is a misnomer...

The Yun is very different from any other model of Arduino, and it requires a different way of thinking. There are two independent processors on the Yun:

  • The '32U4 that runs your sketch, just like a Leonardo or Pro Micro
  • And a comparatively powerful Linux processor.

It's the Linux processor that manages the WiFi and Ethernet interfaces, using a version of a router operating system. Being a router at heart, both network interfaces can be used at the same time, and the router software uses the IP addresses of the two interfaces to determine which interface should be used to talk to a remote node.

Because of the Linux processor, the Yun is NOT equivalent to having a Leonardo with a WiFi shield and an Ethernet shield. The sketch does NOT talk directly to either network interface, and does not used the standard WiFi or Eth libraries. Instead, the sketch talks to the Linux processor using the Bridge library, and it's the Linux processor that actually performs the network communications.

Using the Bridge library, you can write all of the communications logic into the sketch using the BridgeClient or HttpClient classes to listen for incoming connections, or make outgoing connections. Note that neither the BridgeClient nor HttpClient classes make mention of WiFi or Ethernet, because it just doesn't matter - they are both network clients, and they don't care whether they are talking over the WiFi or Ethernet interfaces - the Linux side will figure it out automatically.

But I personally find that a more efficient and powerful way of using the Yun is to write most of the program logic (especially networking code) on the Linux side using Python (or any of the many other supported languages.) Then, the sketch uses the Process class to start up and communicate with the Python (or other language) script on the Linux side. In my Yun projects, I do most of the work on the Linux side using one or more Python processes, and the sketch running on the '32U4 only handles the control of hardware plugged into the shield connectors.

So, long story short, the Yun should be able to handle all of your network communications requirements. But your programming effort is likely to extend beyond a simple sketch.