Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem during compilation util.h no such file or directory #7

Open
jfpion opened this issue Mar 6, 2016 · 1 comment
Open

problem during compilation util.h no such file or directory #7

jfpion opened this issue Mar 6, 2016 · 1 comment

Comments

@jfpion
Copy link

jfpion commented Mar 6, 2016

hello
I want to use an arduino uno plus ethernet shied to command a relay to work as a watchdog for an adsl modem . so I intend to ping a known IP and reboot in case of freeze.
the sketch is 👍

/*
Ping Example
This example sends an ICMP pings every 500 milliseconds, sends the human-readable
result over the serial port.

Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 30 Sep 2010
by Blake Foster
*/

#include <SPI.h>
#include <Ethernet.h>
#include <ICMPPing.h>

define relaypin 13

int JFP=0;

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; // max address for ethernet shield
byte ip[] = {192,168,2,177}; // ip address for ethernet shield
IPAddress pingAddr(74,125,26,147); // ip address to ping

SOCKET pingSocket = 0;

char buffer [256];
ICMPPing ping(pingSocket, (uint16_t)random(0, 255));

void setup()
{
  // start Ethernet
  Ethernet.begin(mac, ip);
  Serial.begin(9600);
}

void loop()
{
  ICMPEchoReply echoReply = ping(pingAddr, 4);
  if (echoReply.status == SUCCESS)
  {
    sprintf(buffer,
            "Reply[%d] from: %d.%d.%d.%d: bytes=%d time=%ldms TTL=%d",
            echoReply.data.seq,
            echoReply.addr[0],
            echoReply.addr[1],
            echoReply.addr[2],
            echoReply.addr[3],
            REQ_DATASIZE,
            millis() - echoReply.data.time,
            echoReply.ttl);
JFP=0;
  }
  else
  {
++ JFP;
    sprintf(buffer, "Echo request failed; %d", echoReply.status);

if (JFP== 3)
{ 
digitalWrite  (relaypin , HIGH);
delay (2000);
digitalWrite  (relaypin , LOW);
JFP=0;
}
}
  Serial.println(buffer);
  delay(500);
}

it is straight from the example

but i get an error during the compilation

C:\Program Files (x86)\Arduino\libraries\icmp_ping\ICMPPing.cpp:11:18: fatal error: util.h: No such file or directory
#include <util.h>

what dit i wrong ?
where is the util.h ?

thank you

@jfpion
Copy link
Author

jfpion commented Mar 6, 2016

I found the pb . the utils.h is in the last github version but not in the one linked in the arduino documentation (the link here is https://github.com/BlakeFoster/Arduino-Ping/archive/version2.0.zip )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant