Having problems transmitting and receiving data from Arduino Uno to the WIZ811MJ using the Ethernet lib. Socket connection protocol seems fine (listening, connecting, etc.), ping is fine, but when I transmit data using TCP I get a ton of garbage sent to the client before my data is sent. Receiving data is worse. I ONLY get garbage received, even when I don’t send anything from the client.
Here’s my setup:
J1-1 (MOSI) to D11
J1-2 (MISO) to D12
J2-1 (3.3) to 3.3v
J2-3 (SCLK) to D13
J2-4 (/SCS) to D10
J2-9 (GND) to Ground
J2-2 (/RESET) to Reset
And this example spews garbage galore once I telnet to my Arduino at port 80.
#include <SPI.h>
#include <stdint.h>
#include <Udp.h>
#include <Ethernet.h>
#include <Client.h>
#include <Server.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 27 };
byte gateway[] = { 192, 168, 1, 1 };
byte subnet[] = { 255, 255, 255, 0 };
Server server(80);
void setup() {
Serial.begin(9600);
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();
}
void loop() {
int pos = 0;
Client client = server.available();
if (client) {
while(client.connected()) {
if (client.available()) {
int in = client.read();
Serial.write(in);
}
}
delay(1);
client.stop();
}
}