Forum Members section DIY Ferduino controller Problem with ethernet module W5100

Problem with ethernet module W5100  [SOLVED]

Ask here about your controller made with pieces purchased in other shops.

Post Number:#1 Post Thu Aug 06, 2015 2:25 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
Hi,


I uploaded a code ferduino and tested ping but in screen "Please insert a sd card", i have a tft display with sd card and i make a bridge of R16 to pin4, after i uploaded a code test W5100 "Ethernet module with W5100" from viewtopic.php?f=8&t=42 and tested ping and have return.

with the test code works, but with the code ferduino appear "Please insert a sd card", can anyone give a hint?

In topic ethernet shield and module, the pins are
MODULE ARDUINO
SO 50
SI 51
SCK 52
CS 53
VCC 3.3V
GND GND

But in w5100 module the pins are name a little diferent and i conected the pins
MODULE ARDUINO
MISO 50
MOSI 51
CK 52
SS 53
VCC 5V
GND GND

is correct?

If i pin off a 5V the ferduino open normal.

In back of ethernet module w5100 all pins are, V5, GND, NSS, RST, MO, SCK, MI, POE- and POE+.
My module is http://pt.aliexpress.com/item/TOP-Mini- ... 46986.html

man did a search found nothing, sorry if I let it go.

Thx

Post Number:#2 Post Thu Aug 06, 2015 3:07 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Have you removed the side of the resistor that goes to pin 53?

Are you using this values?

const byte ChipSelect_SD = 4;
const byte SelectSlave_ETH = 53;


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Thu Aug 06, 2015 3:54 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
Hi!

Have you removed the side of the resistor that goes to pin 53?

Are you using this values?

const byte ChipSelect_SD = 4;
const byte SelectSlave_ETH = 53;


Best regards.



Hi again Fernando,

Yes i removed the side of the resistor that goes to pin 53.

and my code is same:
//*****************************************************************************************
//************************** Dispositivos SPI *********************************************
//*****************************************************************************************
const byte SD_CARD = 0;
const byte ETHER_CARD = 1;
const byte RFM = 2;
const byte ChipSelect_SD = 4; // Comente esta linha para usar o Ferduino Mega 2560
//const byte ChipSelect_SD = 5;  // Descomente esta linha para usar o Ferduino Mega 2560           
const byte SelectSlave_ETH = 53;
const byte ChipSelect_RFM = 69; // A15

Post Number:#4 Post Thu Aug 06, 2015 5:12 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Test the SD card with an example.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Thu Aug 06, 2015 5:42 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
Test the SD card with an example.


Hi Fernando,

Upload the code SD TESTE
 #include <SdFat.h>

//const byte SelectSlave_SD = 4; // For ethernet shield
const byte SelectSlave_SD = 5;   // For Ferduino Mega 2560
const byte SelectSlave_RFM = 69;   // For Ferduino Mega 2560
const byte SelectSlave_ETH = 53;   // For Ferduino Mega 2560

Sd2Card card;
SdFile file;
SdFile root;
SdVolume volume;

float temp;
float tempe;

void setup()
{
   int16_t n;
   char buf[8];

   pinMode(SelectSlave_RFM, OUTPUT);
   pinMode(SelectSlave_ETH, OUTPUT);
   digitalWrite(SelectSlave_RFM, HIGH);
   digitalWrite(SelectSlave_ETH, HIGH);
   
   Serial.begin(9600);

   card.init(SPI_QUARTER_SPEED, SelectSlave_SD);
   volume.init(&card);
   root.openRoot(&volume);

   while(!Serial)
   {
      ; // wait for serial.
   }

   if(file.open(&root, "LOGTDIA.TXT", O_CREAT | O_APPEND | O_WRITE))
   {
      Serial.println("Writing...");
      Serial.println();

      for(temp = 27.5; temp > 22.0; temp -= 0.15)
      {
         file.print(temp);
         file.write((uint8_t*)"\0", 1);
         file.write((uint8_t*)"\r\n", 2);
      }

      for(tempe = 22.5; tempe < 28.0; tempe += 0.15)
      {
         file.print(tempe);
         file.write((uint8_t*)"\0", 1);
         file.write((uint8_t*)"\r\n", 2);
      }
      file.close();
      Serial.println("Done!");
      Serial.println();
   }
   else
   {
      Serial.println("Can't open.");
   }

   if(file.open(&root, "LOGTDIA.TXT", O_READ))
   {
      Serial.println("Reading...");
      Serial.println();
      delay(5000);
      while ((n = file.read(buf, sizeof(buf))) > 0)
      {
         Serial.println(buf);
      }
      file.close();
      Serial.println();
      Serial.print("Finished!");
   }
}
void loop()
{
}

its works only i pin off a 5v from ethernet module, if turn on a pin 5v from module dont writing.
My sd only works if i change from SPI_HALF_SPEED to SPI_QUARTER_SPEED, and tested with const byte SelectSlave_SD = 5; and const byte SelectSlave_SD = 4; and both works too.

The PINs of the wiring diagram I did this right?
MODULE | ARDUINO
MISO | 50
MOSI | 51
CK | 52
SS | 53
VCC | 5V
GND | GND


Thx

Post Number:#6 Post Thu Aug 06, 2015 6:40 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

The pinout is ok.

You can't use this value, the comment is very CLEAR.

const byte SelectSlave_SD = 5;   // For Ferduino Mega 2560


Are you using 2 power supplies? 1 to W5100 and another to Arduino?

Have you connected the GND of this power supplies?
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Thu Aug 06, 2015 6:54 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
The pinout is ok.

You can't use this value, the comment is very CLEAR.

const byte SelectSlave_SD = 5;   // For Ferduino Mega 2560


Are you using 2 power supplies? 1 to W5100 and another to Arduino?

Have you connected the GND of this power supplies?


Ok, thx.

all test using a power on USB plug, and Vout 5v or 3v and GND from arduino to module.
This module works on 3v and 5v and tested with both.

Post Number:#8 Post Thu Aug 06, 2015 7:13 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Are you using a SD card of 1 or 2 GB?
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#9 Post Fri Aug 07, 2015 8:05 am
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
Are you using a SD card of 1 or 2 GB?


Hi, using a 1GB scandisk SD.

follow screens of module and bridge:

Shiel with bridge:
Image

Module:
Image
Image

Post Number:#10 Post Fri Aug 07, 2015 1:27 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Look for this:

Image


Apparently you have a short circuit between pin 4 and 53.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#11 Post Fri Aug 07, 2015 2:12 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
I verified now, and dont have a short circuit but however climbed over the resistor as you can see in the picture, but still not worked.

Image
Image

:((

Post Number:#12 Post Fri Aug 07, 2015 6:29 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
The bridge on p53 is in a resistor or In a hole after resistor ?

Post Number:#13 Post Fri Aug 07, 2015 7:10 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Connect the pin 53 only on W5100.
The bridge is between pin 4 and R16 only.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#14 Post Fri Aug 07, 2015 7:27 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
I do not understand, do a test with p53 in module and without the bridge?

Post Number:#15 Post Fri Aug 07, 2015 7:36 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

The bridge is the "chip select" for SD card no more.

Keep the bridge otherwise will have conflict between SD and W5100 because by default this two devices use the pin 53 to "chip select".

Make sure that haven't short circuit between pin 53 and R16.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#16 Post Mon Aug 10, 2015 1:24 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
The bridge is the "chip select" for SD card no more.

Keep the bridge otherwise will have conflict between SD and W5100 because by default this two devices use the pin 53 to "chip select".

Make sure that haven't short circuit between pin 53 and R16.



Hi Fernando,
I get a multimeter for find short circuit between pin 53 and R16 and no have.

Tested tested with only 5v, gnd and Pin53 and ferduino go up normal.
I was testing pin to pin...
and when I called the pin50 in MI connector module the ferduino not started and reappeared on the screen warning SD, if remove pin50 from module a ferduino go up normal.

The pin50 in connector MI in module cause this...

Any idea?

Post Number:#17 Post Mon Aug 10, 2015 2:13 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

The example "Simple webserver running on SD card" works for you?

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#18 Post Mon Aug 10, 2015 3:46 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
Hi!

The example "Simple webserver running on SD card" works for you?

Best regards.


Hi Fernando,

Tested a code:
#include <SPI.h>
#include <Ethernet.h>
#include <SdFat.h>

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 0, 177); // IP address, may need to change depending on network
EthernetServer server(80);

const byte SelectSlave_ETH = 53;
//const byte SelectSlave_SD = 4; // For ethernet shield
const byte SelectSlave_SD = 5;   // For Ferduino Mega 2560
const byte SelectSlave_RFM = 69;   // For Ferduino Mega 2560

Sd2Card card;
SdFile file;
SdFile root;
SdVolume volume;

void setup()
{
   pinMode(SelectSlave_RFM, OUTPUT);
   digitalWrite(SelectSlave_RFM, HIGH);
   
   Serial.begin(9600);
   while (!Serial)
   {
      ; // wait for serial port to connect. Needed for Leonardo only
   }
   Ethernet.begin(mac, ip, SelectSlave_ETH);
   server.begin();
   Serial.print("server is at ");
   Serial.println(Ethernet.localIP());

   Serial.println("Initializing SD card...");

   if (!card.init(SPI_QUARTER_SPEED, SelectSlave_SD))
   {
      Serial.println("ERROR - SD card initialization failed!");
      return;
   }
   volume.init(&card);
   root.openRoot(&volume);

   Serial.println("SUCCESS - SD card initialized.");

   if (!file.open(&root, "index.htm", O_READ))
   {
      Serial.println("ERROR - Can't open index.htm file!");
      return;
   }
   file.close();
   Serial.println("SUCCESS - Found index.htm file.");
}

void loop()
{
   EthernetClient client = server.available();

   if (client)
   {
      boolean currentLineIsBlank = true;
      while (client.connected())
      {
         if (client.available())
         {
            char c = client.read();

            if (c == '\n' && currentLineIsBlank)
            {
               client.println("HTTP/1.1 200 OK");
               client.println("Content-Type: text/html");
               client.println("Connection: close");
               client.println();

               if (file.open(&root, "index.htm", O_READ))
               {
                  while(file.available())
                  {
                     client.write(file.read());
                  }
                  file.close();
               }
               break;
            }
            if (c == '\n')
            {
               currentLineIsBlank = true;
            }
            else if (c != '\r')
            {
               currentLineIsBlank = false;
            }
         }
      }
      delay(1);
      client.stop();
   }
}


And save in SD card index.htm this code
// Save this file on SD card as index.htm
<!DOCTYPE html>
<html>
    <head>
        <title>Arduino SD Card Web Page</title>
    </head>
    <body>
        <h1>Hello world! </h1>   
      <h2>This page is stored in a SD card plugged on Arduino</h2>
        <p><strong>Visit my website: </strong><a href="http://www.ferduino.com" target="_blank">www.ferduino.com</a> </p>
      <p>Code adapted by Fernando Garcia</p>
    </body>
</html>



Serial monitor

server is at 192.168.0.177
Initializing SD card...
SUCCESS - SD card initialized.
SUCCESS - Found index.htm file.


Have too success in ping, but dont can access by browser.

Post Number:#19 Post Mon Aug 10, 2015 4:20 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

The ping test isn't important.

You need make it work with browser using some example.

What's the IP of your router?
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#20 Post Mon Aug 10, 2015 4:21 pm
Posts: 45
Topics: 9
Solve rating: 0
Joined: Thu Apr 10, 2014 12:21 pm
Topics: 9
Age: 39
Gender: None specified
National Flag:
Brazil
The ping test isn't important.

You need make it work with browser using some example.

What's the IP of your router?



My ip is 192.168.0.187/24
My router is 192.168.0.46/24
Last edited by Marcos Junior on Mon Aug 10, 2015 4:43 pm, edited 1 time in total.

Next



Return to DIY Ferduino controller





Who is online

Users viewing this topic: No registered users and 0 guests