Award
Congratulations Richard R, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Assistance Requested

Help Jayutmb with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Jayutmb claims to have checked these sources:
 
#1

What is the quickest way to set up the EZb to re-connect automatically if connection is lost when it is the host going right to my laptop?

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

Have a script running in the background (in a loop) checking the connection status with the command IsConnected()... if IsConnected() comes back false then use the ControlCommand Connect() to reconnect...

Check a script for these commands

Code:


repeatuntil(1=2)
if(IsConnected=0)
ControlCommand("Connection", Connect0)
sleep(3000) #give a little time to reconnect
endif
sleep(1000) # check interval
endrepeatuntil

#3

Code:


$connected = IsConnected( 0 )
REPEATUNTIL($connected = 1)
If($connected = 0)
$Connection=0
Else
$Connection = 1
EndIf
if($connection = 0)
ControlCommand("Connection", Connect0)
$connected = IsConnected( 0 )
sleep(4000)
endif
EndRepeatUntil



This is a bit sloppy but I threw it together just now. Between Rich and this, you should be able to see what is happening. I would put in a monitor script that monitors connection status and other things like maybe temp or whatever else you decide is necessary. Then call this script (or richards) from the monitor script that can loop multiple times.

#4

thx guys Smile always a help Smile Grin

#5

Even simpler...

Code:


:loop
IF(IsConnected(0) = 0)
RepeatUntil(IsConnected(0) = 1)
ControlCommand("Connection", Connect0)
Sleep(1000)
EndRepeatUntil
EndIf
Sleep(10000)
Goto(loop)



That should loop forever, check every ten seconds if it's connected, if it isn't it will attempt to connect every second until connected. It should connect within a second if able to, you can reduce the ten second checks to 5 seconds or even every second if you wish. The more frequent the checks the more processing power it'll take though.