I´m trying to do a project with two arduinos connected by ethernet, but the information about it is praticly 0.
Can anybody help me? Is it possible to connect by ethernet two arduinos? for example one arduino has a motion sensor and at the other end the other arduino has a LED, and when the motion sensor is triggered the LED turns on.
Well something like that... the only examples are by android or webpage but i was kind of trying to do it more direct... is it possible?
IPAddress server(192,168,1,1); // adresse IP de la YUN1
if(client.connect(server,5555)){ // si on est connecté au serveur
Serial.println("connected");
}
client.stop();
delay(500);
}
[ 77.020000] eth1: link down
[ 79.020000] eth1: link up (100Mbps/Full duplex)
[ 119.020000] eth1: link down
[ 120.020000] eth1: link up (100Mbps/Full duplex)
You posted the output of the boot process. To post the ifconfig output wait until the Yun finishes booting and then write in the serial monitor ifconfig and press enter.
i think i made it because know i can see in both of them if they are connected...
But its always transmitting that it is connected.... if i had a motion sensor on the client and i wanted to send the information to the server every time the sensor detect something and then on the YUN server it would turn of an LED how could i put the function on the code?
right know i´ve got something like this:
SERVER #include <Bridge.h> #include <YunServer.h> #include <YunClient.h>
With the client:
after it connects to the server you can use client.write() to write data to the server.
With the server:
After it accepts the client and checks the connection, it can read data from client with client.read() or client.readString().
Here you can find an example for the server, the last step contains an example code. http://scuola.arduino.cc/lesson/zzdeJ3m/YunServer_Sensor_values_to_HTML_page
Bridge\Bridge.cpp.o: In function BridgeClass::crcCheck(unsigned int)': C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:50: multiple definition of crc16_update(unsigned int, unsigned char)'
VirtualWire\VirtualWire.cpp.o:C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:50: first defined here
Bridge\Bridge.cpp.o: In function String::operator+=(char const*)': C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:66: multiple definition of crc_xmodem_update(unsigned int, unsigned char)'
VirtualWire\VirtualWire.cpp.o:C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:66: first defined here
Bridge\Bridge.cpp.o: In function BridgeClass::transfer(unsigned char const*, unsigned int, unsigned char const*, unsigned int, unsigned char*, unsigned int)': C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:79: multiple definition of _crc_ccitt_update(unsigned int, unsigned char)'
VirtualWire\VirtualWire.cpp.o:C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:79: first defined here
Bridge\Bridge.cpp.o: In function BridgeClass::begin()': C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:90: multiple definition of _crc_ibutton_update(unsigned char, unsigned char)'
VirtualWire\VirtualWire.cpp.o:C:\Program Files (x86)\Arduino\libraries\VirtualWire/util/crc16.h:90: first defined here
collect2: error: ld returned 1 exit status