Seeeduino Cloud and Grove IoT Starter Kit network issue

Any problem about ARDX kit, Grove - Starter Kit (Plus),etc, you can post here.

Seeeduino Cloud and Grove IoT Starter Kit network issue

by john_gao » Sat Apr 09, 2016 2:01 pm

Dear sir,
How can I use this start kit access Ethernet network.
I plug this board in my network, it get dhcp 10.0.0.35
Then I try to lunch any network examples ,
I try to program IP and mac address fellow internet fail.
Try to use IP and mac address as eth0 failed
all failed.
Is this kits stop the Arduino Sketch network access?
Could you help to provide any example how to access the current ethernet in sketch is very helpful?
I try to use blynk but the dhcp example fail in connections, then I swap to arduino ethernet examples, all failed.

eth0 Link encap:Ethernet HWaddr A8:40:41:14:5A:E3
inet addr:10.0.0.35 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23130 errors:0 dropped:14620 overruns:0 frame:0
TX packets:3250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2208474 (2.1 MiB) TX bytes:236002 (230.4 KiB)
Interrupt:5

eth0:9 Link encap:Ethernet HWaddr A8:40:41:14:5A:E3
inet addr:172.31.255.254 Bcast:172.31.255.255 Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:5

eth1 Link encap:Ethernet HWaddr A8:40:41:14:5A:E2
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:65536 Metric:1
RX packets:174 errors:0 dropped:0 overruns:0 frame:0
TX packets:174 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11255 (10.9 KiB) TX bytes:11255 (10.9 KiB)

wlan0 Link encap:Ethernet HWaddr A8:40:41:14:5A:E0
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:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:0 (0.0 B) TX bytes:4212 (4.1 KiB)
In the above ether interface which I can use Ethernet module to talk outside?
If you can provide some example is very appreciate
This is my example:
/*
Telnet client

This sketch connects to a a telnet server (http://www.google.com)
using an Arduino Wiznet Ethernet shield. You'll need a telnet server
to test this with.
Processing's ChatServer example (part of the network library) works well,
running on port 10002. It can be found as part of the examples
in the Processing application, available at
http://processing.org/

Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13

created 14 Sep 2010
modified 9 Apr 2012
by Tom Igoe

*/

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { // what we should put here
0xA8,0x40,0x41,0x14,0x5A,0xE3
};
IPAddress ip(10, 0, 0, 35); // what we should put here, or the sketch network is total cannot work in this start kit??

// Enter the IP address of the server you're connecting to:
IPAddress server(10,0,0,13);

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 23 is default for telnet;
// if you're using Processing's ChatServer, use port 10002):
EthernetClient client;

void setup() {
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// Open serial communications and wait for port to open:

Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}


// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");

// if you get a connection, report back via serial:
if (client.connect(server, 23)) { // I had installed telnet server on 10.0.0.13.
Serial.println("connected");
} else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}

void loop() {
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}

// as long as there are bytes in the serial queue,
// read them and send them out the socket if it's open:
while (Serial.available() > 0) {
char inChar = Serial.read();
if (client.connected()) {
client.print(inChar);
}
}

// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
// do nothing:
while (true);
}
}

Thanks
John
Pre-kindergarten
Pre-kindergarten
 
Posts: 5
Joined: Sun Apr 03, 2016 11:27 am

Who is online
Users browsing this forum: No registered users and 1 guest