The download on the first link compiled ok in IDE 1.0.1.
Dear dxw00d,
can you please tell me what libraries are you using?
Please copy paste all the code from the arduino IDE 1.0.1 sketch and let me know about the libraries you are using.
Are libraries the original ones?
All I can think of is that my Ethernet board is not working properly if you can easily upload the program.
Please send the code that you compiled so I know I don't have any errors when I copy paste or something.
I can see that the <utility/socket.h> library is not highlighted in blue like the others. So I don't think its been recognised.
The code I've trying to upload:
#include <SPI.h>
#include <Ethernet.h>
#include <Utility\Socket.h>
void SendWOLMagicPacket(byte * pMacAddress)
{
// The magic packet data sent to wake the remote machine. Target machine's
// MAC address will be composited in here.
const int nMagicPacketLength = 102;
byte abyMagicPacket[nMagicPacketLength] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
byte abyTargetIPAddress[] = { 255, 255, 255, 255 }; // don't seem to need a real ip address.
const int nWOLPort = 7;
const int nLocalPort = 8888; // to "listen" on (only needed to initialize udp)
// Compose magic packet to wake remote machine.
for (int ix=6; ix<102; ix++)
abyMagicPacket[ix]=pMacAddress[ix%6];
if (UDP_RawSendto(abyMagicPacket, nMagicPacketLength, nLocalPort,
abyTargetIPAddress, nWOLPort) != nMagicPacketLength)
Serial.println("Error sending WOL packet");
}
int UDP_RawSendto(byte* pDataPacket, int nPacketLength, int nLocalPort, byte* pRemoteIP, int nRemotePort)
{
int nResult;
int nSocketId; // Socket ID for Wiz5100
// Find a free socket id.
nSocketId = MAX_SOCK_NUM;
for (int i = 0; i < MAX_SOCK_NUM; i++)
{
uint8_t s = W5100.readSnSR(i);
if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT)
{
nSocketId = i;
break;
}
}
if (nSocketId == MAX_SOCK_NUM)
return 0; // couldn't find one.
if (socket(nSocketId, SnMR::UDP, nLocalPort, 0))
{
nResult = sendto(nSocketId,(unsigned char*)pDataPacket,nPacketLength,(unsigned char*)pRemoteIP,nRemotePort);
close(nSocketId);
} else
nResult = 0;
return nResult;
}
And the errors I get:
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:1: error: stray '\377' in program
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:1: error: stray '\376' in program
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:51: error: stray '@' in program
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:59:4: error: invalid preprocessing directive #i
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:61:4: error: invalid preprocessing directive #i
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:63:4: error: invalid preprocessing directive #i
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:69:4: error: invalid preprocessing directive #i
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:71:4: error: invalid preprocessing directive #i
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:135: error: stray '#' in program
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:187: error: missing terminating ' character
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:213: error: missing terminating ' character
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:229: error: stray '#' in program
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:229: error: missing terminating ' character
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:1: error: expected unqualified-id before '/' token
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:75: error: expected unqualified-id before '/' token
C:\Program Files\arduino-1.0.2\libraries\Ethernet\UdpBytewise.cpp:99: error: expected unqualified-id before '/' token