Connecting via Ethernet

hi,
I'm trying to use the ethernet on yun with the following example:

I'd changed the Mac address and the ip address to my Mac and ip address, and I get "connection failed" message.
The yun is connected to the ethernet.

Any suggestions please?

How do you know you are connected to the Internet?
Can you ping from the advanced (luci) interface (Network > Diagnostics)?
Do you have a DNS entry (if you are not DHCP)?

When i opened the IDE and then select the port from the tool bar, it shows me the ip of the ethernet. (I checked that the ip of the ethernet, from the router site is the same ip that the IDE port selection shows).

Is it enough? Or i need to check something else?
Is there a specific way to check that the ethernet is connected?

Thanks,

On your terminal window, type: ifconfig

You should get something like this:

ifconfig
eth1      Link encap:Ethernet  HWaddr 90:A2:DA:F8:0A:22  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:96 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:6528 (6.3 KiB)  TX bytes:6528 (6.3 KiB)

wlan0     Link encap:Ethernet  HWaddr 90:A2:DA:F8:0A:22  
          inet addr:192.168.240.1  Bcast:192.168.240.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:3263 (3.1 KiB)

Do the same on your Mac. Please post the results of both.

Thanks
Jesse

djkevinz:
How do you know you are connected to the Internet?
Can you ping from the advanced (luci) interface (Network > Diagnostics)?
Do you have a DNS entry (if you are not DHCP)?

I'd connected the yun only by ethernet.
i did a ping through luci and it looks like everything is ok.

i use DHCP, do i have to cancel this option and use DNS? (if yes, can you help me with this? i'm using "Dual Band | Wireless N600 NETGEAR" router)
in the router interface i got this information:

(same info that i have in the yun interface)

jessemonroy650:
On your terminal window, type: ifconfig

You should get something like this:

ifconfig

eth1      Link encap:Ethernet  HWaddr 90:A2:DA:F8:0A:22 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:96 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6528 (6.3 KiB)  TX bytes:6528 (6.3 KiB)

wlan0    Link encap:Ethernet  HWaddr 90:A2:DA:F8:0A:22 
          inet addr:192.168.240.1  Bcast:192.168.240.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:3263 (3.1 KiB)




Do the same on your Mac. Please post the results of both.

Thanks
Jesse

I'm using windows, so i did ipconfig/all and get:

in the serial monitor i get this message:

Failed to configure Ethernet using DHCP
connecting...
connection failed

disconnecting.

and it's stack at this point.
after "Failed to configure Ethernet using DHCP" i'm using:
Ethernet.begin(mac, ip);

vicmerlis:
I'm trying to use the ethernet on yun with the following example:
http://arduino.cc/en/Tutorial/WebClient

That is an example of how to connect using an Ethernet shield. The Yun is NOT an Arduino with a built in a Ethernet shield, it is a completely different animal. None of the a Ethernet shield code will ever work with the Yun, as you have discovered. (OK, it might work if you plugged in in Ethernet shield, but why would you? The built-in networking ability of the Yun is far superior.)

Look at the Bridge library that is specific to the Yun: http://arduino.cc/en/Reference/YunBridgeLibrary

Specifically, you're probably interested in HttpClient: http://arduino.cc/en/Tutorial/HttpClient

ShapeShifter:
That is an example of how to connect using an Ethernet shield. The Yun is NOT an Arduino with a built in a Ethernet shield, it is a completely different animal. None of the a Ethernet shield code will ever work with the Yun, as you have discovered. (OK, it might work if you plugged in in Ethernet shield, but why would you? The built-in networking ability of the Yun is far superior.)

Look at the Bridge library that is specific to the Yun: http://arduino.cc/en/Reference/YunBridgeLibrary

Specifically, you're probably interested in HttpClient: http://arduino.cc/en/Tutorial/HttpClient

That was my first thought, that the yun have a different way to use Ethernet, but from the link below i think that they are same. MAYBE I WRONG :

The HttpClient example not good for me. the first reason is because this example need "a wireless network connection to the internet" and the second reason is because i need to send and receive packets via Ethernet (and HttpClient do not support this needs)

vicmerlis:
That was my first thought, that the yun have a different way to use Ethernet, but from the link below i think that they are same. MAYBE I WRONG :
Libraries - Arduino Reference

What in that link makes you think that they are the same? All I see is the description for the Ethernet library, which specifically states that it is for an Ethernet Shield which is different hardware than what is on the Yun.

The HttpClient example not good for me. the first reason is because this example need "a wireless network connection to the internet" and the second reason is because i need to send and receive packets via Ethernet (and HttpClient do not support this needs)

Give it a try. The primary focus of the Yun is WiFi, but it also has an Ethernet port, and in reality there isn't any difference. While the documentation may specifically mention WiFi, I have yet to find anything that doesn't work over Ethernet also.

Unless you are looking at something that specifically deals with WiFi configuration (like setting up or connecting to an access point) it's a pretty safe bet that anywhere the documentation talks about a wireless connection, you can also do it with Ethernet.

For that particular example, a NETWORK connection (not necessarily wireless) to the Internet is required. But the Internet connection is only required because it is trying to access the remote server arduino.cc. HttpClient will also work just fine to access a server on your own local Ethernet network, in which case there is no need to actually be able to access the Internet.

The Yun is perfectly happy with it's WiFi interface disconnected and using Ethernet only. I do it often. There is one caveat, however: the default configuration of the Yun checks to see if it is connected to WiFi, and if it is unable to associate after a few minutes, it will reset. LOOK HERE for a comment on how to disable this by removing the call to wifi-live-or-reset. If you comment out that line as instructed, it doesn't matter whether the WiFi is connected or not, the Yun will not keep trying to reboot.

vicmerlis,
don't worrry about the library error. I've done similar. The documentation could be better for the Yún, but it's not worst I've ever seen. As a matter of fact, it quit good compare to most commercial organizations.

Also, you'll find for what is lacking in documentation, the forum and other users help make up.

Good Luck,
Jesse