[App] libSambilight E/F/H (MST-only)

Here are software that related with Samsung F series TVs.
Please don't create any new topic here unless you have software to post/release.

kisspach
Posts: 11
Joined: Sun Nov 13, 2022 1:51 am

Re: [App] libSambilight E/F/H (MST-only)

Post by kisspach »

hello everyone and congratulations on this project.
I am wondering if it is possible to make a change.
I have Hyperion installed on a raspberry pi and as an image grabber, I usually use the app https://github.com/abrenoch/hyperion-android-grabber on android-based systems. Through this app, it is possible to connect to the Hyperion server on raspberry via the LAN network.
Just enter the number of LEDs, the IP address and the port and everything are automatically recognized.
is it possible to do the same without using Arduino or serial connection and keeping the capture system? @tasshack
kisspach
Posts: 11
Joined: Sun Nov 13, 2022 1:51 am

Re: [App] libSambilight E/F/H (MST-only)

Post by kisspach »

Hi everyone! i am trying to make this app work, but there is something that is not very clear to me.
I have a tv ue40es6560 and the leds I own are ws2801.
I connected a usb-serial adapter and from the log it is detected as:

Code: Select all

usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbserial_generic 3-1.4:1.0: usb_probe_interface
usbserial_generic 3-1.4:1.0: usb_probe_interface - got id
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbserial mod ld
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
ftdi_sio mod ld
how should i connect the usb-serial adapter to the led strip?

i put /mnt/opt/privateer/usr/libso/libSambilight.so
i launched samyGOso -A -B -l /mnt/opt/privateer/usr/libso/libSambilight.so and the log says:

Code: Select all

[Sambilight] Could not find serial port! Retries 0
[Sambilight] Could not find serial port! Retries 1
[Sambilight] Could not find serial port! Retries 2
[Sambilight] Sambilight ended
[Sambilight] lib_deinit
fromul
SamyGO Project Donor
Posts: 47
Joined: Sat Feb 01, 2020 11:07 am
Location: Czech Republic

Re: [App] libSambilight E/F/H (MST-only)

Post by fromul »

kisspach wrote: Wed Nov 16, 2022 8:07 pm Hi everyone! i am trying to make this app work, but there is something that is not very clear to me.
I have a tv ue40es6560 and the leds I own are ws2801.
I connected a usb-serial adapter and from the log it is detected as:

Code: Select all

usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbserial_generic 3-1.4:1.0: usb_probe_interface
usbserial_generic 3-1.4:1.0: usb_probe_interface - got id
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbserial mod ld
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
ftdi_sio mod ld
how should i connect the usb-serial adapter to the led strip?

i put /mnt/opt/privateer/usr/libso/libSambilight.so
i launched samyGOso -A -B -l /mnt/opt/privateer/usr/libso/libSambilight.so and the log says:

Code: Select all

[Sambilight] Could not find serial port! Retries 0
[Sambilight] Could not find serial port! Retries 1
[Sambilight] Could not find serial port! Retries 2
[Sambilight] Sambilight ended
[Sambilight] lib_deinit
use first post from @tasshack ...and from FTDI usb connector to USB connector in TV
ws.jpg
You do not have the required permissions to view the files attached to this post.
UE46H7000 T-MST14DEUC 2130.0 rooted, OSCam r11704, Sambilight preparation in progress
kisspach
Posts: 11
Joined: Sun Nov 13, 2022 1:51 am

Re: [App] libSambilight E/F/H (MST-only)

Post by kisspach »

fromul wrote: Thu Nov 17, 2022 2:20 pm use first post from @tasshack ...and from FTDI usb connector to USB connector in TV
ws.jpg
I use the w2801 led strips which have 4 pins: 5v, CK, SI, GND. So the link you suggest to me is not possible to do this.
Also in the first post, it is specified that the use of Arduino or ESP8266 NodeMCU is recommended for F / H versions, mine is an E version.
But even if I wanted to use them, in the log file, when I try to run sambilight it tells me that it does not detect the serial port, while in the dmesg it is detected.
There are several online guides where you can directly connect RX to the CK pin and TX to the SI pin of the led strip. I don't know if it is possible in this case too.
Immagine 2022-11-17 152108.png
You do not have the required permissions to view the files attached to this post.
fromul
SamyGO Project Donor
Posts: 47
Joined: Sat Feb 01, 2020 11:07 am
Location: Czech Republic

Re: [App] libSambilight E/F/H (MST-only)

Post by fromul »

kisspach wrote: Thu Nov 17, 2022 3:34 pm
fromul wrote: Thu Nov 17, 2022 2:20 pm use first post from @tasshack ...and from FTDI usb connector to USB connector in TV
ws.jpg
I use the w2801 led strips which have 4 pins: 5v, CK, SI, GND. So the link you suggest to me is not possible to do this.
Also in the first post, it is specified that the use of Arduino or ESP8266 NodeMCU is recommended for F / H versions, mine is an E version.
But even if I wanted to use them, in the log file, when I try to run sambilight it tells me that it does not detect the serial port, while in the dmesg it is detected.
There are several online guides where you can directly connect RX to the CK pin and TX to the SI pin of the led strip. I don't know if it is possible in this case too.

Immagine 2022-11-17 152108.png
1) 4pin LED stripes have only clock pin additionally
2) ESP8266 NodeMCU is ok for E series
3) maybe try other piece of FTDI adapter, on my old E series my FTDI adapter was 100% function.
4) i don´t know, but you need get rx and tx from FTDI to Arduino, i mean if you will use directly conneciton from FTDI to LED, it will doe´s not working...don´t know, maybe yes
...try this schema:
You do not have the required permissions to view the files attached to this post.
UE46H7000 T-MST14DEUC 2130.0 rooted, OSCam r11704, Sambilight preparation in progress
kisspach
Posts: 11
Joined: Sun Nov 13, 2022 1:51 am

Re: [App] libSambilight E/F/H (MST-only)

Post by kisspach »

ok, thank you very much for the advice!
I tried with another adapter but the result doesn't seem to change. The first one I tried is prolific pl2303, usually, these give problems. The second is a generic one, but it doesn't seem to change anything!

Code: Select all

[Sambilight] SamyGO E/F/H libSambilight v1.3.1 - (c) tasshack 2019 - 2022
[Sambilight] _Z23SdDisplay_CaptureScreenP8SdSize_tPhP23SdDisplay_CaptureInfo_t [0xf3810c].
[Sambilight] dlsym '_Z23SdDisplay_CaptureScreenP8SdSize_tPhP23SdDisplay_CaptureInfo_t12SdMainChip_k' failed.
[Sambilight] dlsym '_Z23SdDisplay_CaptureScreenP8SdSize_tPhP24SdVideoCommonFrameData_tP8SdRect_t12SdMainChip_k' failed.
[Sambilight] _Znwj [0xf3efe4].
[Sambilight] _ZN4SCGCC2El [0x1c3f800].
[Sambilight] _ZN8SCBaseGC6CreateEv [0x1c4b738].
[Sambilight] _ZN4SCGC7DestroyEv [0x1c3f5c4].
[Sambilight] _ZN4SCGCD2Ev [0x1c3f854].
[Sambilight] _ZN4SCGC5ClearEPN6Shadow9BasicType4RectE [0x1c401ec].
[Sambilight] _ZN8SCBaseGC5FlushEPN6Shadow9BasicType4RectE [0x1c4ae4c].
[Sambilight] _ZN4SCGC8FillRectEN6Shadow5ColorEllll [0x1c4a720].
[Sambilight] _ZN4SCGC8DrawTextEllPtl [0x1c3be74].
[Sambilight] _ZN4SCGC11SetFontSizeEl [0x1c3c4d4].
[Sambilight] _ZN4SCGC7SetFontEP6SCFont [0x1c3b2d4].
[Sambilight] _ZN4SCGC12SetFontStyleEl [0x1c3ac84].
[Sambilight] _ZN4SCGC10SetFgColorEN6Shadow5ColorE [0x3835c24].
[Sambilight] _ZN14CUSBAppResUtil14GetDefaultFontEv [0x256bc00].
[Sambilight] g_IPanel [0x42039738].
[Sambilight] dlsym 'g_TaskManager' failed.
[Sambilight] g_pTaskManager [0x72fc354].
[Sambilight] g_TVViewerMgr [0x73073b8].
[Sambilight] dlsym 'g_pTVViewerMgr' failed.
[Sambilight] g_TVViewerWStringEng [0x7198e28].
[Sambilight] dlsym 'g_WarningWStringEng' failed.
[Sambilight] dlsym 'g_pCustomTextResMgr' failed.
[Sambilight] dlsym 'g_CustomTextWStringEng' failed.
[Sambilight] _ZN16CResourceManager10GetWStringEi [0x150d7fc].
[Sambilight] _ZN9PCWString7ConvertEPtPKciiPi [0xf40d88].
[Sambilight] _ZN12CTaskManager14GetApplicationE15DTV_APPLICATION [0x150f164].
[Sambilight] _ZN10CViewerApp16GetViewerManagerEv [0x197fa38].
[Sambilight] dlsym '_ZN10ALMOND030015CDesktopManager11GetInstanceENS_13EDesktopIndexE' failed.
[Sambilight] dlsym '_ZN10ALMOND030015CDesktopManager14GetApplicationEPKcS2_' failed.
[Sambilight] _ZN14CViewerManager15ShowSystemAlertEii [0x19c8364].
[Sambilight] dlsym '_ZN14CViewerManager15ShowSystemAlertEi' failed.
[Sambilight] _ZN14CViewerManager14ShowCustomTextEi [0x19c5284].
[Sambilight] dlsym '_ZN14CViewerManager14ShowCustomTextEib' failed.
[Sambilight] dlsym '_ZN14CViewerManager10ShowRCModeEi' failed.
[Sambilight] dlsym '_ZN14CCustomTextApp13t_OnActivatedEPKci' failed.
[Sambilight] MsOS_PA2KSEG0 [0x41ee145c].
[Sambilight] MsOS_PA2KSEG1 [0x41ee144c].
[Sambilight] MsOS_Dcache_Flush [0x41ee148c].
[Sambilight] MApi_MMAP_GetInfo [0x41db9b24].
[Sambilight] MApi_XC_W2BYTEMSK [0x41ee494c].
[Sambilight] gfx_InitNonGAPlane [0x41dcc1a8].
[Sambilight] gfx_ReleasePlane [0x41dd361c].
[Sambilight] gfx_CaptureFrame [0x41dc789c].
[Sambilight] gfx_CaptureFrame [0x41dc789c].
[Sambilight] gfx_BitBltScale [0x41dcdf2c].
[Sambilight] MApi_GOP_DWIN_CaptureOneFrame [0x41e02398].
[Sambilight] MApi_GOP_DWIN_GetWinProperty [0x41e01b24].
[Sambilight] Sambilight started on E Series
[Sambilight] H_LEDS: 35, V_LEDS: 19, BOTTOM_GAP: 7, START_OFFSET: 68, COLOR_ORDER: RGB, CAPTURE_POS: 0, CLOCKWISE: 1
[Sambilight] 480x270 0ms
[Sambilight] Black border detection enabled
[Sambilight] -------------1-------------
[Sambilight] Name: 16:9
[Sambilight] Saturation Gain: 130%
[Sambilight] Value Gain: 90%
[Sambilight] Brightness Correction: -7
[Sambilight] Horizontal Depth: 26%
[Sambilight] Vertical Depth: 15%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 0%
[Sambilight] Vertical Padding: 0%
[Sambilight] -------------2-------------
[Sambilight] Name: 21:9
[Sambilight] Saturation Gain: 120%
[Sambilight] Value Gain: 90%
[Sambilight] Brightness Correction: -7
[Sambilight] Horizontal Depth: 15%
[Sambilight] Vertical Depth: 7%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 12%
[Sambilight] Vertical Padding: 0%
[Sambilight] -------------3-------------
[Sambilight] Name: 4:3
[Sambilight] Saturation Gain: 100%
[Sambilight] Value Gain: 100%
[Sambilight] Brightness Correction: 0
[Sambilight] Horizontal Depth: 12%
[Sambilight] Vertical Depth: 12%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 0%
[Sambilight] Vertical Padding: 12%
[Sambilight] -------------4-------------
[Sambilight] Name: 3:2
[Sambilight] Saturation Gain: 100%
[Sambilight] Value Gain: 100%
[Sambilight] Brightness Correction: 0
[Sambilight] Horizontal Depth: 12%
[Sambilight] Vertical Depth: 12%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 0%
[Sambilight] Vertical Padding: 8%
[Sambilight] 4 Profile(s) Loaded From Config
[Sambilight] Could not find serial port! Retries 0
[Sambilight] Could not find serial port! Retries 1
[Sambilight] Could not find serial port! Retries 2
[Sambilight] Sambilight ended
[Sambilight] lib_deinit
[Sambilight] lib_deinit

Code: Select all

usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbserial_generic 3-1.3:1.0: usb_probe_interface
usbserial_generic 3-1.3:1.0: usb_probe_interface - got id
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbserial mod ld
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
ftdi_sio mod ld
root@tv:/mtd_rwcommon $
Inside the dtv folder there is only the log file, Sambilight.bmp is not stored
fromul
SamyGO Project Donor
Posts: 47
Joined: Sat Feb 01, 2020 11:07 am
Location: Czech Republic

Re: [App] libSambilight E/F/H (MST-only)

Post by fromul »

kisspach wrote: Thu Nov 17, 2022 11:46 pm ok, thank you very much for the advice!
I tried with another adapter but the result doesn't seem to change. The first one I tried is prolific pl2303, usually, these give problems. The second is a generic one, but it doesn't seem to change anything!

Code: Select all

[Sambilight] SamyGO E/F/H libSambilight v1.3.1 - (c) tasshack 2019 - 2022
[Sambilight] _Z23SdDisplay_CaptureScreenP8SdSize_tPhP23SdDisplay_CaptureInfo_t [0xf3810c].
[Sambilight] dlsym '_Z23SdDisplay_CaptureScreenP8SdSize_tPhP23SdDisplay_CaptureInfo_t12SdMainChip_k' failed.
[Sambilight] dlsym '_Z23SdDisplay_CaptureScreenP8SdSize_tPhP24SdVideoCommonFrameData_tP8SdRect_t12SdMainChip_k' failed.
[Sambilight] _Znwj [0xf3efe4].
[Sambilight] _ZN4SCGCC2El [0x1c3f800].
[Sambilight] _ZN8SCBaseGC6CreateEv [0x1c4b738].
[Sambilight] _ZN4SCGC7DestroyEv [0x1c3f5c4].
[Sambilight] _ZN4SCGCD2Ev [0x1c3f854].
[Sambilight] _ZN4SCGC5ClearEPN6Shadow9BasicType4RectE [0x1c401ec].
[Sambilight] _ZN8SCBaseGC5FlushEPN6Shadow9BasicType4RectE [0x1c4ae4c].
[Sambilight] _ZN4SCGC8FillRectEN6Shadow5ColorEllll [0x1c4a720].
[Sambilight] _ZN4SCGC8DrawTextEllPtl [0x1c3be74].
[Sambilight] _ZN4SCGC11SetFontSizeEl [0x1c3c4d4].
[Sambilight] _ZN4SCGC7SetFontEP6SCFont [0x1c3b2d4].
[Sambilight] _ZN4SCGC12SetFontStyleEl [0x1c3ac84].
[Sambilight] _ZN4SCGC10SetFgColorEN6Shadow5ColorE [0x3835c24].
[Sambilight] _ZN14CUSBAppResUtil14GetDefaultFontEv [0x256bc00].
[Sambilight] g_IPanel [0x42039738].
[Sambilight] dlsym 'g_TaskManager' failed.
[Sambilight] g_pTaskManager [0x72fc354].
[Sambilight] g_TVViewerMgr [0x73073b8].
[Sambilight] dlsym 'g_pTVViewerMgr' failed.
[Sambilight] g_TVViewerWStringEng [0x7198e28].
[Sambilight] dlsym 'g_WarningWStringEng' failed.
[Sambilight] dlsym 'g_pCustomTextResMgr' failed.
[Sambilight] dlsym 'g_CustomTextWStringEng' failed.
[Sambilight] _ZN16CResourceManager10GetWStringEi [0x150d7fc].
[Sambilight] _ZN9PCWString7ConvertEPtPKciiPi [0xf40d88].
[Sambilight] _ZN12CTaskManager14GetApplicationE15DTV_APPLICATION [0x150f164].
[Sambilight] _ZN10CViewerApp16GetViewerManagerEv [0x197fa38].
[Sambilight] dlsym '_ZN10ALMOND030015CDesktopManager11GetInstanceENS_13EDesktopIndexE' failed.
[Sambilight] dlsym '_ZN10ALMOND030015CDesktopManager14GetApplicationEPKcS2_' failed.
[Sambilight] _ZN14CViewerManager15ShowSystemAlertEii [0x19c8364].
[Sambilight] dlsym '_ZN14CViewerManager15ShowSystemAlertEi' failed.
[Sambilight] _ZN14CViewerManager14ShowCustomTextEi [0x19c5284].
[Sambilight] dlsym '_ZN14CViewerManager14ShowCustomTextEib' failed.
[Sambilight] dlsym '_ZN14CViewerManager10ShowRCModeEi' failed.
[Sambilight] dlsym '_ZN14CCustomTextApp13t_OnActivatedEPKci' failed.
[Sambilight] MsOS_PA2KSEG0 [0x41ee145c].
[Sambilight] MsOS_PA2KSEG1 [0x41ee144c].
[Sambilight] MsOS_Dcache_Flush [0x41ee148c].
[Sambilight] MApi_MMAP_GetInfo [0x41db9b24].
[Sambilight] MApi_XC_W2BYTEMSK [0x41ee494c].
[Sambilight] gfx_InitNonGAPlane [0x41dcc1a8].
[Sambilight] gfx_ReleasePlane [0x41dd361c].
[Sambilight] gfx_CaptureFrame [0x41dc789c].
[Sambilight] gfx_CaptureFrame [0x41dc789c].
[Sambilight] gfx_BitBltScale [0x41dcdf2c].
[Sambilight] MApi_GOP_DWIN_CaptureOneFrame [0x41e02398].
[Sambilight] MApi_GOP_DWIN_GetWinProperty [0x41e01b24].
[Sambilight] Sambilight started on E Series
[Sambilight] H_LEDS: 35, V_LEDS: 19, BOTTOM_GAP: 7, START_OFFSET: 68, COLOR_ORDER: RGB, CAPTURE_POS: 0, CLOCKWISE: 1
[Sambilight] 480x270 0ms
[Sambilight] Black border detection enabled
[Sambilight] -------------1-------------
[Sambilight] Name: 16:9
[Sambilight] Saturation Gain: 130%
[Sambilight] Value Gain: 90%
[Sambilight] Brightness Correction: -7
[Sambilight] Horizontal Depth: 26%
[Sambilight] Vertical Depth: 15%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 0%
[Sambilight] Vertical Padding: 0%
[Sambilight] -------------2-------------
[Sambilight] Name: 21:9
[Sambilight] Saturation Gain: 120%
[Sambilight] Value Gain: 90%
[Sambilight] Brightness Correction: -7
[Sambilight] Horizontal Depth: 15%
[Sambilight] Vertical Depth: 7%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 12%
[Sambilight] Vertical Padding: 0%
[Sambilight] -------------3-------------
[Sambilight] Name: 4:3
[Sambilight] Saturation Gain: 100%
[Sambilight] Value Gain: 100%
[Sambilight] Brightness Correction: 0
[Sambilight] Horizontal Depth: 12%
[Sambilight] Vertical Depth: 12%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 0%
[Sambilight] Vertical Padding: 12%
[Sambilight] -------------4-------------
[Sambilight] Name: 3:2
[Sambilight] Saturation Gain: 100%
[Sambilight] Value Gain: 100%
[Sambilight] Brightness Correction: 0
[Sambilight] Horizontal Depth: 12%
[Sambilight] Vertical Depth: 12%
[Sambilight] Overlap: 0%
[Sambilight] Horizontal Padding: 0%
[Sambilight] Vertical Padding: 8%
[Sambilight] 4 Profile(s) Loaded From Config
[Sambilight] Could not find serial port! Retries 0
[Sambilight] Could not find serial port! Retries 1
[Sambilight] Could not find serial port! Retries 2
[Sambilight] Sambilight ended
[Sambilight] lib_deinit
[Sambilight] lib_deinit

Code: Select all

usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbserial_generic 3-1.3:1.0: usb_probe_interface
usbserial_generic 3-1.3:1.0: usb_probe_interface - got id
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbserial mod ld
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
ftdi_sio mod ld
root@tv:/mtd_rwcommon $
Inside the dtv folder there is only the log file, Sambilight.bmp is not stored
I don't remember exactly, but usb to serial adapter with PROFILIC chipset not working, you must using directily adapter from FTDI (i had my first serial adapter from Profilic and did not work for this project....and years ago, profilic stopped working in OS Windows, FTDI is OK)...so check if you use adapter from FTDI.
UE46H7000 T-MST14DEUC 2130.0 rooted, OSCam r11704, Sambilight preparation in progress
kisspach
Posts: 11
Joined: Sun Nov 13, 2022 1:51 am

Re: [App] libSambilight E/F/H (MST-only)

Post by kisspach »

I took a USB FTDI adapter and now the tv recognizes it correctly.
now, I have an ESP8266MOD 12-F. I connected data and clock to GPIO 14 and 12. I attached the TX of the FTDI USB adapter to the GPIO 13.
inside sambiglight-arduino.ino I entered the number of LEDs, I removed the comment on line 9 to enable the pin clock.
The LEDs do not light up if I connect the 5v and GND that connect the LEDs to the Vin of EPS8266. If instead, I connect the USB port, and then remove the Vin pin, the LEDs light up. Not always all light up, and above all the first 10 flickers, while the others remain on random colours when I try to take the test.
I don't understand what the problem could be.

-----------UPDATE-------------
I checked all connections and solder, now it seems to work!
fromul
SamyGO Project Donor
Posts: 47
Joined: Sat Feb 01, 2020 11:07 am
Location: Czech Republic

Re: [App] libSambilight E/F/H (MST-only)

Post by fromul »

kisspach wrote: Mon Nov 28, 2022 1:18 am I took a USB FTDI adapter and now the tv recognizes it correctly.
now, I have an ESP8266MOD 12-F. I connected data and clock to GPIO 14 and 12. I attached the TX of the FTDI USB adapter to the GPIO 13.
inside sambiglight-arduino.ino I entered the number of LEDs, I removed the comment on line 9 to enable the pin clock.
The LEDs do not light up if I connect the 5v and GND that connect the LEDs to the Vin of EPS8266. If instead, I connect the USB port, and then remove the Vin pin, the LEDs light up. Not always all light up, and above all the first 10 flickers, while the others remain on random colours when I try to take the test.
I don't understand what the problem could be.

-----------UPDATE-------------
I checked all connections and solder, now it seems to work!
Sorry, have no idea, where is problem. If you have correctly connected all LED stripe pins with PSU and Arduino (5V pin on led stripe with 5V from PSU, GND on led stripe with GND from PSU) and after this have you correctly connected LED stripe with Arduino (2nd. wire from GND to GND on Arduino, 2nd. wire from 5V to VIN on Arduino and single wire from data LED strip pin to GPIO on Arudino and last single wire from clock LED stripe pin to GPIO on Arduino.

...maybe if you have wrong colors, try change in arduino INO sketch file COLOR_ORDER from default GRB at value BGR....for my 4pin APA102 it worked
...and do you changed in INO sketch LED_TYPE to your WS2801 that?

...try flash to your arduino with an example, if your LEDs working correctly...like this https://github.com/christoph-daehne/Ard ... 01-Example
UE46H7000 T-MST14DEUC 2130.0 rooted, OSCam r11704, Sambilight preparation in progress
kisspach
Posts: 11
Joined: Sun Nov 13, 2022 1:51 am

Re: [App] libSambilight E/F/H (MST-only)

Post by kisspach »

I solved it. Between the various tests, I realized that the first LED burned out. I replaced it and made the connections correctly.
Then I modified the script to fit the nodeMCU Amica esp8266mod 12-f. For the WS2801 I put RGB colours as order.
Now everything works! Congrats on the superb work and thanks for the support!
I'm attaching the modified version of the .ino script if it helps anyone.

Code: Select all

//##### SETTINGS ############

#define BAUDRATE  921600  // Serial port speed
#define NUM_LEDS 86      // Number of leds
#define BRIGHTNESS 255   // Maximum brightness
#define LED_TYPE WS2801  // Led strip type for FastLED
#define COLOR_ORDER RGB  // Led color order
#define PIN_DATA 14      // Led data output pin
#define PIN_CLOCK 12     // Led data clock pin (uncomment if you're using a 4-wire LED type)

//###########################

#define FASTLED_ESP8266_RAW_PIN_ORDER


#include <Arduino.h>
#include <FastLED.h>

CRGB leds[NUM_LEDS];
uint8_t* ledsRaw = (uint8_t*)leds;

const uint8_t magic[] = { 'A', 'd', 'a' };
#define MAGICSIZE sizeof(magic)
#define HICHECK (MAGICSIZE)
#define LOCHECK (MAGICSIZE + 1)
#define CHECKSUM (MAGICSIZE + 2)

enum processModes_t { Header,
                      Data } mode = Header;

int16_t c, outPos, bytesRemaining;
unsigned long t, lastByteTime;
uint8_t headPos, hi, lo, chk;

void setup() {
  FastLED.addLeds<WS2801, PIN_DATA, PIN_CLOCK, COLOR_ORDER>(leds, NUM_LEDS);

  FastLED.setBrightness(BRIGHTNESS);
  FastLED.show();

#if defined(ESP8266) || defined(ESP32)
  Serial.setRxBufferSize(2048);
#endif

  Serial.begin(BAUDRATE);

#if defined(ESP8266)
  delay(500);
  Serial.swap();  // RX pin winoll be GPIO13 on ESP8266
  delay(500);
#endif

  lastByteTime = millis();
}

void loop() {
  t = millis();

  if ((c = Serial.read()) >= 0) {
    lastByteTime = t;

    switch (mode) {
      case Header:
        if (headPos < MAGICSIZE) {
          if (c == magic[headPos]) {
            headPos++;
          } else {
            headPos = 0;
          }
        } else {
          switch (headPos) {
            case HICHECK:
              hi = c;
              headPos++;
              break;
            case LOCHECK:
              lo = c;
              headPos++;
              break;
            case CHECKSUM:
              chk = c;
              if (chk == (hi ^ lo ^ 0x55)) {
                bytesRemaining = 3L * (256L * (long)hi + (long)lo + 1L);
                outPos = 0;
                memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
                mode = Data;
              }
              headPos = 0;
              break;
          }
        }
        break;
      case Data:
        if (outPos < sizeof(leds)) {
          ledsRaw[outPos++] = c;
        }
        bytesRemaining--;

        if (bytesRemaining == 0) {
          mode = Header;
          while (Serial.available() > 0) {
            Serial.read();
          }
          FastLED.show();
        }
        break;
    }
  } else if (((t - lastByteTime) >= (uint32_t)120 * 60 * 1000 && mode == Header) || ((t - lastByteTime) >= (uint32_t)1000 && mode == Data)) {
    memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
    FastLED.show();
    mode = Header;
    lastByteTime = t;
  }
}

Post Reply

Return to “[F] Software”