Plugin_153 MAX44009, anyone got it working ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Plugin_153 MAX44009, anyone got it working ?

#1 Post by costo » 23 Dec 2017, 17:19

I have a GY-49 module , it has a MAX44009 lux sensor. I found playground plugin_0153 and gave it a try.
So compiled ESPEasy 148 with plugin153. But the sensor does not show_up in the device list.
Did someone succesfully use this sensor in ESPEasy?

User avatar
grovkillen
Core team member
Posts: 3107
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Plugin_153 MAX44009, anyone got it working ?

#2 Post by grovkillen » 23 Dec 2017, 19:16

Please make sure that the plugin is not #def as testing or development.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Plugin_153 MAX44009, anyone got it working ?

#3 Post by costo » 23 Dec 2017, 21:36

@grovkillen
tnx for the suggestion.

I removed at beginning the line:
#ifdef PLUGIN_BUILD_TESTING
and on the end of plugin the line
#endif

Apparently the plugin was ignored at first, now I get some compile errors like:

Code: Select all

_P153_MAX44009.ino: In function 'boolean Plugin_153(byte, EventStruct*, String&)':
_P153_MAX44009:130: error: 'addFormSelector' was not declared in this scope
_P153_MAX44009:158: error: 'getFormItemInt' was not declared in this scope
I will see if I can fix the errors.

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Plugin_153 MAX44009, anyone got it working ?

#4 Post by costo » 26 Dec 2017, 14:35

Since a few days plugin 153 basically works for me in ESPEasy148.

To get rid of these 2 compile errors:
'addFormSelector' was not declared in this scope
'getFormItemInt' was not declared in this scope

I had to comment out these 6 lines

Code: Select all

In case PLUGIN_WEBFORM_LOAD
 addFormSelector(string, F("Mode"), F("plugin_153_mode"), 3, options, optionValues, choice_mode)
 addFormSelector(string, F("Current Division Ratio"), F("plugin_153_divide"), 2, options, optionValues, choice_division);
 addFormSelector(string, F("Integration Time"), F("plugin_153_time"), 8, options, optionValues, choice_time);

and in case PLUGIN_WEBFORM_SAVE:
 Settings.TaskDevicePluginConfig[event->TaskIndex][0] = getFormItemInt(F("plugin_153_mode"));
 Settings.TaskDevicePluginConfig[event->TaskIndex][1] = getFormItemInt(F("plugin_153_divide"));
 Settings.TaskDevicePluginConfig[event->TaskIndex][2] = getFormItemInt(F("plugin_153_time"));
wihout these lines the plugin basically works, gives me the lux value with 22bit definition, much better than a BH1750 sensor.
Apparently because I removed the 6 lines from the WEBFORM LOAD/SAVE part, the "Optional Settings" form in the device tab does not function anymore. I cannot use the "Formula Lux" because what is put there is not processed or saved.
Which is sad, because I would like to put there something like %value%^0.1 so that the values communicated to my RaspberryPi based Domoticz server are displayed logarithmic, just like the eye is logarithmic.

I am not used to programming with plugins, so I am not sure how to fix this.
Any clues would be appriciated a lot.

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

Re: Plugin_153 MAX44009, anyone got it working ?

#5 Post by TD-er » 28 Dec 2017, 11:40

Why stick to the build 148, when you can also use the 2.0 dev series, or even the Mega branch?

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Plugin_153 MAX44009, anyone got it working ?

#6 Post by costo » 30 Dec 2017, 00:29

TD-er wrote:
28 Dec 2017, 11:40
Why stick to the build 148, when you can also use the 2.0 dev series, or even the Mega branch?
I will try that asap.
Maybe the errors will disappear then.

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Plugin_153 MAX44009, anyone got it working ?

#7 Post by costo » 30 Dec 2017, 14:17

I tested the MAX44009 plugin in dev2.0 but ...
No difference, same 6 errors as with the old version 148.
There are some omissions somewhere in the sketch or the plugin. I think i must declare the string variables somewhere somehow.
I was hoping someone who has written a plugin before could see the solution and explain what needs to be changed/added.

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Plugin_153 MAX44009, anyone got it working ?

#8 Post by costo » 30 Dec 2017, 14:57

Tested dev 2.0 again with this MAX44009 plugin, but now with the latest sources from github, also latest libraries.

The compile errors disappeared :P

But . . . . . . . still cannot edit the formula field, everything entered there disappears after clicking "submit" , so it is not saved.

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Plugin_153 MAX44009, anyone got it working ?

#9 Post by costo » 30 Dec 2017, 19:34

Finally solved it.
The solution was in this post viewtopic.php?f=6&t=3689&p=20157&hilit=formula#p20157

The problem was not in the software nor in the plugin. It was the ESP8266 2.4.0.rc2 core.
When I used the 2.4.0.rc1 core I could save my optional settings agian. :P

Yeah, it took some time to find it out. :(

data
Normal user
Posts: 92
Joined: 10 Dec 2016, 11:26

Re: Plugin_153 MAX44009, anyone got it working ?

#10 Post by data » 30 Mar 2018, 19:15

Any idea, when Plugin #153 / support for MAX44009 will be added to the release?

danilodb
Normal user
Posts: 1
Joined: 07 Feb 2019, 12:46

Re: Plugin_153 MAX44009, anyone got it working ?

#11 Post by danilodb » 07 Feb 2019, 12:51

Hi everyone! Sorry to revamp an old thread, but this seems to be the only one concerning MAX44009 (plugin153).

I have updated firmware on my ESP8266 and found that this plugin is not yet there (ESPEasy Mega dev).

Has anybody any new about this? I can't find it in offcial plugin list and seems just to be vanished.

Thanks for any help.

Domosapiens
Normal user
Posts: 277
Joined: 06 Nov 2016, 13:45

Re: Plugin_153 MAX44009, anyone got it working ?

#12 Post by Domosapiens » 07 Feb 2019, 22:31

Is part of the playground
https://github.com/letscontrolit/ESPEas ... Playground
So you have to add it to your own compilation.

You could request to add it to the mega here:
https://github.com/letscontrolit/ESPEas ... +is%3Aopen
This will help: http://ko-fi.com/GrovkillenTDer
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests