jakezimmer
Member
Hello everyone,
I have been having some trouble with the Ethernet Library and WIZ820io module with the Teensy LC and breakout board REV 1.
I am unable to manually set the IP address in the Ethernet constructor. No matter what, when Ethernet.localIP() is called, it returns 255.255.255.255. This happens on all example sketches.
The teensy appears to actually be using that IP though. When using the webserver example sketch, I can ping the teensy in terminal with "ping 255.255.255.255".
Additionally, the teensy will occasionally claim to be connected to my server even when it isn't. When running the below code, the teensy will sometimes exit the loop even if the cable is physically unplugged from the server.
while (!client.connected()) {
client.connect(server, 12345);
Serial.println("connecting");
delay(1000);
}
When first attempting to troubleshoot, the teensy would often just pick random IP addresses instead of the static, now though, it is stuck on 255.255.255.255.
I have run this with both arduino 1.6.7 and the new 1.6.8 with no difference and am using the latest teensyduino libraries.
While I cannot post all of my source code, here is some of the setup with the Teensy as a client:
Thank you in advance.
I have been having some trouble with the Ethernet Library and WIZ820io module with the Teensy LC and breakout board REV 1.
I am unable to manually set the IP address in the Ethernet constructor. No matter what, when Ethernet.localIP() is called, it returns 255.255.255.255. This happens on all example sketches.
The teensy appears to actually be using that IP though. When using the webserver example sketch, I can ping the teensy in terminal with "ping 255.255.255.255".
Additionally, the teensy will occasionally claim to be connected to my server even when it isn't. When running the below code, the teensy will sometimes exit the loop even if the cable is physically unplugged from the server.
while (!client.connected()) {
client.connect(server, 12345);
Serial.println("connecting");
delay(1000);
}
When first attempting to troubleshoot, the teensy would often just pick random IP addresses instead of the static, now though, it is stuck on 255.255.255.255.
I have run this with both arduino 1.6.7 and the new 1.6.8 with no difference and am using the latest teensyduino libraries.
While I cannot post all of my source code, here is some of the setup with the Teensy as a client:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
//IPAddress ip(71, 5, 228, 37);
IPAddress ip(169,254,24,252);
IPAddress badip(255,255,255,255);
IPAddress myDns(131, 215, 139, 100);
IPAddress gateway(131,215,193,254);
IPAddress subnet(255, 255, 255, 0);
unsigned int localPort = 12345;
IPAddress server(192,168,0,51);
// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
char replyBuffer[mainVD] = ""; // a string to send back
EthernetClient client;
/***************************************************
End of global variables
****************************************************/
void setup() {
// start the Ethernet:
// pinMode(9, OUTPUT);
// digitalWrite(9,HIGH);
// digitalWrite(9, LOW); // reset the WIZ820io
pinMode(4, OUTPUT);
digitalWrite(4, HIGH); // de-select the SD Card
Serial.println("5 seconds");
delay(5000);
Ethernet.begin(mac, ip,myDns, gateway, subnet); //just having Ethernet.begin(mac) has the same result
// print the Ethernet board/shield's IP address:
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP());
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// wait for connection
while (!client.connected()) {
client.connect(server, 12345);
Serial.println("connecting");
delay(1000);
}
Serial.println("connected");
//IPAddress ip(71, 5, 228, 37);
IPAddress ip(169,254,24,252);
IPAddress badip(255,255,255,255);
IPAddress myDns(131, 215, 139, 100);
IPAddress gateway(131,215,193,254);
IPAddress subnet(255, 255, 255, 0);
unsigned int localPort = 12345;
IPAddress server(192,168,0,51);
// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
char replyBuffer[mainVD] = ""; // a string to send back
EthernetClient client;
/***************************************************
End of global variables
****************************************************/
void setup() {
// start the Ethernet:
// pinMode(9, OUTPUT);
// digitalWrite(9,HIGH);
// digitalWrite(9, LOW); // reset the WIZ820io
pinMode(4, OUTPUT);
digitalWrite(4, HIGH); // de-select the SD Card
Serial.println("5 seconds");
delay(5000);
Ethernet.begin(mac, ip,myDns, gateway, subnet); //just having Ethernet.begin(mac) has the same result
// print the Ethernet board/shield's IP address:
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP());
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// wait for connection
while (!client.connected()) {
client.connect(server, 12345);
Serial.println("connecting");
delay(1000);
}
Serial.println("connected");
Thank you in advance.
Last edited: