logo elektroda
logo elektroda
X
logo elektroda

Exploring SP530E 5CH PWM+SPI LED Controller with OpenESP on ESP32-C3

divadiow 3861 14
ADVERTISEMENT
  • #1 21230102
    divadiow
    Level 34  
    Hi. So this is an SP530E 5CH PWM+SPI LED controller sold by BTF Lighting, and other generics, as model SP530E. I was going to play with WLED on it at some point, but now OpenESP is in development, that can be tested on it as well.
    Box of the SP530E series IoT LED controller. Side of a box with two QR codes labeled APP and Instructions. Box of SP530E LED controller with compatibility information. SP530E LED controller and user manual on a blue background. Bottom view of the SP530E LED controller board with visible pads and pin labels. SP530E LED controller with visible components on a printed circuit board. View of LED controller SP530E 5CH PWM+SPI on a blue background. LED controller SP530E with connected wires SP530E LED controller on a blue background with connected wires. SP530E LED controller with connected wires, top view
    The app QR is for the same BanlanX app seen in https://www.elektroda.com/rtvforum/topic4064640.html#21151364
    The device uses an ESP32-C3.

    With the pads on the back soldered up and IO9 pulled low esptool.exe commands can be run for some chip info:

    esptool.exe --port COM22 flash_id
    Code: Text
    Log in, to see the code


    esptool.exe --port COM22 get_security_info
    Code: Text
    Log in, to see the code


    After a bit of reading I turned off the security features with
    Code: Text
    Log in, to see the code


    So the security info is now
    Code: Text
    Log in, to see the code

    And I'm free to flash unencrypted binaries and they'll boot.

    Which means a bootable OpenESP32C3

    Code: Text
    Log in, to see the code


    Screenshot of OpenESP32C3 interface for ESP32-C3 device

    Most of what I've understood about this device is from the WLED Discord and mostly thanks to user triangulumsweetrolls.

    Code: Text
    Log in, to see the code


    Code: Text
    Log in, to see the code


    Code: Text
    Log in, to see the code


    That last comment about pin 19 is because pins 12-19 are not usable on WLED. You need to build a custom firmware to disable USB_CDC. See https://github.com/zalatnaicsongor/wled-compiler

    and regarding the user's custom WLED build:
    Code: Text
    Log in, to see the code


    Back to OpenESP. I've got the basic PCB LEDs on IO0/1 working of course, but no PWM led, at any frequency (assuming command 'pwm frequency xxxxx' is expected to work) and there's no OpenESP support yet for SPI.

    In the custom WLED binary I could only get dimly lit/barely working PWM LEDs but I did achieve working animations on 4m WS2812B strip using unlocked IO19.

    That's it really. It's not been the best device to test on.

    Added after 3 [minutes]:

    fac backup and partition table fwiw
  • ADVERTISEMENT
  • #2 21230139
    divadiow
    Level 34  
    Screenshot of a control panel interface with OpenESP32C3_4EDCD224 and buttons turned on for blue and green LEDs.

    Code: Text
    Log in, to see the code

    Close-up of an electronic circuit board with visible components and a lit LED.
  • #3 21231354
    p.kaczmarek2
    Moderator Smart Home
    That's interesting, I haven't seen yet 5 PWM + SPI LED device. I saw only either 5 PWM, or SPI RGB, or SPI RGB + 2 PWM CW. What is the purpose of 5 PWM + SPI LED device? How it works from app? Do they allow to control SPI LED strip and RGBCW strip independently?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 21231424
    divadiow
    Level 34  
    I don't think I see anything that says they can't be controlled independently.
  • #6 21231433
    p.kaczmarek2
    Moderator Smart Home
    OBK PixelAnim currently assumes that LED RGB mode is the same as per-pixel mode with single color so we will need some kind of clever check in code to handle situation from this topic. Maybe conditional statement to check if the number of set PWM pins is equal to 5.
    Helpful post? Buy me a coffee.
  • #7 21231545
    divadiow
    Level 34  
    I understand. OK. Something to consider when SPI is working I guess?
  • Helpful post
    #8 21231563
    p.kaczmarek2
    Moderator Smart Home
    Maybe I could try earlier in Simulator, depending on how big the demand is?
    Screenshot from OpenBeacon simulator showing a circuit on a grid.
    Screenshot of OpenDeck Simulator software showing a menu for adding electronic components.
    PS: I added a switch (bistable) and zoom features to Simulator yesterday.
    Helpful post? Buy me a coffee.
  • #9 21231567
    divadiow
    Level 34  
    p.kaczmarek2 wrote:
    depending on how big the demand is?

    I guess it's only me/this device so far and I don't have an immediate use in mind. It was unpackaged for ESP testing. Maybe new members will flock to the forums now ESP is in progress!

    Added after 7 [minutes]:

    re the reported 16khz factory PWM for this device specifically, is the command pwmfrequency ### expected to be effective on ESP at this stage?
  • ADVERTISEMENT
  • Helpful post
    #10 21231588
    p.kaczmarek2
    Moderator Smart Home
    It seems that LEDC is used for PWM:
    https://docs.espressif.com/projects/esp-idf/e...ble/esp32/api-reference/peripherals/ledc.html
    And there is a function for that:
    ledc_set_freq
    but I can't see it used here:
    https://github.com/openshwprojects/OpenBK7231...c888c1f11e6e/src/hal/espidf/hal_pins_espidf.c
    So probably @insmod still has to add it?

    Added after 49 [seconds]:


    Screenshot of ledc_set_freq function documentation with a list of parameters and return values.
    Helpful post? Buy me a coffee.
  • #11 21248382
    divadiow
    Level 34  
    No PWM joy with latest ESP build at any frequency tried.

    Perhaps interesting is this Discord comment regarding a custom build of WLED for this device

    Code: Text
    Log in, to see the code


    This device is a bit of an oddball I think. Just updating thread, rather than suggesting anything needs changing.

    Added after 49 [seconds]:

    is the bit level adjustable? does that even apply/make sense?
  • #12 21331970
    vo1xabrad
    Level 2  
    >>21230102 How do I reflash the original firmware? What are the esptool commands?

    Added after 24 [minutes]:

    >>21331970 I cannot get WLED to boot on my SP530E. Here's a copy of my terminal output:

    $ esptool.py -b 115200 write_flash 0x0 C3_bootloader.bin 0x8000 C3_partitions_4M.bin 0x10000 WLED_0.15.0-b7_ESP32C3_4MB.bin
    esptool.py v4.8.1
    Found 33 serial ports
    Serial port /dev/ttyUSB0
    Connecting...
    Detecting chip type... ESP32-C3
    Chip is ESP32-C3 (QFN32) (revision v0.4)
    Features: WiFi, BLE, Embedded Flash 4MB (XMC)
    Crystal is 40MHz
    MAC: f0:f5:bd:c4:c9:68
    Stub is already running. No upload is necessary.
    Configuring flash size...
    Flash will be erased from 0x00000000 to 0x00002fff...
    Flash will be erased from 0x00008000 to 0x00008fff...
    Flash will be erased from 0x00010000 to 0x00186fff...
    Compressed 12144 bytes to 8820...
    Wrote 12144 bytes (8820 compressed) at 0x00000000 in 1.0 seconds (effective 94.9 kbit/s)...
    Hash of data verified.
    Compressed 3072 bytes to 128...
    Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.1 seconds (effective 307.2 kbit/s)...
    Hash of data verified.
    Compressed 1532080 bytes to 940926...
    Wrote 1532080 bytes (940926 compressed) at 0x00010000 in 83.8 seconds (effective 146.3 kbit/s)...
    Hash of data verified.

    Leaving...
    Hard resetting via RTS pin...
    $

    I've been at this for hours now to no avail. PLEASE HELP!
  • #13 21332044
    divadiow
    Level 34  
    what is the current security info output?

    esptool.exe --port COM## get_security_info

    im not sure going back to factory is an option if you've already run these two commands to turn off the security features

    Code: Text
    Log in, to see the code


    Added after 9 [minutes]:

    also. to use WLED your best best is to use this custom build

    https://discord.com/channels/473448917040758787/719873873071308821/1258319577222484031
    https://github.com/zalatnaicsongor/wled-compiler/tree/main

    search SP530E on the WLED Discord for history on this
    https://discord.gg/WNTsyzN2
  • #14 21332556
    vo1xabrad
    Level 2  
    >>21332044 How do I determine if I have flashed the WLED firmware successfully? Currently, the blue and green LEDs on board only flash briefly while I attach the power cable. Nothing more than that.
  • #15 21333651
    divadiow
    Level 34  
    I'd expect the WLED starter AP to broadcast.

    What do the boot logs look like from UART TX after flashing custom WLED and powering up?

Topic summary

The discussion revolves around the SP530E 5CH PWM+SPI LED controller, primarily used with the OpenESP firmware on the ESP32-C3. Users express interest in the capabilities of the SP530E, particularly its ability to control both SPI LED strips and RGBCW strips independently. Questions arise regarding the functionality of the official app and the PWM frequency settings, with some users noting issues with PWM performance at various frequencies. The conversation also touches on the potential for using a simulator for testing and the need for code adjustments to accommodate the unique features of the SP530E. Additionally, there are mentions of a custom WLED build for the device and the challenges faced due to its specific characteristics.
Summary generated by the language model.
ADVERTISEMENT