1

Topic: Timeout on Bluetooth on several projects

Hi there,

I'am new here. In short : I like all flavors of arduino/teensy... and music gear too). My english may be poor or bad...
My answer : Désolé, je suis français !

I struggle with "timeout issues" on several (bluetooth) projects only.
Context : arduino uno + HC-06  / RemoteXY Pro on androïd (last avaible version) / RemoteXY.h (last avaible version)

The "Simple button example using software serial" sketch runs well ! More complex sketches too...
But the one i'd "really" like to build, NOT : I get a damned "timeout error". To bad !
I guessed this was related to the size of my sketch (loads SDFat and Midi libraries...).

So, I removed all excepted the "RemoteXY interface"... And what happened ? Timeout !
Here is the thing. Could You please test it and, why not, find the reason of this (damned) timeout ? Thanks !

/*
   Context : arduino uno + HC-06  / october 2021
   RemoteXY Pro (last avaible version) / RemoteXY.h (last avaible version)
   "Simple button example using software serial" ok ! More complex sketches too...
   But... this one, NOT : timemout !


    int
used with Remote XY pro --
   
   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.6 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                   
     - for ANDROID 4.8.01 or later version;
     - for iOS 1.5.1 or later version;
   
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.   
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>

#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


// RemoteXY configurate 
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,14,0,82,0,207,0,13,1,1,
  2,0,2,92,19,7,28,26,31,31,
  79,78,0,79,70,70,0,4,0,54,
  0,8,84,29,26,67,5,38,0,14,
  5,31,26,11,5,3,9,47,35,35,
  37,26,31,67,5,3,34,49,5,31,
  26,16,1,8,4,42,10,10,1,31,
  33,0,2,0,40,92,19,7,28,26,
  31,31,79,78,0,79,70,70,0,1,
  3,26,90,10,10,4,31,82,0,1,
  0,41,42,11,11,4,31,83,0,67,
  5,38,22,14,5,31,26,11,67,5,
  38,11,14,5,31,26,11,67,5,8,
  87,9,4,2,26,11,67,5,46,87,
  9,4,2,26,11,4,160,3,13,32,
  5,29,26,4,160,3,2,32,5,29,
  26,4,160,3,24,32,5,29,26,1,
  3,38,5,14,4,28,31,116,114,97,
  0,1,3,38,16,14,4,28,31,118,
  101,108,0,1,3,38,27,14,4,28,
  31,102,105,116,0,67,5,20,40,14,
  5,31,26,11 };
 
// this structure defines all the variables and events of your control interface
struct {

    // input variables
  uint8_t switch_lower; // =1 if switch ON and =0 if OFF
  int8_t patch_slider; // =0..100 slider position
  int8_t volume_x; // =-100..100 x-coordinate joystick position
  int8_t volume_y; // =-100..100 y-coordinate joystick position
  uint8_t Panic; // =1 if button pressed, else =0
  uint8_t switch_upper; // =1 if switch ON and =0 if OFF
  uint8_t recall; // =1 if button pressed, else =0
  uint8_t select_patch; // =1 if button pressed, else =0
  int8_t velo_slider; // =-100..100 slider position
  int8_t transp_slider; // =-100..100 slider position
  int8_t f_tune_slider; // =-100..100 slider position
  uint8_t transp_0; // =1 if button pressed, else =0
  uint8_t velo_0; // =1 if button pressed, else =0
  uint8_t f_tune_0; // =1 if button pressed, else =0

    // output variables
  char transp[11];  // string UTF8 end zero
  char patch[16];  // string UTF8 end zero
  char f_tune[11];  // string UTF8 end zero
  char velo[11];  // string UTF8 end zero
  char lower[11];  // string UTF8 end zero
  char upper[11];  // string UTF8 end zero
  char patch_n[11];  // string UTF8 end zero

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

void setup()
{
  RemoteXY_Init ();
 
  // TODO you setup code
 
}

void loop()
{
  RemoteXY_Handler ();
 
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay()

}

2

Re: Timeout on Bluetooth on several projects

I have found that most, if not all, of the issues I had with BT/BLE (with RemoteXY and other apps) was generally down to incompatibilities with the phones/tablets and the type of BT/BLE device they where connecting to.  Some worked great, others intermittent and yet others not at all.

I now stay away from BT/BLE and use WiFi whenever possible.

"And voila, which is French for.......'and then I found out.'" - Ready Player One

3

Re: Timeout on Bluetooth on several projects

We tested this code. It works well. Maybe the problem lies elsewhere.