Go Down

Topic: blank serial monitor using ethernet shield (Read 1 time) previous topic - next topic

patrixx

help me please,,
my ethernet shield suddenly not working anymore, it doesnt show anything when i open serial monitor. i have tried many codes(even the code that work before), changing rj45 cable, factory reset my router. but it still not working. The led power, speed and link on my ethernet shield are turned on. should i buy the new one? or is there any way to fix it?

weedpharma

Have you confirmed the Arduino works on its own to the serial?

Weedpharma

patrixx

Yes it's work,  I have tried many code that doesn't use ethernet, and they work..

weedpharma

Tell us in detail what you are doing and post your code in code tags using </> icon at top of editor.

Weedpharma

patrixx

i havent made mine,, but im trying to make something like from this page . this is the arduino code,
Code: [Select]
#include <UIPEthernet.h> // Used for Ethernet

// **** ETHERNET SETTING ****
// Arduino Uno pins: 10 = CS, 11 = MOSI, 12 = MISO, 13 = SCK
// Ethernet MAC address - must be unique on your network - MAC Reads T4A001 in hex (unique in your network)
byte mac[] = { 0x54, 0x34, 0x41, 0x30, 0x30, 0x31 };                                     
// For the rest we use DHCP (IP address and such)

EthernetClient client;
char server[] = "192.168.1.100"; // IP Adres (or name) of server to dump data to
int  interval = 5000; // Wait between dumps

void setup() {

  Serial.begin(9600);
  Ethernet.begin(mac);

  Serial.println("Tweaking4All.com - Temperature Drone - v2.0");
  Serial.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
  Serial.print("IP Address        : ");
  Serial.println(Ethernet.localIP());
  Serial.print("Subnet Mask       : ");
  Serial.println(Ethernet.subnetMask());
  Serial.print("Default Gateway IP: ");
  Serial.println(Ethernet.gatewayIP());
  Serial.print("DNS Server IP     : ");
  Serial.println(Ethernet.dnsServerIP());
}

void loop() {
  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("-> Connected");
    // Make a HTTP request:
    client.print( "GET /testserver/arduino_temperatures/add_data.php?");
    client.print("serial=");
    client.print( "288884820500006X" );
    client.print("&&");
    client.print("temperature=");
    client.print( "12.3" );
    client.println( " HTTP/1.1");
    client.print( "Host: " );
    client.println(server)
    client.println( "Connection: close" );
    client.println();
    client.println();
    client.stop();
  }
  else {
    // you didn't get a connection to the server:
    Serial.println("--> connection failed/n");
  }

  delay(interval);
}


when i run the code it doesnt work and the serial monitor doesnt show anything.. i tried some codes that work before, but they dont..

pert

If you upload File > Examples > 01.Basics > Blink with the Ethernet shield attached does the LED blink on for a second and then off for a second? This would show if the problem is only with Serial or if the program isn't working at all. If Blink works then try this with the Ethernet shield attached:
Code: [Select]
void setup() {
  Serial.begin(9600);
  Serial.println("hello");
}

void loop() {
}

And let us know what your results are.

patrixx

#6
Jan 02, 2016, 02:52 pm Last Edit: Jan 02, 2016, 02:58 pm by patrixx
blink example work, "hello" code work too..

Go Up