-->
Page 1 of 2

PING Function

PostPosted: Mon Feb 27, 2017 4:33 pm
by dziloo@wp.pl
Hello everyone! Little questions:
Is there ESPbasic function like a standard internet PING ???
I mean, that like to come home with my phone, my router automatically assigns me my IP.
example such as 192.168.1.100

Now ESP detects in timer loop this event and automatically launches, for example:
- Runs my computer,
- Runs my favorite light,
- Or warms up my dinner ....

It looks to me like this:
Code: Select all
'*** Example code- Not work !!! ***
IF PING "192.168.1.100" = 1
Then GOTO [Warm Dinner]
Else [Do Nothing]


Thank you for any suggestions: dziloo@wp.pl

Re: PING Function

PostPosted: Mon Feb 27, 2017 10:45 pm
by Mmiscool
Added a new command to the latest version.

Please note it will only work for the 4meg build.

See
https://docs.google.com/document/d/1EiY ... irbdj5sq3u


Code: Select allif ping("192.168.1.150") = 1 then print "Ping successful"

Re: PING Function

PostPosted: Tue Feb 28, 2017 4:05 pm
by dziloo@wp.pl
Thanx- Work perfect !!!

Re: PING Function

PostPosted: Tue Feb 28, 2017 5:30 pm
by dziloo@wp.pl
Something is wrong. Please take a look..
My examply code:
Code: Select all'PING everything ESP Basic Branch 3.xx

Print "PING everything in my intranet.... wait..."

For x = 1 to 254
 if ping("192.168.1." & x ) = 1 then
   print "Ping 192.168.1." & x & " Successfull !!!"
 Else
   print "Ping 192.168.1." & x & " NOT Visible !"
 End If
Next x

After RUN ....PRINT Effect:
--------------------------------------------------------------------------------------
PING everything in my intranet.... wait...
Ping 192.168.1.1 Successfull !!!
Ping 192.168.1.2 NOT Visible !
Done...
--------------------------------------------------------------------------------------
Program stopped after first Pinging NOT successfull.
Where is the next part of the for "Loop .. Next" Looping???

My configuration:
192.168.1.1 - this is my Router
192,168.1.2 - this is NONE
192.168.1.80 - this is a ESP

What is wrong? - Regards - Slawek: dziloo@wp.pl