Go Down

Topic: Mega with wiznet shield (wire hack)+thingspeak+sd problem (Read 15923 times) previous topic - next topic


From the release notes:
Support has been added for printing strings stored in flash (program
  memory) rather than RAM. Wrap double-quoted strings in F() to indicate
  that they should be stored in flash, e.g. Serial.print(F("hello world"))

But as you're using a Mega, it may be a moot point.


Nov 24, 2012, 04:10 pm Last Edit: Nov 24, 2012, 04:23 pm by vespapierre Reason: 1
Wildbill, thanks I will try that.


firts attempt is failed. Second, third, fourth is ok.

after power down and up again, it is failing for every attempt

edit: after rewriting with the F macros the sd open failed too


Nov 24, 2012, 04:24 pm Last Edit: Nov 24, 2012, 04:39 pm by SurferTim Reason: 1
This page has an example sketch for the Dallas temp sensor.
It does not include any header files except OneWire.h. Maybe that will help you get it set up. Compile and upload the example sketch and insure it works ok. If it does, then we'll rename that "loop" function to something else and add it to your sketch.

edit: Don't use the F() macro yet. Keep it as simple as possible. Add the fancy stuff later.
If it fails to start the SD, then something is not right. If you comment out the new include and declaration, does it work again? If so, you might want to try contacting Paul Stoffregen or checking his website.
Maybe he has something that would help.

Also, post a link to the ethernet shield/sd card setup that you are using. Some old shields used funny digital pins for other stuff.



Tim this example is working and showing the addresses on serial monitor...

I am a bit confused about this:

... If it does, then we'll rename that "loop" function to something else and add it to your sketch.

What do you mean?


Nov 24, 2012, 05:21 pm Last Edit: Nov 24, 2012, 05:56 pm by SurferTim Reason: 1
Just as a test, can you move the sensor to pin D5? It looks like D3 and D4 have something on them. There are traces on the top of the shield running to those pins from some device on the shield. ??

Take a look:
Insure there are no traces going to pin D5 on the other side of that shield.

edit: Just a word of advice. Get all the hardware working together in their most simple form. Do not continue until then.


?? I should solder the wiznet D3 pin out  ( bend d5 too ) and wire that to the boards d5 pin? 

There is a trace, because onewire RJ11 socket is connected to d3.


oh and on d4 a led can be defined in the code, so there is a led.


Nov 24, 2012, 09:24 pm Last Edit: Nov 24, 2012, 09:38 pm by SurferTim Reason: 1
If that is the OneWire from the connector only, then use pin 3. Insure nothing else is connected there. I am not familiar with that ethernet shield hardware. You will need to determine why this code makes it fail.
Code: [Select]
#include <OneWire.h>

// DS Temperature chip i/o
OneWire ds(3);  // on pin 3

edit: I see pin 3 going around to an SOIC chip, not the RJ11. Follow it around. I guess that is a 3.3v input to that smd IC device due to the 2.2k resistor set forming a voltage divider.


Nov 24, 2012, 09:45 pm Last Edit: Nov 24, 2012, 09:50 pm by vespapierre Reason: 1
this is the picture of my shield...

edit: changed the picture...


as the manufacturer said to me, d3 is the onewire, where is also a ds18 on the board and RJ11. I'm getting angry for this shield... =(
maybe i should try to implement somehow the code what you sent about to mine...?
i mean this one:


I think I see now. The Dallas is directly mounted to the board, correct? But I am not sure where else D3 goes. It looks like that trace continues after the 2.2k resistor through that "T" and around to the 8 pin IC at the top of the board. I don't know what that does.


yes you are right...here is another view


If you can't add this to your new code (reply #46), then you can't use the other code either. It uses OneWire.
Code: [Select]
#include <OneWire.h>

// DS Temperature chip i/o
OneWire ds(3);  // on pin 3

If adding this makes the SD fail, there is a conflict somewhere. You must determine what that is.


Nov 26, 2012, 08:56 am Last Edit: Nov 26, 2012, 10:30 am by vespapierre Reason: 1
Just to be sure...pin definition and enable/disable 'devices'...
So I'm using the realtime clock, onewire( digital pin3), sd card( digital pin8), and wiznet (digital pin 10). Shield has no ICSP connection.

Please confirm, I should enable/disable the devices.

inputs and outputs :  sdcard( 8 ), wiznet(10) and onewire (3) should be defined as an output, is it right? ( on onewire currently there are 3 ds18b20 )
enable/disable:  put the pin to LOW state will enable the 'device', put the pin to HIGH state will disable that. Is it right?

for example here before I should enable wiznet, and disable SD and onewire:

Code: [Select]

//in the setup()


//in loop() for example


if(!getPage(server,pageAdd)) Serial.print("Fail ");
   else Serial.print("Pass ");

Are these correct?

Go Up