1 (edited by KissInno 2020-02-24 09:50:37)

Topic: Lib 2.4.3 (14.11.2019) with PlatformIO VS Code

Sorry to bother again & again with this VSC topic but I must miss something with that new official lib. Is there anybody who was able to compile a very simple ESP32 project with Wifi connection?

I really need the latest Lib 2.4.3 to get this new Online Graph feature:  https://remotexy.com/en/help/controls/onlinegraph/

I tried both download from https://github.com/RemoteXY/RemoteXY-Arduino-library or from https://remotexy.com/download/library/2 … moteXY.zip

For a strange reason, I'm back with compilation errors with VSC when using ESP32 Wifi. Exactly same (very simple) ESP32 WIFI project works perfectly under Arduino IDE but does not compile with VSC (while VSC has no issue with ESP32 BLE project).

Here are the VSC errors:
espcore_wifi.h \lib\RemoteXY\src\modules
'class WiFiClass' has no member named 'softAPdisconnect'
'class WiFiClass' has no member named 'mode'
'WIFI_AP' was not declared in this scope
'class WiFiClass' has no member named 'softAP'
invalid new-expression of abstract class type 'WiFiServer'
'class WiFiServer' has no member named 'setNoDelay'
control reaches end of non-void function [-Wreturn-type]

or again 1st error shown in TERMINAL: lib\RemoteXY\src/modules/espcore_wifi.h:42:10: error: 'class WiFiClass' has no member named 'softAPdisconnect'

However, I do have the same lib's in VSC as for Arduino IDE:
1) d:\My_Projects\ESP32_RemoteXY\lib\RemoteXY
2) WiFi ver1.2.7 by Arduino installed as Global Lib


Here is my very simple test project for reference:

#include <Arduino.h>

/*
   -- ESP32_WIFI_AP --
   
   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  // Remotexy is an Access Point to connect to
#include <WiFi.h>
#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "Kiss Innovation 1"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate 
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,13,0,10,13,0,
  1,0,38,15,26,26,2,31,88,0 };
 
// this structure defines all the variables and events of your control interface
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0

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

} RemoteXY;
#pragma pack(pop)

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

#define PIN_BUTTON_1 2


void setup()
{
  RemoteXY_Init ();
 
  pinMode (PIN_BUTTON_1, OUTPUT);
 
  // TODO you setup code
 
}

void loop()
{
  RemoteXY_Handler ();
 
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
 
  // TODO you loop code
  // use the RemoteXY structure for data transfer
}

My platformio.ini:

;PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino

2

Re: Lib 2.4.3 (14.11.2019) with PlatformIO VS Code

Your example compiled without error for me so I don't know what you are doing wrong

The only error I had was "cannot find RemoteXY.h" so the only change I made to your example was adding this line in platformio.ini : lib_extra_dirs = D:\Arduino\libraries , path where I have a local copy of original remotexy library 2.4.3, but I could have added lib_deps = https://github.com/RemoteXY/RemoteXY-Arduino-library , it would work too

3 (edited by KissInno 2020-02-24 17:28:51)

Re: Lib 2.4.3 (14.11.2019) with PlatformIO VS Code

Thanks a lot Guillaume for your support!!! This is really crazy. I don't understand what's going wrong with my laptop Win10-Pro.

I'm running VSC 1.42.1 and I did Updates/Update All.

I tried to delete my old folder and make a new project, with Remotexy folder under project_name\lib

I also tried with lib_deps = https://github.com/RemoteXY/RemoteXY-Arduino-library with project_name\lib empty

I always see the same mistakes, like here in TERMINAL:

Executing task in folder toto1: C:\Users\chphnoi\.platformio\penv\Scripts\platformio.exe run --target upload <

Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards … it-v1.html
PLATFORM: Espressif 32 1.11.2 > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h,
olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) would work too
PACKAGES:
- framework-arduinoespressif32 3.10004.200129 (1.0.4)
- tool-esptoolpy 1.20600.0 (2.6.0)
- tool-mkspiffs 2.230.0 (2.30)
- toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 39 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <RemoteXY> 2.4.3
|   |-- <ESP32 BLE Arduino> 1.0.1
|-- <WiFiEspAT> 1.1.1
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\WiFiPoint_ESP32.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libae2\BLE\BLECharacteristic.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libae2\BLE\BLECharacteristicMap.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\libae2\BLE\BLEClient.cpp.o
In file included from D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:9:0,
                 from D:\ABC\Arduino_Lib\RemoteXY\src/RemoteXY.h:170,
                 from src\WiFiPoint_ESP32.cpp:27:
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h: In member function 'virtual uint8_t CRemoteXY_API::receiveByte()':
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h:53:35: warning: no return statement in function returning non-void [-Wreturn-type]
   virtual uint8_t receiveByte () {};
                                   ^
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h: In member function 'virtual uint8_t CRemoteXY_API::availableByte()':
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h:54:37: warning: no return statement in function returning non-void [-Wreturn-type]
   virtual uint8_t availableByte () {}; 
                                     ^
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h: In member function 'void CRemoteXY_API::init(const void*, void*,
const char*)':
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h:58:14: warning: unused variable 'ms' [-Wunused-variable]
     uint32_t ms;
              ^
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h: In member function 'void CRemoteXY_API::handler()':
D:\ABC\Arduino_Lib\RemoteXY\src/classes/RemoteXY_API.h:127:18: warning: unused variable 'kp' [-Wunused-variable]
     uint8_t *p, *kp;
                  ^
In file included from D:\ABC\Arduino_Lib\RemoteXY\src/RemoteXY.h:170:0,
                 from src\WiFiPoint_ESP32.cpp:27:
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h: At global scope:
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:20:3: error: 'WiFiServer' does not name a type
   WiFiServer *server;

   ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:21:3: error: 'WiFiClient' does not name a type
   WiFiClient client;
   ^
In file included from D:\ABC\Arduino_Lib\RemoteXY\src/RemoteXY.h:170:0,
                 from src\WiFiPoint_ESP32.cpp:27:
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h: In member function 'virtual uint8_t CRemoteXY::initModule()':
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:42:10: error: 'class WiFiClass' has no member named 'softAPdisconnect'
     WiFi.softAPdisconnect(true);
          ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:45:10: error: 'class WiFiClass' has no member named 'mode'
     WiFi.mode(WIFI_AP);
          ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:45:15: error: 'WIFI_AP' was not declared in this scope
     WiFi.mode(WIFI_AP);
               ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:46:10: error: 'class WiFiClass' has no member named 'softAP'
     WiFi.softAP(wifiSsid, wifiPassword);
          ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:61:5: error: 'client' was not declared in this scope
     client.stop();
     ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:62:5: error: 'server' was not declared in this scope
     server = new WiFiServer (port);
     ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:62:18: error: expected type-specifier before 'WiFiServer'
     server = new WiFiServer (port);
                  ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h: In member function 'virtual void CRemoteXY::handlerModule()':
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:84:10: error: 'client' was not declared in this scope
     if (!client) {
          ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:85:14: error: 'server' was not declared in this scope
       client=server->available();
              ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:93:9: error: 'client' was not declared in this scope
     if (client) {
         ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h: In member function 'virtual void CRemoteXY::sendByte(uint8_t)':
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:118:9: error: 'client' was not declared in this scope
     if (client) {
         ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h: In member function 'virtual uint8_t CRemoteXY::receiveByte()':
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:138:9: error: 'client' was not declared in this scope
     if (client) {
         ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h: In member function 'virtual uint8_t CRemoteXY::availableByte()':
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:154:9: error: 'client' was not declared in this scope
     if (client) {
         ^
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h: In member function 'virtual uint8_t CRemoteXY::receiveByte()':
D:\ABC\Arduino_Lib\RemoteXY\src/modules/espcore_wifi.h:148:3: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
*** [.pio\build\esp32doit-devkit-v1\src\WiFiPoint_ESP32.cpp.o] Error 1
============================================== [FAILED] Took 9.83 seconds ==============================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

4

Re: Lib 2.4.3 (14.11.2019) with PlatformIO VS Code

When I compile your example:

Dependency Graph
|-- <RemoteXY> 2.4.3 #b65a904
|   |-- <ESP32 BLE Arduino> 1.0.1
|-- <WiFi> 1.0

Yours try to use a third party WiFi library:

Dependency Graph
|-- <RemoteXY> 2.4.3
|   |-- <ESP32 BLE Arduino> 1.0.1
|-- <WiFiEspAT> 1.1.1

5

Re: Lib 2.4.3 (14.11.2019) with PlatformIO VS Code

Guillaume you are genius.


WiFiEspAT uninstalled from PIO Lib Manager, now it compiles without error :-)))

Thanks a lot!