Hi all!
I am trying to use Arduino Uno R3 with datalogger shield DLS 3.1 and Arduinos official WiFi shield R3 both attached on arduino at the same time. The code works well when I use shields attached on arduino one at a time, but when I attach them both then my WiFi.status() function returns WL_NO_SHIELD. I couldn't find any proper definition for WiFi.status() funciton anywhere.
According to their datasheets, shields shouldn't use any same pins except the SPI bus pins (digital 11 12 and 13) so that shouldn't be a problem (?). As a power source I have tried to use USB cable connected to my computer and when it didn't work I tried 9V battery, but it didn't work either.
Does anyone has any thoughts what might be the cause for my problem?
Sharing SPI pins should be fine, that is what the SPI bus is about. What you need to be careful about are the select pins but you are probably already up to that.
You are probably right to suspect the power and you may have always been a bit close to the wind with the USB cable, but a 9v battery is not a solution to a power problem, indeed it is a recipe for disaster, as it has no power at all. Using 6xAA might prove the point, but you will be better off with a 9v wall wart.
Thanks for your quick answer Nick!
I think SS pins should be fine. DLS 3.1 uses pin 8 for SD chip select and WiFi shield uses pin 10 to select HDG204 and pin 4 for SD card.
I guess next I have to try another power source.
What do you think, is it too much if I use 12V/1.5A adapter?
Ok. So now I have tried to power my system with 9V/1000mA adapter, but it still doesn't recognize the wifi shield. I have even tried as simple code as this:
#include <SPI.h>
#include <WiFi.h>
void setup() {
Serial.begin(9600);
if(WiFi.status() == WL_NO_SHIELD) {
Serial.println(F("WiFi shield not present"));
// don't continue:
while(true);
}
}
void loop() {
Serial.println("Hi sir");
delay(5000);
}
Always the same result: "Wifi shield not present". I am running out of ideas..
Please post a link to the data logger shield. It is probably the lack of ICSP pin connection that causes the fail if you have the data logger shield between the Uno and the WiFi shield.
.
and the 9v adapter is still a good idea........
Did you update the firmware on the Wi-Fi shield? You have to do that before it will work. I spend a week trying to figure out how to do that, ended up paying someone $40 to do it for me.
I'm curious, why do you need a data logger shield, and the Wi-Fi shield? The wi-fi shield comes with a sd port that works perfectly fine. The only reason I see that one would want another shield is if you wanted to create a back up, so after it records on both, it compares the two, that way if one becomes corrupt, or gets an absurd number (it happens from time to time) then it can correct itself. - But that would still be fairly advanced, I would recommend getting one to work before attempting that.
SurferTim:
Please post a link to the data logger shield. It is probably the lack of ICSP pin connection that causes the fail if you have the data logger shield between the Uno and the WiFi shield.
.
Here is the link to the data logger
I actually use wifi shield between the arduino and the data logger so it shouldn't cause the problem.
Only pin both shields are using is digital pin 7. I have solved this by manually changing the pin 7 to A0 pin on data logger circuit by using jump wire. Then I define A0 pin as a digital output in my code.
Thomas499:
Did you update the firmware on the Wi-Fi shield? You have to do that before it will work. I spend a week trying to figure out how to do that, ended up paying someone $40 to do it for me.
Yes I did that. I also struggled with that problem a while but now my wifi shield works smoothly when I use it alone with arduino. The problem occurs when I attach the data logger on top of them.
Thomas499:
I'm curious, why do you need a data logger shield, and the Wi-Fi shield? The wi-fi shield comes with a sd port that works perfectly fine. The only reason I see that one would want another shield is if you wanted to create a back up, so after it records on both, it compares the two, that way if one becomes corrupt, or gets an absurd number (it happens from time to time) then it can correct itself. - But that would still be fairly advanced, I would recommend getting one to work before attempting that.
I use this data logger shield to put my system to sleep between the measurements. Eventyally I plan to use batteries (maybe 6xAA as Nick suggested in his first reply) instead of 9V adapter and with my data logger I can increase battery life.
I use this data logger shield to put my system to sleep between the measurements. Eventyally I plan to use batteries (maybe 6xAA as Nick suggested in his first reply) instead of 9V adapter and with my data logger I can increase battery life.
You have my attention my. Can you tell me more about this theory? I don't know anything about data loggers, I thought it was simply a sd card shield, in which case the arduino would need to power the sd card. Your response seems to indicate maybe it has a 555 timer, or something similar though. Wouldn't the arduino still need to power it?
Are you wanting to do that so you don't have to power the wi-fi shield full time? How are you planning on turning the wi-fi shield off without turning off the arduino?
Thomas499:
You have my attention my. Can you tell me more about this theory? I don't know anything about data loggers, I thought it was simply a sd card shield, in which case the arduino would need to power the sd card. Your response seems to indicate maybe it has a 555 timer, or something similar though. Wouldn't the arduino still need to power it?
Are you wanting to do that so you don't have to power the wi-fi shield full time? How are you planning on turning the wi-fi shield off without turning off the arduino?
Yes, the data logger has its own RTC but it runs with separate CR1220 3V battery so there is no need for arduino to be running all the time. The main power source is also plugged in the data logger shield. It has its own 2.1mm plug just like the arduino board. Then you set data logger to cut off power to arduino in your code and only awaken it to take measurements and log them (and also in my program to send the data to internet). See the link to data logger shield that I'm using above.
Hi again!
I have now run some tests and found out that the problem seems to be the SD-card attached to data logger (or pins connected to it). Somehow when I remove the SD-card from the SD-card slot, the program recognizes WiFi-shield again when WiFi.status() function is called. And everything works perfectly except writing to SD-card of course. Does anybody know how I could fix this?
Somehow when I remove the SD-card from the SD-card slot, the program recognizes WiFi-shield again when WiFi.status() function is called.
You need to diagnose the undesired symptoms more clearly. Are you saying that you don't want the program to recognize the WiFi-shield when WiFi.status() function is called?
And everything works perfectly except writing to SD-card of course.
I'm going to assume that when I remove the SD-card from the SD-card slot isn't the problem. If it is, you are an idiot. But assuming it isn't, then are you saying that when the sd card is in the sd card slot, the arduino writes everything to the sd card like it is suppose to, but doesn't recognize the WiFi-shield? But if you remove the sd card, it recognizes the WiFi-shield?
Or are you saying in neither case it writes to the SD card?