Ledcontroller H801 upgraded MQTT from Aliexpress

Forum about LEDS, LED lights, DMX and other lights.

Moderator: Mversluis

Ledcontroller H801 upgraded MQTT from Aliexpress

Postby vlast3k » Sun Apr 03, 2016 8:52 am

This post is about an upgrade to the popular H801 LED Strip Controller available for <10 eur from Aliexpress:
http://www.aliexpress.com/item/RGBWW-St ... ace2498d25

Together with Pieter (bwired) we did some modifications to the device and created a new firmware with the following features:

What has been added is:
1. Pre-Soldered USB-2-Serial adapter, to allow connection to the vThings Chrome Configuration App, to allow setting up Wifi, HTTP or MQTT connection
2. Ability to open an HTTP Web Server and allow controlling via HTTP Request
3. Ability to connect to an MQTT Server receive commands for LED Colors, and publish status updates
4. Ability for Over-The-Air update in case of new features or bugs

What has been removed:
- the original firmware that allows connection from an Android phone, opening a Wifi Hotspot and having some effects

If you are interested, in using this functionality you can:
- upgrade the module yourself: the firmware is open source and available freely here: https://github.com/vlast3k/vThingCO2 (i will put there some additional details on building ansd flashing later)
- send your device to me to upgrade it for you: price for the service is 10 eur and then 4-5 eur for shipping back
- or you can buy the device from me instead of aliexpress - in this case it costs 20 eur, and you get it within a week :) (but i have only 3-4 left and waiting for the new ones to arrive)

h801.jpg
h801.jpg (129.57 KiB) Viewed 12934 times
vlast3k
Starting Member
Starting Member
 
Posts: 31
Joined: January 2016

Re: Upgraded H801 Led Strip Controller from Aliexpress

Postby Bwired » Sun Apr 03, 2016 5:04 pm

This works perfectly at the moment.
With this controller you can connect 5 ledstrips or 1 rgb and 2 white.
Via http or mqtt you can control every ledstrip channel indipendly.

What is also a very nice feature is that you have a full status report via MQTT,
for example if you set the values via http or mqtt, after the values are set the status is broadcast back to the MQTT server.
So a cheap led controller with status is great! :)
Also asking for status can be done and it will broadcast the status every 2 mins.

We are still making small changes but it looks like this:
Ask for status of controller 1: client.publish('command/led/1', 'status');

status:
{"red":20,"green":1,"blue":2,"w1":30,"w2":10,"ver":"v1.11.1"}

set the desired values:
client.publish('command/led/4/Color', '20;1;2'); // set rgb (0 to 100%)
client.publish('command/led/4/W1', '30');
client.publish('command/led/4/W2', '10');

http command to set values:
http://10.0.0.123/?color=10;0;5&sw2=0&sw1=0
User avatar
Bwired
Administrator
Administrator
 
Posts: 5307
Joined: March 2006
Location: Netherlands

Re: Ledcontroller H801 upgraded from Aliexpress

Postby raymonvdm » Mon Apr 04, 2016 9:11 am

I think i just need to test one of these :-)
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1147
Joined: December 2011

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby AshaiRey » Tue Apr 05, 2016 9:54 am

Ordered 2 also to see what this is all about.
If it is what i think it will do then i will be happy. :)
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1301
Joined: February 2009
Location: Netherlands

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby raymonvdm » Tue Apr 05, 2016 9:51 pm

In the past i purchased an ESPLight. Is it also possible to attach it to my MQTT broker ?

http://esplight.fridgefire.nl/doku.php

I`m currently controlling it using netcat

Code: Select all
echo "?pin=5678&effect=0&brightness=99&var0=216&var1=247&var2=255" | nc -u -4 -q1 192.168.110.62 1337
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1147
Joined: December 2011

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby AshaiRey » Sun Apr 24, 2016 12:38 pm

Can you explain what to do to update the firmware yourself.?
I've added terminals for the jumper and the serial cable already but what next?
I probaly need a serial-to-usb converter. Any advice on that one?
Is there any thing to consider when setting up the Arduino IDE for programming?

I want to run this to be controlled via HTTP not via MTTQ

In the INO i see some settings to be filled in
Would these settings be the correct one
PubSubClient *h801_mqttClient = server;
IPAddress IPAddress(0,0,0,0); // my ip address to use instead of 0,0,0,0
boolean h801led = false;
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1301
Joined: February 2009
Location: Netherlands

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby r_255 » Sun Apr 24, 2016 2:48 pm

You could use espeasy and a ftdi serial converter ( just make sure you use a 3.3v version )
I still had one laying from the jeenode workshop ( al these 3.3v sensors and stuff work fine on the esp with out level conversion )

http://www.esp8266.nu/forum/viewtopic.php?t=626

i got that one running on my desk...

Flashing is quite simple....
http://www.esp8266.nu/index.php/ESPEasy#Get_started

Like you mention you did add the pinheaders and jumper pins. Add the jumper only when you are flashing...
I guess you did setup the arduino ide and did install the esp8266 files thru the boardmanager ?


well then you should be set to compile.

Download espeasy
https://github.com/ESP8266nu

open the espeasy and make sure you got it stuffed in the right folder

Open up easpeasy.ino and add your own wifi credentials and endpoint ( ha server )
compile & flash it...

Open up the terminal window in arduino ide and type reset ...
( device should reset and reboot )

Now scan your network for a espresif device to get the ip..
Now login to the webserver on the esp by typing the ip in your browser and you are ready to go...

oh and you dont have to set much or set a device

Gpio if i am right are :

redPIN 15
greenPIN 13
bluePIN 12

w1PIN 14
w2PIN 4


Controlling goes like this :

PWM control
To set a certain PWM level:
http://<ESP IP address>/control?cmd=PWM,<pin>,<level>

Our you could try to use the milight emulation... the only thing you need to do to get that working is donwload the rgbw plugin and add that to the folder before you compile
_P105_RGBW.ino is the plugin name and can be found here... ( look in the plugin playground )

https://github.com/ESP8266nu

Why espeasy ? Because its very tweakable..... one guy over there uses the 5th white pwm channel as ir out !
or swap out the serial pins for a lux sensor or what is your need... as firmware updates ota work fine here.

Have fun! :D
r_255
Advanced Member
Advanced Member
 
Posts: 621
Joined: June 2008
Location: Netherlands

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby vlast3k » Sun Apr 24, 2016 4:01 pm

AshaiRey wrote:Can you explain what to do to update the firmware yourself.?
I've added terminals for the jumper and the serial cable already but what next?
I probaly need a serial-to-usb converter. Any advice on that one?
Is there any thing to consider when setting up the Arduino IDE for programming?

I want to run this to be controlled via HTTP not via MTTQ

In the INO i see some settings to be filled in
Would these settings be the correct one
PubSubClient *h801_mqttClient = server;
IPAddress IPAddress(0,0,0,0); // my ip address to use instead of 0,0,0,0
boolean h801led = false;

Apart what r_255 said, keep in mind that some batches (at least mine) had a problem that the RX and TX pins are wrongly named, so you should make sure to connect RX to RX and TX to TX
For usb2serial converter any one should be fine

If you are going to use my code - nothing specific is necessary. If you do not configure MQTT in the Chrome utility - only the web server will be started
just - before building it you need to modify

You can flash the latest working binary directly using:
C:\develop\arduino-1.6.7\hardware\esp8266com\esp8266/tools/esptool/esptool.exe -vv -cd nodemcu -cb 256000 -cp COM15 -ca 0x00000 -cf h801_binary.bin
And download the binary from here
http://anker-bg.com/vlast3k/h801/latest.bin

(you need to have installed the ESP8266 tools of course)

Building it from scrarch - i still haven't had time to write detailed instructions, but basically
edit :
https://github.com/vlast3k/vThingCO2/bl ... ingCO2.ino
and in the beginning include
#define VTHING_H801_LED
and remove
#define VTHING_STARTER
#define SAP_AUTH

I use the same FW on all devices and each uses different features.

Also whatever firmware you build for the H801 make sure to select the board Generic ESP8266 Board , and then Flash Size: 1M (128mb spiffs)

And all libraries i use are here:
https://github.com/vlast3k/Arduino-libraries

if you do not plan to configure it via the Chrome App and Usb2serial converter - then it is better to use the ESPEasy as r255 proposed as it is more versatile
vlast3k
Starting Member
Starting Member
 
Posts: 31
Joined: January 2016

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby AshaiRey » Sun Apr 24, 2016 6:45 pm

Thx for the detailed answers.
Some of it are still abracadabra for me but when i see it will ring a bell for me i am sure.

I'll keep you updated.
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1301
Joined: February 2009
Location: Netherlands

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby raymonvdm » Tue Apr 26, 2016 10:58 am

I just found this one, and made some pics for reference

Image
Image


I just added the pin headers for the programming, but the most difficult part is to get the Arduino IDE running. I just installed it and added the following link for board managers

http://arduino.esp8266.com/stable/packa ... index.json

But i cannot figure out yet how to program the board. I think i have all the parts necessary but i still get the following errors

Code: Select all

Arduino: 1.6.8 (Windows 7), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (128K SPIFFS), ck, Disabled, All"

sketch\H801.ino.cpp.o: In function `printVersion()':

C:\Users\Raymon\Documents\Arduino\H801/H801.ino:240: undefined reference to `handleWifi()'

C:\Users\Raymon\Documents\Arduino\H801/H801.ino:240: undefined reference to `processUserInput()'

sketch\H801.ino.cpp.o: In function `activeWait()':

C:\Users\Raymon\Documents\Arduino\H801/H801.ino:240: undefined reference to `handleWifi()'

sketch\H801.ino.cpp.o: In function `operator<< <char const*>':

C:\Users\Raymon\Documents\Arduino\libraries\Streaming/Streaming.h:34: undefined reference to `processUserInput()'

sketch\H801.ino.cpp.o:(.text.setup+0x18): undefined reference to `h801_setup()'

sketch\H801.ino.cpp.o: In function `setup':

C:\Users\Raymon\Documents\Arduino\H801/H801.ino:251: undefined reference to `h801_setup()'

sketch\H801.ino.cpp.o: In function `operator<<':

C:\Users\Raymon\Documents\Arduino\libraries\Streaming/Streaming.h:103: undefined reference to `handleOTA()'

C:\Users\Raymon\Documents\Arduino\libraries\Streaming/Streaming.h:103: undefined reference to `h801_loop()'

sketch\H801.ino.cpp.o: In function `operator<< <const __FlashStringHelper*>':

C:\Users\Raymon\Documents\Arduino\libraries\Streaming/Streaming.h:34: undefined reference to `handleWifi()'

sketch\H801.ino.cpp.o: In function `operator<<':

C:\Users\Raymon\Documents\Arduino\libraries\Streaming/Streaming.h:103: undefined reference to `handleOTA()'

sketch\H801.ino.cpp.o: In function `loop':

C:\Users\Raymon\Documents\Arduino\H801/H801.ino:298: undefined reference to `processUserInput()'

C:\Users\Raymon\Documents\Arduino\H801/H801.ino:328: undefined reference to `h801_loop()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Generic ESP8266 Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.







Note: i just found out that my COIL (101) is broken off, i glued it back to gether as the wires are okay but it makes a little more noice :cry:
Note2: I just purchased on of these as they seem to be needed for the ESP8266 http://www.phonestore.nl/p303679/ftdi-f ... duino.html
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1147
Joined: December 2011

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby AshaiRey » Fri Apr 29, 2016 9:14 am

As said i keep you updated.
Since i don't have a FTDI controller it tried to program the module with an Arduino. In my case i used a Freeduino board and i removed the MCU so the onboard FTDI controller would talk directly to the H801. Sadly i didn't succeed.
I also realized that i forgot to order a LED strip to control so i made a ne order at AliExpress for a LED strip and a FTDI controller
I based my order on the parts mentioned here eryk.io/2015/10/esp8266-based-wifi-rgb- ... ller-h801/
Bram
AshaiRey
Senior Member
Senior Member
 
Posts: 1301
Joined: February 2009
Location: Netherlands

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby raymonvdm » Fri Apr 29, 2016 11:02 am

AshaiRey wrote:As said i keep you updated.
Since i don't have a FTDI controller it tried to program the module with an Arduino. In my case i used a Freeduino board and i removed the MCU so the onboard FTDI controller would talk directly to the H801. Sadly i didn't succeed.
I also realized that i forgot to order a LED strip to control so i made a ne order at AliExpress for a LED strip and a FTDI controller
I based my order on the parts mentioned here eryk.io/2015/10/esp8266-based-wifi-rgb- ... ller-h801/



I have an ESPlight with an cable to program it, but the cable is not working on the H801 (It works on the ESPlight however) https://tkkrlab.nl/wiki/EspLight I also tried another cable i bought for my AXA REMOTE but also to no avail
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1147
Joined: December 2011

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby r_255 » Fri Apr 29, 2016 12:36 pm

Well i am using the FTDI converter that came with the jeenode workshop years ago. ( not sure if you where contender )
Make sure it does 3.3v!

I had loads of fun with it already and flashed many alternative firmwares on many devices.
So its a good investment.

Just make sure you also place the jumper ( 2 pins next to the pinheader ) before you (power on) boot (in flash mode) , else the esp wont accept any firmware at all.
r_255
Advanced Member
Advanced Member
 
Posts: 621
Joined: June 2008
Location: Netherlands

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby raymonvdm » Fri Apr 29, 2016 1:42 pm

Using this interface i just got the example op eryk.io working. But i cannot build the vlast3k .ino yet
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1147
Joined: December 2011

Re: Ledcontroller H801 upgraded MQTT from Aliexpress

Postby vlast3k » Fri Apr 29, 2016 3:08 pm

raymonvdm wrote:Using this interface i just got the example op eryk.io working. But i cannot build the vlast3k .ino yet

aahh sorry....
we have now easter and I will have finally time to add a description how to build :)
vlast3k
Starting Member
Starting Member
 
Posts: 31
Joined: January 2016

Next

Return to LEDS, DMX & Lights Forum

Who is online

Users browsing this forum: No registered users and 1 guest