1

Topic: problem with edit control

Hello Every body
This software is really nice but I notice a bug
please have a look in this project
http://remotexy.com/en/editor/abe5ccc74 … 44c730224/

and this associated code. The problem is concerning the size of field inputs. Is there a limit concerning the size ?
For example it works if I choose 5 concerning the last dimension (instead of 30) of my array. T works. It means that I Can change and see the result in my serial terminal.
May you check if you have also the problem and resolve it? Seems to be a size of text field more than 100 can occur a problem?

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

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT

#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial1
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "RemoteXY"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255, 124, 0, 0, 0, 43, 0, 10, 13, 1,
  7, 36, 5, 26, 56, 4, 2, 26, 2, 31,
  7, 36, 5, 37, 56, 4, 2, 26, 2, 31,
  7, 36, 5, 47, 56, 4, 2, 26, 2, 31,
  7, 36, 5, 62, 56, 4, 2, 26, 2, 31
};

// this structure defines all the variables and events of your control interface
struct {

  // input variables
  char test_edit[31];  // string UTF8 end zero
  char test_edit1[31];  // string UTF8 end zero
  char test_edit2[31];  // string UTF8 end zero
  char test_edit3[31];  // string UTF8 end zero

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

} RemoteXY;
#pragma pack(pop)

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

const int S1_mux = 6;
const int S0_mux = 7 ;
// S1/SO = 0-0 => Externe
// S1/S0 = 0-1 => Modem ERCO
// S1/SO = 1-0 => Module WIFI ESP32
// S1/SO = 1-1 => GPS A2200
// --------------------------------------------------------









const int Wifi_esp01_en = 9;

void setup()
{
  SerialUSB.begin(115200);
  digitalWrite(S0_mux, LOW);
  digitalWrite(S1_mux, HIGH);

  digitalWrite(Wifi_esp01_en, HIGH);
  RemoteXY_Init ();

  String mystring = "130.120.117.103";
  char s[sizeof(mystring) + 10];
  mystring.toCharArray(s, sizeof(s));
  sprintf   (RemoteXY.test_edit, s);
  // TODO you setup code
  while (1)
  { RemoteXY_Handler ();
    //strcpy(RemoteXY.test_edit, "130.120.23.21");
    String newString = RemoteXY.test_edit;
    SerialUSB.println(newString);


  }
}

void loop()
{
  RemoteXY_Handler ();
  //strcpy(RemoteXY.test_edit, "130.120.23.21");
  String newString = RemoteXY.test_edit;
  SerialUSB.println(newString);
  // TODO you loop code
  // use the RemoteXY structure for data transfer


}

2

Re: problem with edit control

Je n'ai pas compris ton problème... Peux-tu montrer un code qui fonctionne et un autre qui ne fonctionne pas ?

Par contre tu as un problème dans ton code, loop() ne sera jamais appelé car tu as mis une boucle infinie dans setup(). Et pourquoi utiliser des String si c'est pour les convertir en tableau de char juste après? Un conseil, n'utilise pas les String, ça ne sert à rien sauf à fragmenter la SRAM...

3 (edited by pascalou31 2020-04-02 19:10:36)

Re: problem with edit control

Bonjour
on est bien d'accord que la loop ne sera jamais appelée, là n'est pas le souci
dans mon cas je veux faire une interface avec 4 tableaux avec l'edit text' , ce que je parviens à faire pour les 3 premiers à 30 caractères (cela fonctionne) mais si je rajoute un autre de 30 caractères cela plante...Tu as qu'a essayé...
par exemple je m'amuse à changer le premier tableau dans l'interface et à voir dans le serial si il y a modification de la variable. cela est le cas si j ai trois tableaux mais si j'en ai 4 cela plante...Et cela marche pas...
par contre je me suis appercu que la taille compte ! si je mets 10 edit text avec une taille de 10 cela fonctionnera!

je suis peut etre plus clair? merci de m'éclairer et merci à toi en tout cas!
le code que j'ai posté ne fonctionne pas! il plante l'application ...!