Alternative firmware for Arilux AL-LC03 for use with MQTT and Home Assistant (RGB light strip controller)

Absolutely yes! IR and RF control lines commented out, the ID line changed and the units flashed! Worked perfectly and first time. The LC01’s are running in parallel with the LC03s, with no differences in performance,

Thanks again for your time in producing and publishing the firmware @mertenats

1 Like

A couple of breakthroughs for me tonight.

  1. I got the firmware loaded without using crocodile clips or soldering! Thanks to a helpful post from the SmartThings forums I figured out that there are pads on the bottom to flash with. These provide a few benefits over the top pads:

    1. Instead of needing two FTDI’s you can just use the power supply included with the device and a single FTDI for TX/RX and GND only.
    2. You can accomplish the flashing without needing solder or crocodile clips!
    3. Makes it possible to put the board back into the original case for a clean look.

    Here’s a picture of what I’m talking about:

    Quoting from the ST forums:

    I find that holding the wires in place is rather easy if you have an extra set of hands available to plug things in and press keys on the keyboard. So these controllers you connect TX, RX and Ground to the pins shown below. With this all connected and the FTDI connected to your computer, then apply 12V power by plugging in the Arilux controller. After the initial flash, you can upgrade via OTA

  2. I figured out the OTA issues that people were having. When you initially flash the board you should use these settings which properly match the board capabilities. Thanks to @GaborBognar for the initial tips, it took a bit more playing to figure out exact settings. The key is to make sure your Flash Size is set to 1M (64K SPIFFS). You will need to flash once more while connected to the board if you previously flashed with a smaller flash size. After ensuring that I flashed with the correct flash size I was able to continually OTA upgrade without issues. Previously I was using the settings from the firmware README which led to failures because the flash size was incorrect.

I’m now making changes to the library to improve things, like configuration and adding MQTT last will and testaments. I hope to port some of the FastLED effects over to this firmware as well.

As for RGBW support, someone has already added support for both RGBW and RGBWW but they closed their pull request. I am using their fork and everything seems to be working quite well. Hoping to get their work merged in soon…

3 Likes

Hi Robbie,

Do I need to connect the ground of the FTDI to both ground pads or is just one of them sufficient?

Both pads required

1 Like

Of course. To enter flashing mode. I see that you already updated


:slight_smile:

Does anyone have a device with a remote and the original firmware still on it? Trying to implement the special remote functions but I don’t know or remember what the original effects looked like or did. Can someone record a video with all the effects?

Here’s the full list:

Infrared (IR) Remote functions:

  • Fade
  • Flash
  • Smooth
  • Strobe

Radio Frequency (RF) Remote functions:

  • Mode Minus
  • Mode Plus
  • Speed Minus
  • Speed Plus
  • Toggle

Let me know if I missed any too!

Thanks!

In other news, big features (effects, JSON, transition, flashing) and improvements coming down the pipe thanks to some work I did on MQTT Lights that will be out in Home Assistant 0.40. Check out the pull request here.

2 Likes

I am sure this is a simple issue. When I try to compile the firmware I get:

Arilux_AL-LC0X:61: error: 'StaticJsonBuffer' does not name a type
 StaticJsonBuffer<512> HOME_ASSISTANT_MQTT_DISCOVERY_CONFIG;
 ^
/home/adam/Downloads/Arilux_AL-LC0X/Arilux_AL-LC0X.ino: In function 'void callback(char*, byte*, unsigned int)':
Arilux_AL-LC0X:153: error: 'ARILUX_MQTT_WHITE_COMMAND_TOPIC' was not declared in this scope
   } else if (String(ARILUX_MQTT_WHITE_COMMAND_TOPIC).equals(p_topic)) {
                     ^
/home/adam/Downloads/Arilux_AL-LC0X/Arilux_AL-LC0X.ino: In function 'void handleCMD()':
Arilux_AL-LC0X:514: error: 'ARILUX_MQTT_WHITE_STATE_TOPIC' was not declared in this scope
       publishToMQTT(ARILUX_MQTT_WHITE_STATE_TOPIC, msgBuffer);
                     ^
exit status 1
'StaticJsonBuffer' does not name a type

What am I doing wrong?

I believe thats because you don’t have the ArduinoJSON library installed

I didnt have the library installed initially but then I installed it thought the library manager and I still seem to get the error.

I did see links to specific version of the dependencies at the top of the sketch so perhaps it requires a specific version?

I will double check when I get home later.

It shouldn’t require a specific version no.

I just realized this is my bad. Pushing a fix for this now.

Hi Again,

I am getting this error now:

Arduino: 1.8.1 (Linux), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (64K SPIFFS), ck, Disabled, None"

/home/kiwinol/Downloads/Arilux_AL-LC0X/Arilux_AL-LC0X.ino: In function 'void callback(char*, byte*, unsigned int)':
Arilux_AL-LC0X:161: error: 'ARILUX_MQTT_WHITE_COMMAND_TOPIC' was not declared in this scope
   } else if (String(ARILUX_MQTT_WHITE_COMMAND_TOPIC).equals(p_topic)) {
                     ^
/home/kiwinol/Downloads/Arilux_AL-LC0X/Arilux_AL-LC0X.ino: In function 'void handleCMD()':
Arilux_AL-LC0X:522: error: 'ARILUX_MQTT_WHITE_STATE_TOPIC' was not declared in this scope
       publishToMQTT(ARILUX_MQTT_WHITE_STATE_TOPIC, msgBuffer);
                     ^
exit status 1
'ARILUX_MQTT_WHITE_COMMAND_TOPIC' was not declared in this scope

Argh sorry about that. Won’t be home for a few hours. Once I am I can get that fixed.

Hi Robbie,

No worries. I will try again later :slight_smile:

Fixed and tested! Let me know if you are still having problems.

Big new version out! Adds support for mqtt_json and Home Assistant MQTT discovery for easy auto-configuration of your devices. Using JSON means that now we have effects, transition and flashing lights support, as well as less round trip requests required to update the light! Download and install now!!

1 Like

Down to one error :slight_smile:

Arduino: 1.8.1 (Linux), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (64K SPIFFS), ck, Disabled, None"

/home/kiwinol/Downloads/Arilux_AL-LC0X/Arilux_AL-LC0X.ino: In function 'void publishWhiteChange()':
Arilux_AL-LC0X:679: error: 'ARILUX_MQTT_WHITE_STATE_TOPIC' was not declared in this scope
     publishToMQTT(ARILUX_MQTT_WHITE_STATE_TOPIC, msgBuffer);
                   ^
exit status 1
'ARILUX_MQTT_WHITE_STATE_TOPIC' was not declared in this scope

Try this (don’t define the device in the top-section of the config:

// If you can't find your model above, you can use the defines below instead.
// #define RGB
#define RGBW
// #define RGBWW
// #define IR_REMOTE
// #define RF_REMOTE
#define DEVICE_MODEL                           "LC01"

That seems to have complied. Thanks :slight_smile: Now I just need to attempt the flash. I will get back to you on that (hopefully I dont fry my controller) I am going to attempt to do it without soldering

How do you get the device in flash mode using option 2 ? (the solderless method)

Unfortunately I might have the same question. My understanding is that you connect the TX RX and ground from the FTDI to their corresponding spots on the bottom of the board, but it doesnt seem to be working for me.

I have the brown and black wires connected to the ground on my FTDI. I then plug in the power to the controller and attempt to flash but get the following error:

Arduino: 1.8.1 (Linux), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 9600, 1M (64K SPIFFS), ck, Disabled, None"

Build options changed, rebuilding all
Sketch uses 251187 bytes (26%) of program storage space. Maximum is 958448 bytes.
Global variables use 34288 bytes (41%) of dynamic memory, leaving 47632 bytes for local variables. Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

which as far as I can find seems to mean its not in program mode.

see option 2 here for what I am trying to do
https://github.com/mertenats/Arilux_AL-LC0X