How to create new plugin/protocol?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bbking
Normal user
Posts: 3
Joined: 18 Nov 2016, 08:24

How to create new plugin/protocol?

#1 Post by bbking » 18 Nov 2016, 08:37

Hi guys,

I've found ESPEasy a few weeks ago and it's so great, I instantly got hooked on it! :)

Now, I was playing around with it and asked myself if I could extend it with a certain type of MQTT message protocol. I'd like to transfer the data over MQTT in a special JSON format. I have the source code of the stable 120 version. Copied _C005.ino to _C010.ino and made the changes to my certain expectations - all compiled well. But I am not sure if my changes were even considered by the compiler, as my new protocol doesn't show up on the config page. The max number of plugins was limited to 16 so I suppose the code will automaticall check _C001 up to _C016?

Code: Select all

#define CPLUGIN_MAX                        16 
Otherwise I haven't found any

Code: Select all

#include
statements and the google/forum search wans't very helpful either (too many search results). Can you please point me where to start/what do I miss?

Also, when I am using the

Code: Select all

#define FEATURE_TIME
, is there a way to get the date, like %sysdate% ?

Thanks a lot in advance!

Cheers

bbking
Normal user
Posts: 3
Joined: 18 Nov 2016, 08:24

Re: How to create new plugin/protocol?

#2 Post by bbking » 25 Nov 2016, 17:58

okay, I've found these two pages:
http://www.letscontrolit.com/wiki/index ... Guidelines
http://www.letscontrolit.com/wiki/index ... evelopment

but my questions still remain - can anybody give me a hint on this?
BTW, the plugin should enable the device to connect to public cloud systems like Azure/AWS/SAP HANA/Dr. Watson and so on...

User avatar
moelski
Normal user
Posts: 124
Joined: 31 Aug 2016, 06:33
Location: Germany - NRW
Contact:

Re: How to create new plugin/protocol?

#3 Post by moelski » 06 Dec 2016, 20:07

Hi !

I wrote a SD card logging plugin. And I used the given plugins as sample.
So take a look and give it a try. It´s not that complicated. 8-)

Have you any specific questions ?
regards
Dominik

dony71
Normal user
Posts: 16
Joined: 25 Apr 2018, 20:01

Re: How to create new plugin/protocol?

#4 Post by dony71 » 21 Sep 2018, 00:37

can share SD card logging plugin?

reinhold
Normal user
Posts: 15
Joined: 19 Jun 2017, 22:52
Location: Vienna, Austria
Contact:

Re: How to create new plugin/protocol?

#5 Post by reinhold » 21 Sep 2018, 12:55

I think, you need to add the new controller to the CONTROLLER_SET_* section in src/define_plugin_sets.h, otherwise the #ifdef USES_C0... will exclude your plugin from being compiles...
The compiler will automatically pick up all .ino files in the directory, but the #ifdef precompiler command might exclude your actual code from compliation.

This is how I made my Venta device plugin work like a charm: https://github.com/kainhofer/ESPEasy/co ... 709de0659d

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 19 guests