Compile ESPeasy with plugin, searching for dummies manual how to do

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hoeby
Normal user
Posts: 33
Joined: 19 Sep 2018, 21:03

Compile ESPeasy with plugin, searching for dummies manual how to do

#1 Post by hoeby » 17 Sep 2021, 17:59

Sorry, but i am a dummy.

I want plugin 144 added to ESPeasy.
But the tutorials with atom and platformIO are to difficult for me :oops:

I am looking for a dummy tutorial.
Just with step by step and prefer with images.
The tutorials from ESPeasy, looks like to are prefered you have some knowledge about the used programs, but i don't have.

Used platformIO, but got errors.
The same with IDE, also errors, but they are different from th platformIO.

Love to compile it, but it it getting frustrated that i can't get it done.

Is there somewhere a step by step instruction for dummies?

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

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#2 Post by Ath » 17 Sep 2021, 19:02

There have been several unconnected posts, and a short youtube movie by TD-er, together forming a sort of How To, aimed at the 'somewhat less than ignorent' user, and that could be you ;) , but it has never been compiled (pun intended :lol:) into a one-pager to get one up and running. I'll see if I can gather all that stuff and put it on Read The Docs, for general use. (And try to avoid repeating what's been written a few times before.)
/Ton (PayPal.me)

hoeby
Normal user
Posts: 33
Joined: 19 Sep 2018, 21:03

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#3 Post by hoeby » 17 Sep 2021, 19:55

i am hoping to get the solution, with your information.

Tried IDE, opened espeasy.ino (after changing src to ESPEASY).
After opening i did compile, without modifying things.

Went to platformIO, did the same. Than i can compile.
But then i am lost in plaformIO. Found multi manuals about it, but non looks to be up-to-date with the last version.
Did multiple steps to get it work, but unfortunally didn't find the big price. Or an error, of the plugin is not compiled.

I am not saying the information is not there. The problem is how to find it.

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

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#4 Post by Ath » 17 Sep 2021, 20:42

I will not guide you on Arduino IDE, IMHO, it is outdated and awkward to work with.

I have started writing a guide, as documentation for you and others, to get ready and start working on development with ESPEasy, all based on PlatformIO.

PlatformIO doesn't need you to rename the src directory into ESPEasy, in fact, I expect it to not even work as intended. (I never did that rename)
The essence with PlatformIO is that you select the big PlatformIO button on the left, so you see a list of configured environments, expand the one you need (for development I usually use 'custom_ESP8266_4M1M'), and after some initialization has completed, hit the Build item.
/Ton (PayPal.me)

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

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#5 Post by Ath » 17 Sep 2021, 20:43

If you need a quick build, including P144, I can build it for you, assuming it will compile without much hassle ;)
/Ton (PayPal.me)

hoeby
Normal user
Posts: 33
Joined: 19 Sep 2018, 21:03

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#6 Post by hoeby » 18 Sep 2021, 09:13

I got it compiled with p144 in it, but if i did it how it is supposed, i don't know.

Opened in platformIO.
Added the .ino in the plugin folder
Added the rc-switch library in library folder
Compiled normal_esp8266_4m1m and it was done.

The .ino hasn't the line #ifdef uses p144
Could this because it is made for an old espeasy version?

Connected the espeasy to wifi and tested the plugin with an event url. The plugin does it job. But looks like espeasy is responding slow on the event. Have to look at it why. I have some other devices with an old espeasy version, looks like they are responding faster.

@Ath (Ton)
If i didn't compile it, how it has to be done and this could give problems. Is it possible that you make a compile with P144?

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

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#7 Post by Ath » 18 Sep 2021, 10:36

hoeby wrote: 18 Sep 2021, 09:13 I got it compiled with p144 in it, but if i did it how it is supposed, i don't know.
Yay! Great achievement!
hoeby wrote: 18 Sep 2021, 09:13 Opened in platformIO.
Added the .ino in the plugin folder
Added the rc-switch library in library folder
Compiled normal_esp8266_4m1m and it was done.
That's fine for now, I'll explain below.
hoeby wrote: 18 Sep 2021, 09:13 The .ino hasn't the line #ifdef uses p144
Could this because it is made for an old espeasy version?
The different environments in the PlatformIO list enable specific sets of plugins, controllers and other options/features, as defined in 'define_plugin_sets.h' but this file shouldn't usually be messed with, unless you add a new plugin. (Selecting the best environment can be tricky, as especially the 'test' builds are already quite crammed, and these add to the 'normal' environments, so adding it there could also cause issues with .bin sizes being too large)
As there is no conditional compilation in this P144 .ino file, it will now be compiled into all environments, as all files with .ino extension are added to ESPEasy.ino at compiletime and then compiled. So the only way to disable a plugin is to not enable it to start with :) and that is where such '#ifdef USES_P144' comes in (it has an accompanying '#endif' too, of course).
For a Custom build, there are 2 ways to create a configuration, A) copy Custom-sample.h to Custom.h (with the uppercase C), and enable/disable all settings, plugins, controllers etc. there, and build one of the 'custom' environments, as the PlatformIO scripting recognizes that file, or B) modify the 'pre_custom_ESP82xx.py' (For ESP8266 and ESP8285 custom builds) or 'pre_custom_ESP32.py' for the ESP32 custom builds. This last option requires to use the Python syntax, but the examples are quite clear.
hoeby wrote: 18 Sep 2021, 09:13 Connected the espeasy to wifi and tested the plugin with an event url. The plugin does it job. But looks like espeasy is responding slow on the event. Have to look at it why. I have some other devices with an old espeasy version, looks like they are responding faster.
I haven't looked closely at the code of the plugin, but a quick glance does not yet trigger any red flags, regarding performance, as it doesn't use the 'high frequency' plugin events, that are good candidates for causing sluggish performance.
The rest of the source isn't very up to date with the latest ESPEasy compiler macro's available, but that doesn't make it work bad or slow.
hoeby wrote: 18 Sep 2021, 09:13 @Ath (Ton)
If i didn't compile it, how it has to be done and this could give problems. Is it possible that you make a compile with P144?
You did a fine job already, so far, so no need for me to create a build for you :D
/Ton (PayPal.me)

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

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#8 Post by Ath » 18 Sep 2021, 11:21

Had a look at that rc-switch library, and it does look quite alright (though the used coding style looks a bit strange to me in some places). Only 'issue' it could have, but that's required for it to work, is that it uses quite some delays (in the microsecond range) between sending out the bits.

Also, I don't think the Receive function of the library will work nicely with ESPEasy, but that doesn't seem to be implemented in the plugin, so not to worry about that (yet) ;)
Adding a line with #define RCSwitchDisableReceiving just before the #include <RCSwitch.h> line would even leave out that code completely, reducing the .bin footprint somewhat.

There is one point in the plugin that won't work as intended, and that is the check for "F" (Line 145) to use the sendTriState() function. But in lines 128 and 186 the command/value pair is extracted using parseString(), that will return a lowercase result, so the check will never be true. A solution could be to replace parseString() by parseStringKeepCase(), as the command part is already converted to uppercase, and most values will be numeric anyway.
/Ton (PayPal.me)

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

Re: Compile ESPeasy with plugin, searching for dummies manual how to do

#9 Post by Ath » 18 Sep 2021, 23:42

A first installment of the How To is now a PR in the ESPEasy repository, it can be previewed from a PDF I created from Firefox and uploaded in the PR #3784
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests