Topic: Lost connection
Hi
Can you help me to solve a problem when the connection is lost.
I need a code to reboot Arduino when the connection between HC-05(06) Bluetooth module and android is lost.
You are not logged in. Please login or register.
RemoteXY community → Software and RemoteXY library → Lost connection
Hi
Can you help me to solve a problem when the connection is lost.
I need a code to reboot Arduino when the connection between HC-05(06) Bluetooth module and android is lost.
Hello,
try to use the variable 'connect_flag' in RemoteXY structure.
Thanks
I am a beginner and I don't understand how to use 'connect_flag'.
Can you please explain me in more detail.
same issue of lost connection. Not sure how to use connect flag either.
Welcome,
Something like this:
void loop()
{
RemoteXY_Handler ();
static bool wasConnected = false;
if ( wasConnected == false )
{
if ( RemoteXY.connect_flag == 1 )
{
wasConnected = true;
Serial.println( "Connected..." );
}
}
else if ( RemoteXY.connect_flag == 0 )
{
wasConnected = false;
Serial.println( "Connection lost, rebooting..." );
rebootArduino();
}
}
Suggested method are not working!!!
connect_flag always has zero value and can not be used at all.
It could be even removed from the structure since it is defined only there. It is dangerous to use use RemoteXY for anything else than toys. Just imagine electric motor remained engaged "forever" even if command link from the smartphone are broken.
RemoteXY community → Software and RemoteXY library → Lost connection
Powered by PunBB, supported by Informer Technologies, Inc.