1

Topic: How to set custom SSID and Password? ESP8266 - AP mode

Greetings,

(sorry for double posting, I don´t see previously the sub-froum hepl that appears to be more indicated).

First, congratulations for this really Plug&Play IoT GUI interface, there are some more options, but others are really hard to use or does not include WiFi access point mode,

I am trying to set a custom SSID name and Password, via hardware serial prior to call RemoteXY_Init() function;

I know that normally the WiFi access point information is provided via constant definitions via #define in the ESP8266 arduino code; but my application uses the ESP8266 as an external WiFi controller for a bigger system. Where the central processor is the unique that can be reprogrammed, due to this the firmware in the ESP8266 needs to remain the same.

But the big controller is not the only unit operating in the area, and the user needs to define his custom SSID name and password, or also change it when he wants. The GUI interface receive the data to be graphically plotted with the SSID name and password via hardware serial.

This is the piece of code I try, but it doesn´t work (the ESP8266 is constantly rebooting; if I use #define and calls to RemoteXY_Init() and RemoteXY_Handler() it works ok, but I cannot set custom ssid and pass):

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

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include <ESP8266WiFi.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
//#define REMOTEXY_WIFI_SSID "Testing"
//#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377

char ssid[20]     = {0};
char password[20] = {0};

char rx_read[128];

CRemoteXY *rxy1;

...
/*
there are functions to read from the serial, these works flawleslly

bytes = Serial.available();

for(aux=0;aux<bytes;aux++)
{
  rx_read[aux] = Serial.read();
}

...

for example there are code to set the ssid and password variable arrays:

for(aux=0;aux<20;aux++)
{
ssid[aux] = rx_read[5+aux];
}

for(aux=0;aux<20;aux++)
{
password[aux] = rx_read[25+aux];
}

*/

...

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

    // input variables
  int8_t joystick_1_x; // =-100..100 x-coordinate joystick position 
  int8_t joystick_1_y; // =-100..100 y-coordinate joystick position 
  uint8_t select_1; // =0 if select position A, =1 if position B, =2 if position C, ... 
  int8_t slider_1; // =0..100 slider position 

    // output variables
  char text_1[21];  // string UTF8 end zero 
  float onlineGraph_1_var1;
  float onlineGraph_1_var2;
  float onlineGraph_1_var3;
  float onlineGraph_1_var4;
  float onlineGraph_1_var5;
  float onlineGraph_1_var6;
  float onlineGraph_1_var7;
  float onlineGraph_1_var8;
  float onlineGraph_1_var9;
  float onlineGraph_1_var10;

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

}; 

  
#pragma pack(pop)

struct rxy rxy_struct;


void loop{

...
more code
...

if(inicializado == ()255)
{

rxy1->handler();

}else
{

  /* Message received */
  if(inicializado == (uint8_t)16)
  {
    ESP.wdtFeed();

    inicializado = (uint8_t)255;

    //RemoteXY_Init();
    rxy1 = new CRemoteXY( RemoteXY_CONF, &rxy_struct, NULL, ssid, password, REMOTEXY_SERVER_PORT );
    
    /* Ya se ha inicializado, se puede ejecutar el bucle de comunicaciones Wifi */
    ESP.wdtFeed();
  }

}

Thanks in advance for the help,

2

Re: How to set custom SSID and Password? ESP8266 - AP mode

What are you getting? watchdog timeout?

3

Re: How to set custom SSID and Password? ESP8266 - AP mode

If uoy used REMOTEXY_MODE__ESP8266WIFI_LIB_POINT mode, RemoteXY_Init () convert to

#define RemoteXY_Init() remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &RemoteXY, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_WIFI_SSID, REMOTEXY_WIFI_PASSWORD, REMOTEXY_SERVER_PORT)

you can use

void init () {
  // RemoteXY_Init();  
  remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &RemoteXY, REMOTEXY_ACCESS_PASSWORD, "my_ssid", "my_pass", REMOTEXY_SERVER_PORT)
}

4

Re: How to set custom SSID and Password? ESP8266 - AP mode

remotexy wrote:

If uoy used REMOTEXY_MODE__ESP8266WIFI_LIB_POINT mode, RemoteXY_Init () convert to

#define RemoteXY_Init() remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &RemoteXY, REMOTEXY_ACCESS_PASSWORD, REMOTEXY_WIFI_SSID, REMOTEXY_WIFI_PASSWORD, REMOTEXY_SERVER_PORT)

you can use

void init () {
  // RemoteXY_Init();  
  remotexy = new CRemoteXY (RemoteXY_CONF_PROGMEM, &RemoteXY, REMOTEXY_ACCESS_PASSWORD, "my_ssid", "my_pass", REMOTEXY_SERVER_PORT)
}

Thanks, now it works ok!