Hi Paul and thank you for reply.
I forgot to add. To use the Wiz 550io I had to download wiznet Ethernet library.
Its kind of the same arduino library but adding the wiznet 5500 support.
you can find it here: https://github.com/Wiznet/WIZ_Ethernet_Library
I tried out modifying the read data class in the way you said: uint16_t instead of uint8_t but then it gives a lot of other errors compiling the code.
I instead changed this line:
Code:
src_mask = (uint16_t)src & RMASK;
to this
Code:
src_mask = (size_t)src & RMASK;
in each of the 5xxx cpp file.
By this way it should automatically size the pointer accordingly.
Using this trick it compiles and it works if I use an Ethernet module with wiznet 5100 on the teensy 3.1.
But if I use the wiz 550io it still doesn't work.
Thi Is the testing code I'm using:
Code:
/*
Web Server
A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)
created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
modified 12 Aug 2013
by Soohwan Kim
*/
#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:
#if defined(WIZ550io_WITH_MACADDRESS) // Use assigned MAC address of WIZ550io
;
#else
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
#endif
IPAddress ip(192,168,2,177);
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// start the Ethernet connection and the server:
#if defined(WIZ550io_WITH_MACADDRESS)
Ethernet.begin(ip);
#else
Ethernet.begin(mac, ip);
#endif
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}
void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
Serial.println("new client");
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
// if you've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close"); // the connection will be closed after completion of the response
client.println("Refresh: 5"); // refresh the page automatically every 5 sec
client.println();
client.println("<!DOCTYPE HTML>");
client.println("<html>");
// output the value of each analog input pin
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
int sensorReading = analogRead(analogChannel);
client.print("analog input ");
client.print(analogChannel);
client.print(" is ");
client.print(sensorReading);
client.println("<br />");
}
client.println("</html>");
break;
}
if (c == '\n') {
// you're starting a new line
currentLineIsBlank = true;
}
else if (c != '\r') {
// you've gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
Serial.println("client disonnected");
}
}
It works fine with a 5100 module; even with a 5200 module (I obviously go to change which module is defined everytime in utility/5100.cpp of the library)
But with the 550io module It basically doesn't get the iP.
Or almost it invents a random IP.
Let's say I declared: 192.168.2.177 as an IP.
If I open the serial monitor I see that it gets everytime a random Ip like: 0.188.2.0 or 188.255.0.0
The weird thing is that if I disconnect the Ethernet cable; instead of giving 0.0.0.0 as Ip; it still gives random IP.
I hooked up the module
Module Teensy 3.1
MOSI ----> Pin 11 Dout
MISO-----> Pin 12 Din
SCLK-----> PIn 13 Clock
SCSN-----> Pin 10 SS
and obviously the 3.3 volts and gnd.
I tried same with an arduino but it still gives a random IP.
Here is an image of my config as well