Plugin choice customization

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
PandCall
Normal user
Posts: 44
Joined: 22 Sep 2022, 20:04

Plugin choice customization

#1 Post by PandCall » 06 Jul 2023, 22:57

Hi All,
I use climate_ESP32_4M316k, it works fine, no problem.
But I would like to be able to change some plugins to customize it (Visual Studio Code)
Add, Remove, Replace plugins to use.
Quickly, which file should I modify to suit my needs?
I assume that during the build, the variable corresponding to Climat should call up a list of plugins to be used in the compilation.
Can anyone tell me what to modify for this customization?
Regards

Update
probably this file, can you confirm?
src\src\CustomBuild\define_plugin_sets.h
After
// Collection of all climate plugins.
#ifdef PLUGIN_CLIMATE_COLLECTION

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Plugin choice customization

#2 Post by TD-er » 06 Jul 2023, 23:12

Nope, you better change just the tools/pio/pre_custom_esp32.py file.
Or just create a Custom.h file based on the included Custom-sample.h (just rename/copy that file to Custom.h)

This way you can keep this Custom.h file in your own archives to make it easier to recreate the same build setup in future builds.

PandCall
Normal user
Posts: 44
Joined: 22 Sep 2022, 20:04

Re: Plugin choice customization

#3 Post by PandCall » 06 Jul 2023, 23:39

Ok,
I'll explore the Custom-sample.h solution.
If I've understood correctly, this file allows you to impose this configuration and it's much simpler for future updates.

But for your information,
I've hard-coded it here

Code: Select all

// Collection of all climate plugins.
#ifdef PLUGIN_CLIMATE_COLLECTION
  #ifndef PLUGIN_DESCR
    #define PLUGIN_DESCR  "Climate"
  #endif

  // Features and plugins cherry picked from stable set
  #ifndef FEATURE_SERVO
    #define FEATURE_SERVO 1
  #endif
  #define FEATURE_RTTTL 1

  #define USES_P001   // Switch
  #define USES_P002   // ADC
  #define USES_P003   // Pulse
  #define USES_P004   // Dallas
  #define USES_P005   // DHT
  #define USES_P006   // BMP085
  #define USES_P007   // Custom Analog input - PCF8591
It works, once compiled and downloaded, the plugin appears in the possible choices.

But I understand that if I do an update from GITHUB, my modifications disappear, unlike the Custom-sample.h file which doesn't exist in GIT.

I'm going to explore these possibilities.
Regards

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Plugin choice customization

#4 Post by TD-er » 06 Jul 2023, 23:51

Yep, Custom.h (mind the capital C) is excluded from the Git repo, so it will be ignored by Git.

You can just copy/paste your defines to this Custom.h file (just copy the sample file, so you already have lots of things defined and it is easier to remove lines or comment them than typing them.

You can also add pre-defined WiFi credentials etc. in this Custom.h file.

PandCall
Normal user
Posts: 44
Joined: 22 Sep 2022, 20:04

Re: Plugin choice customization

#5 Post by PandCall » 07 Jul 2023, 07:43

Thanks a lot, I'm going to try my first Custom configuration.
But I am confident ;)

If I've understood the configuration correctly, the project to use is custom_xxxxx
For me
custom_ESP32_4M316k
for the Custom.h file to be supported.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Plugin choice customization

#6 Post by TD-er » 07 Jul 2023, 12:07

that's correct

PandCall
Normal user
Posts: 44
Joined: 22 Sep 2022, 20:04

Re: Plugin choice customization

#7 Post by PandCall » 10 Jul 2023, 10:35

My first tests were not very conclusive.
Problems declaring Wifi or activating the initial hotspot.
The Custom.h example file normally seems to activate the hotspot, but I can't see it in the available networks.
I have to keep looking.
Regards

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Plugin choice customization

#8 Post by Ath » 10 Jul 2023, 10:40

if you have access to the USB-serial log of the unit, you are able to see what's going on, including any error messages while setting up the WiFi.

NB: Do not connect an USB-serial connector to a board that is directly connected to mains power, or you might cause critically dangerous situations for both yourself and your computer.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Plugin choice customization

#9 Post by TD-er » 10 Jul 2023, 10:55

When still connected to the ESP's serial port (assuming you've taken Ton's advice about safety into account)
You can see the logs scrolling by.

N.B. when flashing using serial to an ESP32 node, you must upload the "factory" bin file to the ESP and not the one without "factory" in the name.

If the unit was flashed before with some build of ESPEasy and you kept the flash layout, it will still use the existing settings as you won't overwrite the file system with all settings.

Also keep in mind there are various platforms (e.g. ESP8266, ESP32, ESP32-S2, ESP32-S3, ESP32-C3) and you must flash the correct one to the board.

PandCall
Normal user
Posts: 44
Joined: 22 Sep 2022, 20:04

Re: Plugin choice customization

#10 Post by PandCall » 10 Jul 2023, 11:03

Yes, I always use the command
python -m esptool --chip esp32 erase_flash
before retesting to be sure to completely erase the configuration. :)

PandCall
Normal user
Posts: 44
Joined: 22 Sep 2022, 20:04

Re: Plugin choice customization

#11 Post by PandCall » 10 Jul 2023, 11:08

Today, it works
I entered the information directly in the Wifi settings to connect directly to the network.

#define DEFAULT_SSID "SSID" // Enter your network SSID
#define DEFAULT_KEY "PASSWORD" // Enter your network WPA key

He just wanted to have a nice weekend away from work :D


So I'll be able to continue making my Custom configuration.
Thanks again for your help.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Plugin choice customization

#12 Post by TD-er » 10 Jul 2023, 11:13

The ESP will consume maximum power when starting WiFi for scanning + starting the AP mode to let the user connect to the node.
So using less than optimal USB cables, or an unpowered USB hub, you may see these kinds of issues.
Also when using a separate board for flashing, you often see linear voltage regulators only capable of delivering 150 - 200 mA.

PandCall
Normal user
Posts: 44
Joined: 22 Sep 2022, 20:04

Re: Plugin choice customization

#13 Post by PandCall » 10 Jul 2023, 11:14

The configuration is taken into account

Wifi Ok
#define DEFAULT_NAME Ok
#define DEFAULT_PIN_I2C_SDA Ok
#define DEFAULT_PIN_I2C_SCL
Zero plugins defined

I'll now be able to refine my configuration and define only the plugins I need in my assembly, and then adapt the ESP I need (RAM / CPU).

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 35 guests