B4R Library ESP8266 Ping

Discussion in 'B4R Libraries' started by Erel, Jan 1, 2017.

  1. Erel

    Erel Administrator Staff Member Licensed User

    rESP8266Ping is based on: https://github.com/dancol90/ESP8266Ping
    It is an ESP8266 only library.

    It implements a ping feature which can be useful to test whether a remote server is reachable.

    Example:
    Code:
    Sub Process_Globals
       
    Public Serial1 As Serial
       
    Private wifi As ESP8266WiFi
       
    Private ping As ESP8266Ping
    End Sub

    Private Sub AppStart
       Serial1.Initialize(
    115200)
       
    Log("AppStart")
       
    If wifi.Connect("dlink"Then
         
    Log("Connected to network")
       
    Else
         
    Log("Failed to connect to network")
         
    Return
       
    End If
       
    Log("google.com: ", ping.PingHost("google.com"2))
       
    Log(ping.AverageTime)
       
    Log("nonexistdomain234.com: ", ping.PingHost("nonexistdomain234.com"2))
       
    Log("local ip: ", ping.PingIP(Array As Byte(19216806), 2))
       
    Log(ping.AverageTime)
    End Sub
     

    Attached Files:

  2. kolbe

    kolbe Active Member Licensed User

    Can't quite figure out why this library won't compile. I can use wifi just fine. The original ping library works in the Arduino IDE too. If I include the rESP8266Ping library in a B4R project I get the following error. It's not being pulled into the sketch directory and I don't understand the mechanism for this either.

    Code:
    Compiling & deploying Ino project (ESP32 Dev Module - COM3)    Error
    Loading configuration...
    Initializing packages...
    Preparing boards...
    Verifying...
    In file included from C:\Users\brdan\DOCUME~1\BASIC4~2\CLOCKT~1\Objects\bin\sketch\rESP8266Ping.h:3:0,
                     from C:\Users\brdan\DOCUME~
    1\BASIC4~2\CLOCKT~1\Objects\bin\sketch\B4RDefines.h:31,
                     from C:\Users\brdan\DOCUME~
    1\BASIC4~2\CLOCKT~1\Objects\src\src.ino:1:
    C:\Users\brdan\DOCUME~
    1\BASIC4~2\CLOCKT~1\Objects\bin\sketch\ESP8266Ping.h:24:25: fatal error: ESP8266WiFi.h: No such file or directory
    compilation terminated.
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    You need to test it with an ESP8266 board. I'm not sure that it is compatible with ESP32.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice