Page 3 of 3

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 03 Jun 2017, 09:00
by luisfcosta
Sorry guys, trying to include plugin 105_rgbw into the lates R2.0 dev10, but my arduino IDE keeps throwing error after error (cannot find file, library, etc)
Is there a more straightforward way than rearranging my .ino's and .h's + .cpp's?

Trying to get my h801 flashed with ESPEasy and the correct plugin (105_rgbw?)
Can connect it with TTL and even upload ESPeasy v2.0 (bin file), but board irresponsive to port commands (WifiSSID, ...).

Any .bin already out there with the plugin?

Thanks for your hints!

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 03:47
by xbmcnut
Hey there,

Could someone give me a hint on how to add _P105_RGBW.ino for H801 to Platformio so I can compile? New to Platformio so any assistance would be appreciated.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 08:21
by vojtishek
xbmcnut wrote: 12 Jun 2017, 03:47 Hey there,

Could someone give me a hint on how to add _P105_RGBW.ino for H801 to Platformio so I can compile? New to Platformio so any assistance would be appreciated.
Hi,
I'm using Espeasy r147 http://www.letscontrolit.com/downloads/ ... 47_RC8.zip.
Then you need to copy P105_RGBW.ino into following folder "ESPEasy_R147_RC8\Source\ESPEasy", then compile and flash.

You will select RGBw Milight as a device in ESPeasy and set following parameters, rgbw milight udp port 8899 red pin 15 green pin 13 blue pin 12 white pin 14.
Then add following in Domoticz, If you are using domoticz
Image


Let me know if succesfull, otherwise I can send you better detail as I'm not currently at home.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 11:59
by xbmcnut
vojtishek wrote: 12 Jun 2017, 08:21
Then you need to copy P105_RGBW.ino into following folder "ESPEasy_R147_RC8\Source\ESPEasy", then compile and flash.
@vojtishek. Thank you so much!! Easier than I thought and quite obvious when I think about it. :idea: I'm using Home Assistant so will be controlling the device using MQTT. So this 105 plugin basically emulates a MiLight bridge?

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 12:09
by xbmcnut
vojtishek wrote: 12 Jun 2017, 08:21 Then you need to copy P105_RGBW.ino into following folder "ESPEasy_R147_RC8\Source\ESPEasy", then compile and flash.
Whoops. Get these errors when trying to compile now. Do I need to define the plugin somewhere?

Code: Select all

Compiling .pioenvs\normal_4096\FrameworkArduino\Updater.o
C:/Users/peters/OneDrive/Home Automation/ESPEasy/ESPEasy_v2.0.0-dev10/Source/src/_P105_RGBW.ino: In function 'boolean Plugin_105(byte, EventStruct*, String&)':
C:/Users/peters/OneDrive/Home Automation/ESPEasy/ESPEasy_v2.0.0-dev10/Source/src/_P105_RGBW.ino:273:36: error: 'Plugin_105_FadingTimer' was not declared in this scope

{
^
C:/Users/peters/OneDrive/Home Automation/ESPEasy/ESPEasy_v2.0.0-dev10/Source/src/_P105_RGBW.ino:331:29: error: 'Plugin_105_ProcessUDP' was not declared in this scope
if (Plugin_105_Pins[PinIndex].CurrentLevel <= Plugin_105_Pins[PinIndex].FadingTargetLevel && Plugin_105_Pins[PinIndex].FadingDirection < 0)
^
C:/Users/peters/OneDrive/Home Automation/ESPEasy/ESPEasy_v2.0.0-dev10/Source/src/_P105_RGBW.ino: In function 'void Plugin_105_ProcessUDP()':
C:/Users/peters/OneDrive/Home Automation/ESPEasy/ESPEasy_v2.0.0-dev10/Source/src/_P105_RGBW.ino:849:109: error: 'Plugin_105_HSL2Rgb' was not declared in this scope
Compiling .pioenvs\normal_4096\FrameworkArduino\WMath.o
Compiling .pioenvs\normal_4096\FrameworkArduino\WString.o
*** [.pioenvs\normal_4096\src\ESPEasy.ino.o] Error 1
 [ERROR] Took 5.11 seconds

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 12:13
by xbmcnut
Hmmm. Do I need to be using older builds?

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 13:28
by vojtishek
xbmcnut wrote: 12 Jun 2017, 12:13 Hmmm. Do I need to be using older builds?
Ah, I didn't try v2.0.0-dev10 so I can't sat if it's functionable or not. Try to compile it for RC147. This one worked for me.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 13:31
by vojtishek
Did you download whole master zip from https://github.com/ESP8266nu/ESPEasyPluginPlayground and extract only _P105_RGBW.ino?

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 12 Jun 2017, 23:58
by xbmcnut
vojtishek wrote: 12 Jun 2017, 13:31 Did you download whole master zip from https://github.com/ESP8266nu/ESPEasyPluginPlayground and extract only _P105_RGBW.ino?
I downloaded the RAW data for the plugin and created a file in Notepad++. Will that not work?

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 13 Jun 2017, 00:08
by xbmcnut
Downloaded plugin zip from GitHub and extracted P105 to ESPEasy_v2.0.0-dev10\Source\src. Same error.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 13 Jun 2017, 03:56
by vojtishek
Just mention that, because I've downloaded by save as just the plugin from github and that doesnt work. There is need to download whole master zip and extract just the plugin from it and copy into release folder ESPEasy
Try another release

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 17 Sep 2017, 23:20
by Blacky's Boss
Tonight I Flashed my H801, ESPEasy 2.0.0-dev-11, Arduino 1.8.4, Milight RGBW plugin (P105).

All seems to work, but the colors are wrong.... Because I have a cheap strip with seperate colored led's, it's simple to see...

If I set the color to &h 00ff00, Green is full on. Correct.
If I set the color to &h 0000ff, Blue is full on. Correct.
If I set the color to &h ff00ff, both Red and Blue are on. Correct
If I set the color to &h ff0000, Red is on, but also Green...
[edit]Forgot to mention this is all in Domoticz
Oh, and setting an orange color makes it go green
Something tells me the calculations are off, but am I the only one?[/edit]

Why? :shock:

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 19 Sep 2017, 10:13
by pearson
Blacky's Boss wrote: 17 Sep 2017, 23:20 Tonight I Flashed my H801, ESPEasy 2.0.0-dev-11, Arduino 1.8.4, Milight RGBW plugin (P105).
How did you manage to get ESPEasy 2.0.0-dev-11 to compile with P105? Several of us here are getting "was not declared in this scope" errors when building with it.

(I'd normally think that a header file was missing, but I'm new to Atom and .ino files and I'm a bit mystified at the lack of header files. :) )

Edit: I got it to build by moving those methods to the top of the _P105_RGBW.ino file, but that's obviously a hack. If someone could explain what simple thing I must be missing here, I'd really appreciate it.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 19 Sep 2017, 12:36
by Blacky's Boss
These are the steps I took:
- Downloaded from github: https://github.com/letscontrolit/ESPEas ... -dev11.zip
- extracted to a folder ESPEasy_v2.0.0-dev11
- renamed the folder src to ESPEasy
- renamed the folder lib to libraries
- deleted all the other crap
- set the sketchfolder in the Arduino IDE to the ESPEasy_v2.0.0-dev11
- Restarted the IDE
- Ignore the message from the IDE that there are updates for some of your librairies!!!!!
- opened sketch ESPEasy and compiled!

Oh, and offcourse I downloaded the pLugins and dragged the P105 in the ESPEasy folder.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 24 Sep 2017, 09:27
by Blacky's Boss
So, no one?

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 26 Sep 2017, 11:45
by HAMFAM
hi Blackys Boss

i am just starting a home automation system (Espeasy + sonoff + yeelight + ledstrips + Domoticz) and i just about got a working ledstrip RGB and getting weird results

ESPEasy v 2.0.0-dev11
arduino v 1.8.4 windows
_P105_RGBW
H801

compiled the plugin and downloaded to the H801 (using 256k spiff) and setup the H801
Milight as a device in ESPeasy, rgbw milight udp port 8899 red pin 15 green pin 13 blue pin 12 white pin 14.

using jason - http://192.168.x.x/control?cmd=pwm,12,1024 (blue) http://192.168.x.x/control?cmd=pwm,13,1024 (green) http://192.168.x.x/control?cmd=pwm,15,1024 (red) so that is working right

but i still have a problem with Domoticz, the ledstrip flashes the colour but then always turns white (0 to 100%) regardless of the target colour on the RGB Dimmer

Can you help me?

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 26 Sep 2017, 19:05
by Blacky's Boss
I wish I could... I seem to have the same setup, but mine sort of works, except for the wrong colours, offcourse...

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 28 Sep 2017, 06:26
by pearson
Blacky's Boss wrote: 19 Sep 2017, 12:36 These are the steps I took:
- Downloaded from github: https://github.com/letscontrolit/ESPEas ... -dev11.zip
- extracted to a folder ESPEasy_v2.0.0-dev11
- renamed the folder src to ESPEasy
- renamed the folder lib to libraries
- deleted all the other crap
- set the sketchfolder in the Arduino IDE to the ESPEasy_v2.0.0-dev11
- Restarted the IDE
- Ignore the message from the IDE that there are updates for some of your librairies!!!!!
- opened sketch ESPEasy and compiled!

Oh, and offcourse I downloaded the pLugins and dragged the P105 in the ESPEasy folder.
Thank you very much! I was so focused on the PlatformIO / Atom business that I wasn't using the Arduino IDE.

Oddly, I had to change my flash mode for the one I'm trying with ESPEasy. The first one I flashed had an ESP-12S, but the next two (from the same order) have a mystery unshielded (ie. no metal box covering it) ESP unit. The chip is ESP8266, but it has a PN25F08B flash that others in these forums have noted requires the DOUT flash method.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 29 Oct 2017, 14:14
by elmicha
pearson wrote: 19 Sep 2017, 10:13 Edit: I got it to build by moving those methods to the top of the _P105_RGBW.ino file, but that's obviously a hack. If someone could explain what simple thing I must be missing here, I'd really appreciate it.
It also works if we just declare these functions before the Plugin_105() function:

Code: Select all

void Plugin_105_FadingTimer();
void Plugin_105_ProcessUDP();
void Plugin_105_HSL2Rgb(float h, float s, float l);
I guess the Arduino IDE automatically extracts the function declarations and prepends them, so the compiler is happy. But Platformio doesn't do this.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 24 Aug 2018, 21:51
by rpa
Can anybody upload this compiled firmware to.... Google drive and share it.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 10 Sep 2018, 12:04
by coolduke
hi,

which is the best plugin for H801?

P141 or P142?

I want to use H801 with MQTT and openhab.

H801 connected to RGB Strip and 2 separate white led strips.

thx!

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 19 Apr 2020, 00:25
by tparvais
Hello

I up this post for some fresh feedback

I use Milight with its remote control to pilot some ledstrip RGB.

Is there still plugin for Espeasy to control it ? (by using UDP gateway) or directly via another element such as the one just on the post above ? can we load espeasy FW on it ?

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 30 Nov 2020, 18:55
by tparvais
Hello

is this plugin usable with Milight Wifi gateway in UDP ?

if yes, +I cannot get compilation properly.

I tried to compile this Plugin 105: RGBW / Milight with last master build from github and platformio without any success: many compilation errors

Platformio/projects/ESPEasy-mega-20201102/src/_P105_RGBW.ino:267:31: error: 'SENSOR_TYPE_DIMMER' was not declared in this scope
Device[deviceCount].VType = SENSOR_TYPE_DIMMER;
^
Platformio/projects/ESPEasy-mega-20201102/src/_P105_RGBW.ino:298:20: error: 'WebServer' was not declared in this scope
String plugin1 = WebServer.arg("plugin_105_port");

...

it seems this plugin is not aligned with last builds and new structure as types are not defined, etc...

Any idea to solve it simply ?

Thomas

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 30 Nov 2020, 19:17
by TD-er
WebServer
Change into: web_server


Device[deviceCount].VType = SENSOR_TYPE_DIMMER;
Change into: Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_DIMMER;

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 02 Dec 2020, 17:44
by tparvais
Thanks, I progress. Now next error:

/src/_P105_RGBW.ino:432:34: error: invalid initialization of non-const reference of type 'String&' from an rvalue of type 'char*'
if (GetArgv(command, TmpStr1, 2)) Par[1] = str2int(TmpStr1);

same for these lines

if (GetArgv(command, TmpStr1, 2)) Par[1] = str2int(TmpStr1);
if (GetArgv(command, TmpStr1, 3)) Par[2] = str2int(TmpStr1);
if (GetArgv(command, TmpStr1, 4)) Par[3] = str2int(TmpStr1);
if (GetArgv(command, TmpStr1, 5)) Par[4] = str2int(TmpStr1);
if (GetArgv(command, TmpStr1, 6)) Par[5] = str2int(TmpStr1);
if (GetArgv(command, TmpStr1, 7)) Par[6] = str2int(TmpStr1);
if (GetArgv(command, TmpStr1, 8)) Par[7] = str2int(TmpStr1);

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 02 Dec 2020, 19:14
by TD-er
if (GetArgv(command, TmpStr1, 2)) Par[1] = str2int(TmpStr1);

Can be done in 2 ways:

if (GetArgv(command, TmpStr1, 2)) Par[1] = str2int(TmpStr1.c_str());

or

if (GetArgv(command, TmpStr1, 2)) Par[1] = TmpStr1.toInt());

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 03 Dec 2020, 10:09
by tparvais
hello

thankl you

I tried both , but still the same issue

/src/_P105_RGBW.ino:432:34: error: invalid initialization of non-const reference of type 'String&' from an rvalue of type 'char*'
if (GetArgv(command, TmpStr1, 2)) Par[1] = TmpStr1.toInt();
^


it seems that the problem is in the GetArgv

thank you

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 03 Dec 2020, 10:59
by TD-er
Maybe command is of type String here?

Code: Select all

if (GetArgv(command.c_str(), TmpStr1, 2)) Par[1] = TmpStr1.toInt();

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 03 Dec 2020, 11:24
by tparvais
more context:

i tried with first if then , but no results. I think indeed some mismatch in types

case PLUGIN_WRITE:
{
int Par[8];
char command[80];
command[0] = 0;
char TmpStr1[80];
TmpStr1[0] = 0;

string.toCharArray(command, 80);
Par[1] = 0;
Par[2] = 0;
Par[3] = 0;
Par[4] = 0;
Par[5] = 0;
Par[6] = 0;
Par[7] = 0;

String tmpString = string;
int argIndex = tmpString.indexOf(',');
if (argIndex) tmpString = tmpString.substring(0, argIndex);

if (GetArgv(command.c_str(), TmpStr1, 2)) Par[1] = TmpStr1.toInt();
if (GetArgv(command, TmpStr1, 3)) Par[2] = str2int(TmpStr1.c_str());
if (GetArgv(command, TmpStr1, 4)) Par[3] = str2int(TmpStr1.c_str());
if (GetArgv(command, TmpStr1, 5)) Par[4] = str2int(TmpStr1.c_str());

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 03 Dec 2020, 11:39
by Ath
tparvais wrote: 03 Dec 2020, 11:24

Code: Select all

		if (GetArgv(command.c_str(), TmpStr1, 2)) Par[1] = TmpStr1.toInt();
		if (GetArgv(command, TmpStr1, 3)) Par[2] = str2int(TmpStr1.c_str());
		if (GetArgv(command, TmpStr1, 4)) Par[3] = str2int(TmpStr1.c_str());
		if (GetArgv(command, TmpStr1, 5)) Par[4] = str2int(TmpStr1.c_str());
Have you updated all those GetArgv calls? If not then I'd expect more compiler errors...

And for code reduction and readability you might want to consider to replace the 8 calls into a for loop using only 1 GetArgv() call:

Code: Select all

		for (uint8_t arg = 0; arg < 8; arg++) {
			if (GetArgv(command.c_str(), TmpStr1, arg + 1)) Par[arg] = TmpStr1.toInt();
		}
(Air code, not at my dev computer atm.)

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 03 Dec 2020, 14:56
by tparvais
Hello

I tried with code optim

Code: Select all

	case PLUGIN_WRITE:
	{
		int Par[8];
		char command[80];
		command[0] = 0;
		char TmpStr1[80];
		TmpStr1[0] = 0;

		string.toCharArray(command, 80);
		Par[1] = 0;
		Par[2] = 0;
		Par[3] = 0;
		Par[4] = 0;
		Par[5] = 0;
		Par[6] = 0;
		Par[7] = 0;

		String tmpString = string;
		int argIndex = tmpString.indexOf(',');
		if (argIndex) tmpString = tmpString.substring(0, argIndex);
/*
		if (GetArgv(command.c_str(), TmpStr1, 2)) Par[1] = TmpStr1.toInt();
		if (GetArgv(command.c_str(), TmpStr1, 3)) Par[2] = TmpStr1.toInt();
		if (GetArgv(command.c_str(), TmpStr1, 4)) Par[3] = TmpStr1.toInt();
		if (GetArgv(command.c_str(), TmpStr1, 5)) Par[4] = TmpStr1.toInt();
		if (GetArgv(command.c_str(), TmpStr1, 6)) Par[5] = TmpStr1.toInt();
		if (GetArgv(command.c_str(), TmpStr1, 7)) Par[6] = TmpStr1.toInt();
		if (GetArgv(command.c_str(), TmpStr1, 8)) Par[7] = TmpStr1.toInt();
*/
// Code optim
		for (uint8_t arg = 1; arg < 8; arg++) {
			if (GetArgv(command.c_str(), TmpStr1, arg + 1)) Par[arg] = TmpStr1.toInt();
		}
till two issues in bold:

C:/Users/tparvais/Documents/Platformio/projects/ESPEasy-mega-20201102/src/_P105_RGBW.ino: In function 'boolean Plugin_105(byte, EventStruct*, String&)':
C:/Users/tparvais/Documents/Platformio/projects/ESPEasy-mega-20201102/src/_P105_RGBW.ino:442:24: error: request for member 'c_str' in 'command', which is of non-class type 'char [80]'
if (GetArgv(command.c_str(), TmpStr1, arg + 1)) Par[arg] = TmpStr1.toInt();

C:/Users/tparvais/Documents/Platformio/projects/ESPEasy-mega-20201102/src/_P105_RGBW.ino:442:71: error: request for member 'toInt' in 'TmpStr1', which is of non-class type 'char [80]'
if (GetArgv(command.c_str(), TmpStr1, arg + 1)) Par[arg] = TmpStr1.toInt();

probably because TempString1 & Command are char and not string

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 07 Dec 2020, 09:07
by tparvais
hello

any news ? not familiar wit this code...

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 07 Dec 2020, 09:13
by TD-er
I will have a look at the Playground code for this plugin later today.

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 08 Dec 2020, 09:46
by TD-er
I fixed the compile issues and updated the playground code.
https://github.com/letscontrolit/ESPEas ... 5_RGBW.ino
Have not tested it at all.

Since it now uses this check:

Code: Select all

#ifdef USES_P105
Make sure to define that in your build configuration.
Either in src/src/CustomBuild/define_plugin_sets.h or in your Custom.h

Re: H801 : RGB controller based on ESP8266 avalaible from China

Posted: 17 Dec 2020, 20:34
by tparvais
Thank you TD-ER, it's compiling.

This plugin does not what I was expecting (control Milight via UDP protocol). he's working with an external radio emitter 2.4G, maybe I'll give a try

Thomas