SamZorSec / Arilux_AL-LC0X

Alternative firmware for Arilux AL-LC0X LED controllers, based on the MQTT protocol and a TLS connection
MIT License
190 stars 33 forks source link

ESP8285 #32

Open HydrelioxGitHub opened 7 years ago

HydrelioxGitHub commented 7 years ago

I've ordered a AL-LC03 on bang good. After opening it and trying to identify which pin I've to connect to flash firmware, I've noticed that the wifi chip is not a 8266 but a 8285.

Is there a way to flash a firmware with mqtt feature ?

SamZorSec commented 7 years ago

Hi @HydrelioxGitHub, In the Arduino IDE, try to use Tools > Boards > Generic ESP8285 Module or change Tools > Flash Mode to DOUT instead of DIO.

Sam

tablatronix commented 6 years ago

I just got one too, wow this M2 module is tiny!

Let me know how it works out, gonna start soldering programming onto mine soon.

SamZorSec commented 6 years ago

I got mine today!. I'll take some time before the end of the week to investigate this.

HydrelioxGitHub commented 6 years ago

Thanks, do not have so much time to do some test. (And not enough skilled probably). I'm waiting for your experience feedback.

PeeVv commented 6 years ago

I also received a couple of the new version of the LC01 with the 8285, and seems to have bricked two of them already :/ One doesn't respond at all, one gets extremely hot after plugging it in. The ones that still work have a really nasty coil whine, so this board is definitely not an upgrade.

This seems to be the correct pinout: #define ARILUX_RED_PIN 5 #define ARILUX_GREEN_PIN 13 #define ARILUX_BLUE_PIN 12

The LC01 now misses the transistor for the White channel, so it is unfortunately not usable for RGBW.

Other than that, it seems to work, but you need to use the connections on the chip itself since it does not have any connectors on the board, like so.

tablatronix commented 6 years ago

Boo i guess it be easy to reflow another mosfet etc. Looks like ir could be populated or used as an extra gpio maybe. Did you test the board first or just flash stock library, if the gpios are different you could have shorted.

I would flash a gpio input test and check all the states and check resistances to rails for all gpios first.

Or just probe the heck out of it while running the shipped firmware

HydrelioxGitHub commented 6 years ago

Any news @mertenats ?

SamZorSec commented 6 years ago

@HydrelioxGitHub, I've had some problems soldering cables to my board and it isn't recognised by my computer yet. I'll investigate this probably this weekend.

Sam

Philje123 commented 6 years ago

I just bought a new Magichome RGB controller. Already had one running this firmware.

It's the newer version with an ESP8285 board labeled V2.2.

I connected the cables direct to the board and flashed this firmware using the amended RGB pin numbers above and changing to generic ESP8285 in Arduino.

Everything is working great!

HydrelioxGitHub commented 6 years ago

@Philje124, can you provide some pictures or video of your work (pinout) ?

Philje123 commented 6 years ago

Hi. Do you mean the connections for flashing or connections to the LEDs?

HydrelioxGitHub commented 6 years ago

For flashing mainly, but if you have both, I'm curious...

Philje123 commented 6 years ago

For flashing I just connected the RX, TX, GND and GPIO0 as here (but obviously directly to the ESP board) https://i.imgur.com/HK225yf.jpg

Then the LED strip is just connected to the RGB connector on the board but modified the code to:

define ARILUX_RED_PIN 5

define ARILUX_GREEN_PIN 13

define ARILUX_BLUE_PIN 12

HydrelioxGitHub commented 6 years ago

Thanks you, I think it will be useful for my future experiments. And I hope useful for everyone else.

powerwade commented 6 years ago

Sorry for the dumb question but how did you connect to the RX/TX legs of the ESP board ? Did you solder a thin cable or you have some tool for connecting to those small legs during firmware upload? Unfortunately I received a v2.2 board recently also, and I miss the Rx/Tx pinouts on the Arilux board itself but not sure if I want to solder a cable directly to that small ESP board - I might destroy it :)

Philje123 commented 6 years ago

Yes I soldered directly to the ESP board. The connection points are pretty small and I'm not the neatest solderer in the world but it got the job done:

MagicHome ESP8285 connections https://imgur.com/gallery/HZF63

HydrelioxGitHub commented 6 years ago

@powerade I'm in the same case (arilux + newbie solderer) If you try and succed/fail , can you please give a feedback ?

powerwade commented 6 years ago

@HydrelioxGitHub I managed to upload the firmware on serial and now OTA works as well. Soldering wasn't that hard, but I had to figure out that I need to put some soldering iron to ESP legs first then solder the temporary wires to it. https://imgur.com/a/GWvfH Although when I atttach my 5V strip to it my device (new LC01 with 2.2v board) goes into a reboot loop. In the console I see it connects to wifi then to mqtt, subscribing to topics and publish it's state as ON. Then the LED strip blinks in blue (what color should it blink after reboot?) and it starts over with a reboot. If I detachj the LED strip then the reboot loop ends and the device stay online with no issue. I suspect something is wrong with the PINs?

I used these PINs as mentioned before

define ARILUX_RED_PIN 5

define ARILUX_GREEN_PIN 13

define ARILUX_BLUE_PIN 12

Any idea what's wrong here?

Philje123 commented 6 years ago

What settings did you flash with? Did you change it to "Generic ESP8285 module"?

powerwade commented 6 years ago

I tried in Arduino IDE and PlatformIO as well. I'm using generic ESP8285 libs. As mentioned earlier the code compilation and upload was succesfull, the device connects to wifi and mqtt.

HydrelioxGitHub commented 6 years ago

I've tried to compile the firmware for my Al-LC03 with the ESP8685 board and the arduino ide send me an error :

Arduino : 1.8.5 (Windows 10), Carte : "Generic ESP8285 Module, 80 MHz, 115200, 1M (512K SPIFFS)"

Arilux_AL-LC0X:80: error: 'IRrecv' does not name a type

 IRrecv            irRecv(ARILUX_IR_PIN);

 ^

C:\Users\Plop\Documents\Arduino\Arilux_AL-LC0X-master\Arilux_AL-LC0X\Arilux_AL-LC0X.ino: In function 'void handleIRRemote()':

Arilux_AL-LC0X:588: error: 'decode_results' was not declared in this scope

   decode_results  results;

   ^

Arilux_AL-LC0X:588: error: expected ';' before 'results'

   decode_results  results;

                   ^

Arilux_AL-LC0X:590: error: 'irRecv' was not declared in this scope

   if (irRecv.decode(&results)) {

       ^

Arilux_AL-LC0X:590: error: 'results' was not declared in this scope

   if (irRecv.decode(&results)) {

                      ^

C:\Users\Plop\Documents\Arduino\Arilux_AL-LC0X-master\Arilux_AL-LC0X\Arilux_AL-LC0X.ino: In function 'void setup()':

Arilux_AL-LC0X:906: error: 'irRecv' was not declared in this scope

   irRecv.enableIRIn();

   ^

exit status 1
'IRrecv' does not name a type

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.

What am I missing ?

Edit : compiling is fine if I comment #define IR_REMOTE

HydrelioxGitHub commented 6 years ago

I've used this closed issue #25 to solve the problem ...

rizkypr commented 6 years ago

Solved: i swap the Green and the Blue and now it works the pins are correct it just need to be swap.

define ARILUX_RED_PIN 5

define ARILUX_GREEN_PIN 12

define ARILUX_BLUE_PIN 13

Work nicely in discovery mode with home assistant.

I used this pin config as described above but the blue becomes green the red is correct and the green is off (probably wrong pin) any tips on how to find the correct io pin?

define ARILUX_RED_PIN 5

define ARILUX_GREEN_PIN 13

define ARILUX_BLUE_PIN 12