I am using this example code for an AP connection:
https://www.arduino.cc/en/Reference/WiFiNINABeginAP
And the simple webserver code included in the wifinina library. I had a look at the examples for the remotexy library, how would you go about linking these two codes?
I tried calling some functions from the example code on a remotexy esp32_core sketch but received some error messages. It seems that i need to define a function for the integrated esp32 module.
/*
-- New project --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.4.3 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.5.1 or later version;
- for iOS 1.4.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__ESP32CORE_WIFI_POINT
#include <WiFi.h>
#include <SPI.h>
#include <WiFiNINA.h>
#include "arduino_secrets.h"
#include <RemoteXY.h>
/* RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "RemoteXY"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377
*/
char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0;
int led = LED_BUILTIN;
int status = WL_IDLE_STATUS;
WiFiServer server(80);
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,1,0,0,0,20,0,10,13,0,
2,0,0,0,100,63,2,26,31,31,
79,78,0,79,70,70,0 };
// this structure defines all the variables and events of your control interface
struct {
// input variables
uint8_t switch_1; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
void setup()
{
RemoteXY_Init ();
Serial.print("Creating access point named: ");
Serial.println(ssid);
// Create open network. Change this line if you want to create an WEP network:
status = WiFi.beginAP(ssid, pass);
if (status != WL_AP_LISTENING) {
Serial.println("Creating access point failed");
// don't continue
while (true);
}
// wait 10 seconds for connection:
delay(10000);
// start the web server on port 80
server.begin();
// you're connected now, so print out the status
printWiFiStatus();
// TODO you setup code
}
void loop()
{
RemoteXY_Handler ();
// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
}
Error message below
In file included from F:\Documents\Arduino\sketch_sep06a\sketch_sep06a.ino:31:0:
F:\Documents\Arduino\libraries\RemoteXY/RemoteXY.h:119:4: error: #error RemoteXY mode does not defined or defined error: REMOTEXY_MODE__XXXXXXX
#error RemoteXY mode does not defined or defined error: REMOTEXY_MODE__XXXXXXX
^~~~~
Multiple libraries were found for "WiFi.h"
Used: C:\Users\HP Desktop\Desktop\fence\arduino-nightly\libraries\WiFi
Not used: F:\Documents\Arduino\libraries\WiFiNINA
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.