Yun connected to Due

Hi,
I am doing one project using for Arduino boards. Basically I have 2- Arduino YUN and 2-Arduino Due with Ethernet shield. As yun has inbuilt Wifi system, I connected Yun to wifi and configured it, it was successful. But now,

My questions is: Can I do connection between Arduino Due and Arduino Yun using Ethernet cable and pass data in between them, if yes then how ?

I have another question on broader level: I brought a FL Switch SFNB 8TX, and wired all the arduino boards with Ethernet cable to this switch. But I am unable to use it as communication between them ? Can you please let me know if I need to configure something or how to proceed further? Even a toy "code" working would be fine, say sending a alphabet from Due to Yun and then displaying it in the console using yun.

Please help.

Thanks in advance.

Regards,
Swaroop

Yun UDP supported

Im not an expert but I think you need a router to connect two arduinos via tcp, the router asigns them an ip adress and then they can call each other.

Plan B:

"Yun shield"+ "Arduino Due"

mart256:
Im not an expert but I think you need a router to connect two arduinos via tcp, the router asigns them an ip adress and then they can call each other.

@mart256,
IP address can be static. They don't need to be assigned. This means you have to setup each machine with it's own IP and keep track of it. This is very tedious.

Your suggestion to have a route/bridge assign the IP would be the way to go. However, the Yun is capable of doing it, if the DHCP is on for the ethernet. Doing it this way the the YUN is the DHCP server for both wired and wireless connection.

If however, you want to connect to the internet, then a hub/router/bridge is the way to go. Most home or office system now have this.

@swaroop2011,
you have purchased a simple ethernet switch (FL Switch SFNB 8TX). It is intended to optimize traffic. You will need something to set the IPs with.

Please read the following articles, then please decide if you want to connect your YUN to the internet (outside world) (Turn off your Javascript if you can to stop the dumb ads.)

What Are IP Addresses in Home Networking?
http://www.dummies.com/how-to/content/what-are-ip-addresses-in-home-networking.html

Using Static IP Addresses on Private Networks

To be clear on your choices

  • The Yun connects to the other Arduino units
  • The Yun connects to the other Arudino units AND the internet

Jesse

Thank you sonnyyu, mart and Jesse for your valuable inputs.

@Jesse

I don't want my arduino system to connect to internet.
Is it necessary to connect to internet for exchanging information ?
Basically I have 4 arduino's as I mentioned in the first post, So is there another way where I can exchange information between different arduinos without using internet ?
I know that one of the way to exchange information is using common SCL and SDA lines. Which I was successful in doing that. But practically if number of arduinos increases that is not feasible way to do. So I thought it could be possible to just send and receive information via Ethernet and I don't require router or internet for that, so that's why I just brought the SWITCH which connects all arduino using Ethernet.

Can't we assign the IP address manually to each arduino while coding it ?

Please correct me if I am wrong?

You can share info using tcp/ip without internet.

ok.
Thanks.
Will try that out and see.
But I wish it would have been possible with the switch I have "FL SWITCH SFNB 8TX" and not the router,
because now i need to buy a router.
I thought this switch would work, as we can assign manually the ip address to each arduino.
Let me know if i am wrong.

swaroop2011:
Thank you sonnyyu, mart and Jesse for your valuable inputs.

@Jesse

I don't want my arduino system to connect to internet.

  1. Is it necessary to connect to internet for exchanging information ?
    Basically I have 4 arduino's as I mentioned in the first post,

  2. So is there another way where I can exchange information between different arduinos without using internet ?
    ::::SNIP::::

  3. Can't we assign the IP address manually to each arduino while coding it ?

  4. Please correct me if I am wrong?

On #1, you do NOT need to connect to the Internet to exchange information.
On #2, Each machine needs to be assigned an IP address/number so it can exchange information with other machines.
On #3, It is possible to assign IP address/number manually. It is also possible to have this automated.
On #4, you are doing pretty good so far.

There are two ways to go. Someone familiar with the Ethernet shield will have to confirm.

#1 setup a DHCP server on the YUN and have the Yun assign the IP to all devices.
#2 setup a STATIC IP address/number on the ethernet of the YUN, and then you have to assign a STATIC IP address/number to each device.
NOTE: This puts the STATIC IP on your ethernet (hardwire) only

Either way you go, SonnyYu has the recipes for you.

Set up dhcp server at wan (ethernet port)
http://ibuyopenwrt.com/index.php/8-yun-compatible/110-set-up-dhcp-server-at-wan-ethernet-port

Set static ip at wan (ethernet port)
http://ibuyopenwrt.com/index.php/2-uncategorised/211-set-static-ip-at-wan-ethernet-port

Have a look at these recipes. Someone else will confirm if you can use DHCP on the Due.
I'm almost sure SonnyYu has some recipes for this, or maybe someone else does. :wink:

Jesse

swaroop2011:
But I wish it would have been possible with the switch I have "FL SWITCH SFNB 8TX" and not the router,
because now i need to buy a router.
I thought this switch would work, as we can assign manually the ip address to each arduino.
Let me know if i am wrong.

You are not wrong. If you just want a bunch of local nodes to talk to each other over Ethernet as a private network, and you are not connecting to the Internet or another network, you do not need a router. A switch IR hub is all you need.

However, you will either have to assign static IP addresses to each node on the network, or you will need to set up a DHCP server on one and only one node on the network. The Linux running on the Yun is actually based on router firmware, so it can act as a router and DHCP server.

But the simplest setup with a limited number of nodes is static addressing: it is easily manageable with a small number of nodes, and it makes the programming easy: no need for name lookup or translation, just connect directly to the desired IP address.

Thanks Jesse and ShapeShifter.

@both of them

I now understood what's going on. But when I am trying to assign static ip address it always by default searching for Dhcp server setting and goes into infinite loop.

If possible can you give a toy program for 2 devices which i can run and see if this thing works.
Toy program can be just setting up static ip address and sending a number. Other arduino will detect incoming byte and display the number.

Do we need to disable Dhcp or something ? If yes then how ?

Please help at your earliest.

@jesse I tried out those recipes but it didn't worked out for me. Where do I need to exactly run that recipe code ?
Or else can you please provide a toy code as mentioned in above text ?

Thank you.

swaroop2011:
::::SNIP::::

  1. If possible can you give a toy program for 2 devices which i can run and see if this thing works.
    Toy program can be just setting up static ip address and sending a number. Other arduino will detect incoming byte and display the number.

  2. Do we need to disable Dhcp or something ? If yes then how ?

::::SNIP::::

@jesse I tried out those recipes but it didn’t worked out for me.
3) Where do I need to exactly run that recipe code ?
4) Or else can you please provide a toy code as mentioned in above text ?

Thank you.

On #1, we do not have “toy programs”. We have tools. :wink: There are many tools to see what is running.
On #2, maybe - but SonnyYu should answer that question as the link I provided is his.
On #3, again SonnyYu should help.
On #4, …

I think it would be good for you to go through some tutorials and some of the tools needed. Here is an explanation.

= [Q:] I cannot connect to My Arduino Yún. What do I do? =

First it’s good to know, when Arduino Yun cannot find the AP you have set it for (like your home wifi), it has a script that puts it back into default SSID and AP mode.

Next, you may have already watched this video, but it’s worth watching again. Pay extra attention to the part with the sketches.
Getting started with Arduino Yún - tutorial (6:53)

Then, read these short instructions. We (the volunteer support group) already know these steps by heart, so be familiar with the different reboot methods, and especially the 30+ second wifi reset. Also, not mentioned on that page, if you reset the Wifi/Linux part of the Yun, it will take from 2-8 minutes for the reboot. Lastly on this part, YOU MUST WAIT for the Linux portion to fully boot BEFORE YOU PRESS ANY of the REST buttons.
Resetting the processors (AR9331, WiFi, and 32U4)

‘’‘Then start over’’’, plug your Yun into the USB port, run this sketch, and hit the ‘‘Wifi Reset button’’ (for 5-10 seconds).

The YunSerialTerminal provides a simplified console access to the Linux part of the Yun. It works via the USB port (the one that powers the Yun - the microUSB). From there you’ll be able to run a few commands to give us a better idea of problems.

Also, be ready with this sketch YunWiFiStatus. This sketch will help us see the status of your home AP. The sketch prints the wifi status to the console every 5 seconds or so. This sketch might seem familiar as it was in that first video link (above).

Lastly, you should read this section on use the Linux CLI. You do not need to understand it right now, but it is good to read.

Let us know how it goes.
Post results from the YunSerialTerminal, if you are still having problems.
Please use markup when posting results. (See image below

Jesse

arduino_markup.png

Thanks for such a informative post.
Will go through all these and will the post the progress or problems if any.
Thanks again.

Finally after all the help from you guys in this post and other posts which I posted.
Now I am able to communicate among the Due's and Yun's connected to each other via Ethernet switch.
There are some few things where I am having issues and as you can find i have posted them as new posts.
But the problem of this post is solved and they all are communicating and talking to each other.

Thanks to all once again. :slight_smile:

swaroop2011:
Thank you sonnyyu, mart and Jesse for your valuable inputs.

@Jesse

I don’t want my arduino system to connect to internet.
Is it necessary to connect to internet for exchanging information ?

Absolutely! NOT!

Basically I have 4 arduino’s as I mentioned in the first post, So is there another way where I can exchange information between different arduinos without using internet ?

Can’t we assign the IP address manually to each arduino while coding it ?

Yes, you can but you need to make sure that each one has a unique IP address, but all within the same subnet. That’s all just basic IP networking 101…

Ralf