Adding the "Pimatic RestApi" to the Mega 2.x build/source

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Adding the "Pimatic RestApi" to the Mega 2.x build/source

#1 Post by hvdwolf » 25 Jan 2020, 20:22

Hi,

After being helped with my question about curl/http, I was "advised" to upgrade to one of the latest versions.
So I downloaded the 20190225 version, which is supposed to be the stable version (If I'm correct), and I git downloaded the mega branch.
As I am using Pimatic as domotica system, I also wanted the _C022 plugin from the EspEasyPluginPlayground repository.

I first tried the with the stable build 20190225, but there are big structural differences between the git repo and that Feb 2019 version, so I switched to the Git mega branch version.

Unfortunately I lack the skills/talent to upgrade the _C022 plugin to the current Git EspEasy version (I'm not a C/C++ programmer)

I added the C022 to the define_plugin_sets.h
I added code to Scheduler.ino, src/ControllerQueue/DelayQueueElements.h, src/DataStructs/SchedulerTimers.h
But this is all copy&paste from existing controller plugins, as I actually do not understand the entire structure.

I forked EspEasy and you can find my incorrect changes at https://github.com/hvdwolf/ESPEasy in 2 commits (I could not make platformio work on Linux so I had to move to Windows and on Windows "git add" works differently).

Can someone give me some hints?
(and of course: if someone can completely repair/fix/build it for me, I would even be more happy ;) )

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: Adding the "Pimatic RestApi" to the Mega 2.x build/source

#2 Post by hvdwolf » 26 Jan 2020, 17:11

I redid the whole stuff and now it compiles without errors. That doesn't mean it works. Unfortunately I can only test in one of the coming days.

I case anyone wants to check my code, please have a look at my forked repo: https://github.com/hvdwolf/ESPEasy

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

Re: Adding the "Pimatic RestApi" to the Mega 2.x build/source

#3 Post by TD-er » 26 Jan 2020, 23:20

You can also make a pull request for it, that is more guaranteed to get feedback (from me), as I am not visiting the forum very regularly.

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: Adding the "Pimatic RestApi" to the Mega 2.x build/source

#4 Post by hvdwolf » 27 Jan 2020, 07:44

If (and if) it works, I will certainly make a pull request.
But I was not able to test it yet, so it is a bit too early.

SwissResl
New user
Posts: 2
Joined: 22 Jan 2020, 11:06

Re: Adding the "Pimatic RestApi" to the Mega 2.x build/source

#5 Post by SwissResl » 27 Jan 2020, 14:21

Cool, looking forward to this!

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: Adding the "Pimatic RestApi" to the Mega 2.x build/source

#6 Post by hvdwolf » 29 Jan 2020, 14:28

I am not succesful so far and I have no idea how to continue.

When I flash my compiled version with the Pimatic RestApi, it flashes correct and starts correct.
I can configure it the way I like with devices and controllers and all and reboot it and everything works fine.
As soon as I configure and enable the Pimatic RestApi and reboot, the esp8266 never comes up. It is not pingable or whatever.
Somehow upon boot, the pimatic plugin stops the booting and makes the esp8266 hang even before network is enabled.

So I updated 2 of my nodemcus V2.0 (Amica) and configured both on the "Home Assistant (openHAB) MQTT" controller with the 20191208 build. I (re)installed mosquitto on my RPi3B+ and installed the MQTT plugin in pimatic.
That combo works fine.
(So far I do not seem to be able to flash my 0.9 nodemcus with the ESP.Easy.Flasher.exe, but that will be another topic if I can't fix it)

I am not a C/C++ programmer (more into python and java) so my attempts with the pimatic restapi plugin are really blind trial&error attempts.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 49 guests