Confusion between Platform Framework and Core

Hi.
I am very new to Platform io.
I did a lot of searching but fail to get any help full answers.

To explain I will use Arduino ide as a reference point.

The Arduino ide versions is 1.xx or 2.xx … in Platform io what is this called Platform or Framework?

From the Arduino Board Manager an ESP32 core (let’s just call it a core for now) can be downloaded , upgraded or downgraded.
What is this core in Platform io Platform or Framework?

See this list for platform version vs. Arduino core versions: platform-espressif32 versions · GitHub

If I understand correctly what you’re asking: “PlatformIO Core” is what makes PlatformIO (aka PIO) tick: a collection of Python scripts. “PlatformIO IDE” is the setup which makes PIO work in the Visual Studio IDE (similar to the Arduino IDE). Frameworks are installable components managed by PIO - there’s a framework which allows PIO to build and run code written with the Arduino conventions and run-time libraries/packages. There are also (many) other frameworks.

I suggest looking around on this website: Your Gateway to Embedded Software Development Excellence — PlatformIO latest documentation - there’s no magic, but PIO’s terminology is different (and closer to “normal” s/w development practice, IMO).

Thanks for the List but this will only help me when I know a lot more about Platform io.

Yes and no , let me explain.

Using Arduino ide , I got a working code with RemoteXY.
The WiFi point connects to my phone,blue on board led is always on.
But there is a problem with the latest esspresif core so I down graded the core to 2.0.11.

Platformio
The exact same code does compile and download to my ESP32.
But my phone does not connect, blue on board led is off.

So in Platform io , should I down grade a Platform or a Framework or a Core to get RemoteXY to work?

Why does the same working code not work with Platform io?

To get Espressif’s Arduino 2.0.11 you have to use in your platformio.ini:

platform = espressif32 @ 6.4.0
1 Like

@sivar2311
Thanks now I understand the version list you posted.
I will try that.

Thanks it is working.
When I compile the code with Arduino ide , the Blue on board Led is on.

But.

Using Platform io the Led is off.

Which board do you have and what’s the content of your platformio.ini?

My board is ESP32 WROOM DA.

That is what I select in the Arduino ide.

I could only find ESP32 DEV KIT in Pio.

I will test ESP32 DEV KIT with the Arduino ide tomorow and report back also report on the Platformio.ini.

Thanks for the additional support.

The ESP32 WROOM DA module is exact the same as the ESP32 WROOM module except for it’s dual antenna (DA).

The board is a ESP32 DevKitC-V4 and has no onboard LED’s except the POWER led.

When I use Arduino ide with ESP32 DEV Module the blue on board Led does not switch on.

But in my Setup I have 2 fast blinks and that works.

This is my Platformio.ini

[env:esp32dev]
;platform = espressif32
platform = espressif32@6.4.0  ; 6.4.0 for Arduino espressif Core 2.0.11
board = esp32dev
framework = arduino
lib_deps = remotexy/RemoteXY@^3.1.14

How do you blink the led? Please show the code.

#include <Arduino.h>

/*
   -- ESP32BatTest --

   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.13 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.15.01 or later version;
     - for iOS 1.12.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          //
//////////////////////////////////////////////

// you can enable debug logging to Serial at 115200
#define REMOTEXY__DEBUGLOG

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

#include <WiFi.h>

// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "ESP32BatTest2"
#define REMOTEXY_WIFI_PASSWORD "56785678"
#define REMOTEXY_SERVER_PORT 6377

unsigned int _time = 600;//seconds
unsigned int counter = 0;//count seconds
float analogVolts = 0;
int battLow = false;
unsigned int totalSeconds = 0;
#define relay 23
#define buzzer 21
#define led 2

byte writeFlag1 = false;
byte writeFlag2 = false;
byte writeFlag3 = false;
byte writeFlag4 = false;
byte writeFlag5 = false;
byte writeFlag6 = false;
byte writeFlag7 = false;
byte writeFlag8 = false;
byte writeFlag9 = false;

byte writeFlag10 = false;
byte writeFlag11 = false;
byte writeFlag12 = false;



#include <RemoteXY.h>

// RemoteXY GUI configuration
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 312 bytes
{ 255, 0, 0, 154, 0, 49, 1, 19, 0, 0, 0, 69, 83, 80, 51, 50, 66, 97, 116, 84,
  101, 115, 116, 50, 0, 31, 1, 106, 200, 1, 1, 26, 0, 67, 3, 29, 28, 10, 69, 2,
  26, 11, 67, 3, 43, 28, 10, 69, 2, 26, 11, 67, 3, 56, 29, 10, 69, 2, 26, 11,
  67, 3, 16, 28, 10, 69, 2, 26, 11, 67, 3, 69, 29, 10, 69, 2, 26, 11, 67, 3,
  82, 29, 10, 69, 2, 26, 11, 67, 3, 95, 29, 10, 69, 2, 26, 11, 67, 3, 108, 29,
  11, 69, 2, 26, 11, 67, 3, 122, 29, 10, 69, 2, 26, 11, 67, 3, 135, 30, 10, 69,
  2, 26, 11, 129, 34, 17, 26, 9, 64, 17, 49, 48, 109, 105, 110, 0, 129, 34, 30, 26,
  9, 64, 17, 50, 48, 109, 105, 110, 0, 129, 34, 44, 26, 9, 64, 17, 51, 48, 109, 105,
  110, 0, 129, 34, 57, 26, 9, 64, 17, 52, 48, 109, 105, 110, 0, 129, 35, 70, 26, 9,
  64, 17, 53, 48, 109, 105, 110, 0, 129, 34, 83, 14, 9, 64, 17, 49, 104, 114, 0, 129,
  35, 96, 24, 9, 64, 17, 49, 104, 114, 49, 48, 0, 129, 35, 109, 24, 9, 64, 17, 49,
  104, 114, 50, 48, 0, 129, 35, 122, 24, 9, 64, 17, 49, 104, 114, 51, 48, 0, 129, 35,
  135, 24, 9, 64, 17, 49, 104, 114, 52, 48, 0, 67, 3, 148, 30, 10, 69, 2, 26, 11,
  129, 36, 149, 24, 9, 64, 17, 49, 104, 114, 53, 48, 0, 67, 3, 161, 31, 10, 69, 2,
  26, 11, 129, 37, 161, 18, 9, 64, 17, 50, 104, 114, 115, 0, 67, 7, 180, 22, 15, 69,
  120, 26, 11, 67, 40, 182, 46, 10, 69, 95, 6, 11
};

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

  // output variables
  char value_02[11]; // string UTF8 end zero
  char value_03[11]; // string UTF8 end zero
  char value_04[11]; // string UTF8 end zero
  char value_01[11]; // string UTF8 end zero
  char value_05[11]; // string UTF8 end zero
  char value_06[11]; // string UTF8 end zero
  char value_07[11]; // string UTF8 end zero
  char value_08[11]; // string UTF8 end zero
  char value_09[11]; // string UTF8 end zero
  char value_10[11]; // string UTF8 end zero
  char value_11[11]; // string UTF8 end zero
  char value_12[11]; // string UTF8 end zero
  char value_13[11]; // string UTF8 end zero
  char value_14[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()
{
  Serial.begin(115200);
  // delay(1000);
  pinMode(led, OUTPUT); //led build_in

  digitalWrite(led, HIGH);
  delay(200);
  digitalWrite(led, LOW);
  delay(200);
  digitalWrite(led, HIGH);
  delay(200);
  digitalWrite(led, LOW);
  delay(200);

  pinMode(relay, OUTPUT);
  pinMode(buzzer, OUTPUT);

  RemoteXY_Init ();

  digitalWrite(relay, HIGH); //BC237 N Type Mosfet pin23
}

void loop()
{
  RemoteXY_Handler ();
 
  analogVolts = (analogReadMilliVolts(32) * 21.0) / 1000.0; //divider +- 20 , 10k and 1k//1k
  dtostrf(analogVolts, 0, 1, RemoteXY.value_13);
  delay(1000);

  if (analogVolts < 5.7)
  {
    battLow = true;//reset on power reset ,, new test
  }

  if (battLow == true)
  {
    digitalWrite(relay, LOW);//BC237 P Type Mosfet pin 23
    digitalWrite(buzzer, HIGH);//pin 21
    delay(200);
    digitalWrite(buzzer, LOW);
    delay(200);
        
    digitalWrite(buzzer, HIGH);//pin 21
    delay(200);
    digitalWrite(buzzer, LOW);
    delay(200);


  }


  if (battLow == false)
  {
    totalSeconds ++;
    counter ++;//stop counter ,, does not write/update anymore
    dtostrf(totalSeconds, 0, 0, RemoteXY.value_14);//second "0" digit after point
  }


  if ((counter > _time) && (writeFlag1 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_01);
    writeFlag1 = true;
    counter = 0;
  }

  if ((counter > _time) && (writeFlag2 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_02);
    writeFlag2 = true;
    counter = 0;
  }

  if ((counter > _time) && (writeFlag3 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_03);
    writeFlag3 = true;
    counter = 0;
  }

  if ((counter > _time) && (writeFlag4 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_04);
    writeFlag4 = true;
    counter = 0;
  }

  if ((counter > _time) && (writeFlag5 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_05);
    writeFlag5 = true;
    counter = 0;
  }
  if ((counter > _time) && (writeFlag6 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_06);
    writeFlag6 = true;
    counter = 0;
  }
  if ((counter > _time) && (writeFlag7 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_07);
    writeFlag7 = true;
    counter = 0;
  }

  if ((counter > _time) && (writeFlag8 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_08);
    writeFlag8 = true;
    counter = 0;
  }

  if ((counter > _time) && (writeFlag9 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_09);
    writeFlag9 = true;
    counter = 0;
  }


  if ((counter > _time) && (writeFlag10 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_10);
    writeFlag10 = true;
    counter = 0;
  }
  if ((counter > _time) && (writeFlag11 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_11);
    writeFlag11 = true;
    counter = 0;
  }
  if ((counter > _time) && (writeFlag12 == false))
  {
    dtostrf(analogVolts, 0, 1, RemoteXY.value_12);
    writeFlag12 = true;
    counter = 0;
  }


}

I just saw that my ESP32 does not have the --DA.
This is my exact board , picture from suppliers site.

That is a DOIT ESP32 DevKit V1.

Please try the following platformio.ini and test-code:

platformio.ini

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

main.cpp

#include <Arduino.h>

void setup() {
    Serial.begin(115200);
    Serial.println("Hello World");
    pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
    Serial.println("LED ON");
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);
    Serial.println("LED OFF");
    digitalWrite(LED_BUILTIN, LOW);
    delay(1000);
}

Watch the LED and the Serial monitor.
Does it work for you?

Yes it does work.
Print.
LED ON
LED OFF

and the on board Led is flashing.

I used your .ini setup in my code but the Led is off and the Board does connect to my Phone.
I must use a lower Platform version for RemoteXY to work.

[env:esp32doit-devkit-v1]
;platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
platform = espressif32@6.4.0  ; 6.4.0 for Arduino espressif Core 2.0.11
lib_deps = remotexy/RemoteXY@^3.1.14

So the board and the led are working in general.

I don’t know the used library and what your code is supposed to do.

Yes it does work.

The code connects to my phone with RemoteXY app.
I got used to the blue Led always ON with Arduino ide.

I have way over the limit used this post since the original problem was solved.

I will create a new Topic for the rest of my problems.

Thanks a lot I learned a lot so far.