Forum Software Ferduino code Ethernet Shield and SD Card

Ethernet Shield and SD Card  [SOLVED]


Post Number:#1 Post Fri Jun 16, 2017 8:25 am
Posts: 65
Topics: 18
Images: 32
Solve rating: 0
Joined: Fri Jun 16, 2017 6:23 am
Topics: 18
Age: 61
Gender: None specified
National Flag:
Spain
Hello,

I am not able to configure the ethernet shield with the SD card. I tried to find a response in the forum but I have not found it and so I ask for help. Summary of the tests I have done:

Image

1 / Test read write SD card using Arduino example "ReadWriteSdfat"

Result:
Correct, read and write without problems.


2 / Proof of IP address assignment by DHCP using the Arduino example "DhcpAddressPrinter"

2.1 Without SD card
Result:
Right, assign IP address of my address range


2.2 With SD card
Result:
"Failed to configure using DHCP"


3 / Test example of Arduino "WebClient"

3.1 Without SD card
Result:
"Connecting ...
Connected
HTTP / 1.1 302 Found
Location: http://www.google.com/search?q=arduino&gws_rd=cr&ei=_pZDWfyECsnSwAKK3JvwBA
Cache-Control: private
Content-Type: text / html; Charset = UTF-8
P3P: CP = "This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Date: Fri, 16 Jun 2017 08:29:50 GMT
Server: gws
Content-Length: 278
X-XSS-Protection: 1; Mode = block
X-Frame-Options: SAMEORIGIN
Set-Cookie: NID = 105 = vzLbA5TMDvu9l0gp61wcut12OhH7UuLFls8pRcBBSfd0LWGZDayQFEn0hWyqyg4Hps6gQBOWK1p7h7KfxdtQ4KeziFiu9HB9vH4tDV9uqDGcLR9XAMUCdl90YSsvIzuu; Expires = Sat, 16-Dec-2017 08:29:50 GMT; Path = /; Domain = .google.com; HttpOnly
Connection: close

<HTML> <HEAD> <meta http-equiv = "content-type" content = "text / html; charset = utf-8">
<TITLE> 302 Moved </ TITLE> </ HEAD> <BODY>
<H1> 302 Moved </ H1>
The document has moved
<A HREF="http://www.google.com/search?q=arduino&amp;gws_rd=cr&amp;ei=_pZDWfyECsnSwAKK3JvwBA"> here </A>.
</ BODY> </ HTML>

Disconnecting. "

3.2 With SD card
Result:
"Failed to configure Ethernet using DHCP
Connecting
Connection failed

Disconnecting. "


4 / Test using "Ethernet_shield_with_W5100 by FernandoGarcia

3.1 Without SD card
Result:
Only the serial monitor shows the following line
"Server is at 192.168.1.69"


3.2 With SD card
Result:
Only the serial monitor shows the following line
"Server is at 192.168.1.69"


5 / Try using "Simple_webserver_running_on_SD_card by FernandoGarcia"

The index.htm file I have created hand on the SD card
Sketch Configuration:

Byte mac [] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip (192, 168, 1, 69); // 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


5.1 first run with SD card
"Server is at 192.168.1.69
Initializing SD Card ...
SUCCESS - SD Card Initialized
SUCCESS - Found Index.htm. "


5.2 second run with SD card
"Server is at 223.171.223.255
Initializing SD Card ...
SUCCESS - SD Card Initialized
SUCCESS - Found Index.htm. "
5.3 Without SD card
Server is at 192.168.1.69
Initializing SD Card ...
ERROR - SD Card Initialization failed "
Last edited by Fernando Garcia on Fri Jun 16, 2017 8:36 am, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code.

Post Number:#2 Post Fri Jun 16, 2017 8:47 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Welcome Jose!

Your SD card and ethernet shield is working.

The problem with "DhcpAddressPrinter" is related with conflict between SD card and W5100.

The sketch haven't any command to disable the communication with SD card while W5100 is working.

Find:

Serial.begin(9600);


Add after:

pinMode(4, OUTPUT);
digitalWrite(4, HIGH);


It should work.

Regarding others tests, only type this IP (192.168.1.69) on browser to see the result.

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 Fri Jun 16, 2017 1:19 pm
Posts: 65
Topics: 18
Images: 32
Solve rating: 0
Joined: Fri Jun 16, 2017 6:23 am
Topics: 18
Age: 61
Gender: None specified
National Flag:
Spain
Thank you very much for the help, I have the doubt to execute

Simple_webserver_running_on_SD_card

The first time I run the serial monitor response is

"Server is at 192.168.1.69
Initializing SD card ...
SUCCESS - SD card initialized.
SUCCESS - Found index.htm file. "


And in the browser to go to 192.168.1.69 appears 1 2 3 4 5 6 which is the contents of the Index.htm file

From the second time I run it modifies the ip address and generates one out of range

"Server is at 255.255.223.255
Initializing SD card ...
SUCCESS - SD card initialized.
SUCCESS - Found index.htm file. "


If I add to the sketch

   "PinMode (SelectSlave_SD, OUTPUT);
    DigitalWrite (SelectSlave_SD, HIGH); "


The IP address 192.168.1.69 is maintained and the results of the execution are the same as the first time.

I do not know if this is the expected behavior.

Sorry for my poor knowledge
Last edited by Fernando Garcia on Fri Jun 16, 2017 8:07 pm, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code.

Post Number:#4 Post Fri Jun 16, 2017 8:13 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Dear, I didn't told to add anything to this sketch.

Sometimes is needed press the reset for a while to get right IP.

Try Ferduino code and tell me the result.
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 Sat Jun 17, 2017 2:06 pm
Posts: 65
Topics: 18
Images: 32
Solve rating: 0
Joined: Fri Jun 16, 2017 6:23 am
Topics: 18
Age: 61
Gender: None specified
National Flag:
Spain
Yes, I have tried with the ferduino code and everything works perfectly, thank you very much for the patience and dedication you give to those who like me have very few, to say no knowledge in the matter.

Post Number:#6 Post Sat Jun 17, 2017 4:22 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Glad to hear!

Please don't delete images it can be useful to others users.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron