Show Posts
Pages: 1 2 [3]
31  Using Arduino / Installation & Troubleshooting / Re: Loading Sketches Problem with Mega2560 and Ethernet Shield on: January 21, 2012, 10:56:40 am
SurferTim,
Thanks for the reply, but "yes" everything, including the Serial.read() Serial.print() and Serial.println() work fine.
I cannot imagine that it is defective because everything works once loaded and running.  I'm successfully serving webpages, etc. as well as use the onboard SD card to log files and access them through the webserver.
32  Using Arduino / Installation & Troubleshooting / Re: Loading Sketches Problem with Mega2560 and Ethernet Shield on: January 21, 2012, 09:48:26 am
I have to add...
I am using Arduino 1.0 IDE
My Mega 2560 is NOT a Rev3, so it does not have the 2 pins closest to the USB port.
My Ethernet Shield IS Rev3 compatible, so it attaches with an offset so that 2 sets of 2 pins are hanging free, to where they would have plugged into a Rev3 Mega.  I bent them away, slightly, to ensure that they do not short to the power cap on the Mega.
Thought these details might help.

Thanks again.
33  Using Arduino / Installation & Troubleshooting / Loading Sketches Problem with Mega2560 and Ethernet Shield on: January 21, 2012, 09:36:05 am
I have a Mega2560 with an Ethernet Shield, and I have found that I have to remove the Ethernet shield to get my sketches to load. 
Here is my standard operating procedure to compile/load/test a sketch...

1)  Unplug USB/power to Arduino
2)  Remove Ethernet Shield from Arduino Mega
3)  Plug in USB/power to bare Mega board.
4)  Confirm that COM5 shows up in Tool/Serial Port
5)  Compile/Load Sketch
6)  Fails to Upload the first time and times out...I can tell it fails by watching that the TX/RX LEDs do not blink steadily.
7)  Unplug USB/Power, then plug in USB/Power
smiley-cool  Confirm that COM5 shows up in Tool/Serial Port
9)  Compile/Load Sketch
10)  Usually is successful this 2nd time attempt and the TX/RX LEDs flash and Arduino gets to "Upload Done".
11)  Unplug USB/power to bare Arduino
12)  Re-attach the Ethernet Sheild
13)  Plug in Arduin USB/Power
14)  Test Sketch

This is becoming a big time sink and I am hoping someone can suggest something to help.

Thank you in advance.
34  Using Arduino / Installation & Troubleshooting / Time Library in Arduino 1.0 on: January 21, 2012, 08:54:40 am
Help with Time Library...

I have a project where I am already connecting to a NTP server to get the current EPOCH time.  This all works great.  I would like to set, i.e. synchronize, the Arduino clock, by using the functions in the time library, like...
setTime(t);
where I assume t is EPOCH seconds???

Then, use the time library function, below, to get the hour, minutes, second, day, week, month, year, instead of having to code all the conversions myself.

hour();            // the hour now  (0-23)
minute();          // the minute now (0-59)         
second();          // the second now (0-59)
day();             // the day now (1-31)
weekday();         // day of the week, Sunday is day 0
month();           // the month now (1-12)
year();            // the full four digit year: (2009, 2010 etc)


However, when I simply add...
#include <Time.h>
to my sketch, I get the following compile errors....


C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:31:19: error: types.h: No such file or directory
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:32:19: error: w5100.h: No such file or directory
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:33:20: error: socket.h: No such file or directory
In file included from C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:37:
C:\arduino-1.0\libraries\Time\/UdpBytewise.h:66: error: conflicting return type specified for 'virtual void UdpBytewiseClass::write(uint8_t)'
C:\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp: In member function 'void UdpBytewiseClass::begin(uint16_t)':
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:46: error: 'Sn_MR_UDP' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:46: error: 'socket' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::available()':
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:55: error: 'getSn_RX_RSR' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:61: error: 'recvfrom' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::endPacket()':
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:106: error: 'sendto' was not declared in this scope

I suspect that some of the *.h files are not being seen, as they are in the Ethernet library directory, but it seems that the Time.h assumes that they are in the Time subdirectroy, via UdpBytewise.cpp.
Also, "types.h" does not exist anywhere.

I enclosed a print.txt file of my libraries directory.

Can anyone help me out here, or is there a newer Time Library that is good for Arduino 1.0?

Also, here is a view of the libraries that I am currently loading into my Sketch.  Again, all is good if I comment out the Time.h.

#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
#include <SdFat.h>
#include <SdFatUtil.h>

//stuff added for timer
#include <EthernetUdp.h>
#include <stdlib.h>

//stuf to set the arduino time clock
#include <Time.h>


Thanks for any help.



Pages: 1 2 [3]