Page 10 of 20

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

Posted: Sun Jan 30, 2022 10:44 pm
by one
I used my nodemcu with WLED and it is working fine with the LED Stripe, and singleshot mode to test is working too. but it won't work when booting.
when looking in the sam.log on my usb stick i get the line
./etc/rc.sysinit: line 97: /mnt/etc/init.d/01_99_Sambilight.init: not found
what could be the problem?
The file is in the location and permissions are set via ssh.

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

Posted: Sun Jan 30, 2022 11:47 pm
by zoelechat
Smells like bad text editor with non-unix linefeeds imho :)

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

Posted: Mon Jan 31, 2022 6:41 am
by one
zoelechat wrote: Sun Jan 30, 2022 11:47 pm Smells like bad text editor with non-unix linefeeds imho :)
This could ne possible. Used the editor to edit the file. Need to set notepad++ as standard text editor finally. :lol:

Will try it later when i'm home from work

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

Posted: Tue Feb 01, 2022 1:02 am
by one
Must be something wrong with my init file. If ic paste the command with inserted values in ssh ambilight is working fine with enabling and disabling via remote.
Need to find out whats wrong with my file or simply create a own init with just the needed values without the variables.

And it works using an NodeMCU with wled installed and the original serial input Pins.

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

Posted: Sat Feb 12, 2022 8:15 pm
by fromul
so, how it work? Is needed enable serial link in service menu of my UE46ES6800? But my TV support serial link only via 3.5mm jack connector. Or it's not important? Will be functional:
- nodeMCU wired to LED Stripe and with 2 wire (GPIO TX and GND) to FTDI and FTDI connected via USB to my TV?

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

Posted: Sat Feb 12, 2022 9:21 pm
by tasshack
fromul wrote: Sat Feb 12, 2022 8:15 pm so, how it work? Is needed enable serial link in service menu of my UE46ES6800? But my TV support serial link only via 3.5mm jack connector. Or it's not important? Will be functional:
- nodeMCU wired to LED Stripe and with 2 wire (GPIO TX and GND) to FTDI and FTDI connected via USB to my TV?
It should work without making any changes in service menu.

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

Posted: Sun Feb 13, 2022 11:36 am
by fromul
i don´t know, where I'm going wrong? My devices are nodeMCU with CH340 driver and FTDI USB convertor here:
20220213_110556.jpg
20220213_110518.jpg
i uploaded to my nodeMCU attached INO with changed LED nummbers...i using led type WS2812B, needs to be changed from default value WS2812 to my WS2812B?

here is my sketch with changed NUM_LEDS:
//##### SETTINGS ############

#define BAUDRATE 921600 // Serial port speed
#define NUM_LEDS 182 // Number of leds
#define BRIGHTNESS 255 // Maximum brightness
#define LED_TYPE WS2812 // Led strip type for FastLED
#define COLOR_ORDER GRB // 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)

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




#if defined(ESP8266)
#define FASTLED_ESP8266_RAW_PIN_ORDER
#endif

#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() {
#if defined(PIN_CLOCK) && defined(PIN_DATA)
FastLED.addLeds<LED_TYPE, PIN_DATA, PIN_CLOCK, COLOR_ORDER>(leds, NUM_LEDS);
#elif defined(PIN_DATA)
FastLED.addLeds<LED_TYPE, PIN_DATA, COLOR_ORDER>(leds, NUM_LEDS);
#else
#error "No LED output pins defined. Check your settings at the top."
#endif

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

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

Serial.begin(BAUDRATE);

#if defined(ESP8266)
delay(500);
Serial.swap(); // RX pin will be GPIO13
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;
}
}
after uploding get this end result:
In file included from C:\Users\admin\Desktop\Sambalight\libSambilight-source\libSambilight-1.2.11\sambilight-arduino\sambilight-arduino.ino:21:
C:\Users\admin\Documents\Arduino\libraries\FastLED\src/FastLED.h:14:21: note: '#pragma message: FastLED version 3.004.000'
14 | # pragma message "FastLED version 3.004.000"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\admin\Documents\Arduino\libraries\FastLED\src/FastLED.h:65,
from C:\Users\admin\Desktop\Sambalight\libSambilight-source\libSambilight-1.2.11\sambilight-arduino\sambilight-arduino.ino:21:
C:\Users\admin\Documents\Arduino\libraries\FastLED\src/fastspi.h:135:23: note: '#pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output'
135 | # pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executable segment sizes:
ICACHE : 32768 - flash instruction cache
IROM : 238724 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26745 / 32768 - code in IRAM (IRAM_ATTR, ISRs...)
DATA : 1500 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 888 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 26272 ) - zeroed variables (global, static) in RAM/HEAP
Projekt zabírá 267857 bytů (25%) úložného místa pro program. Maximum je 1044464 bytů.
Globální proměnné zabírají 28660 bytů (34%) dynamické paměti, 53260 bytů zůstává pro lokální proměnné. Maximum je 81920 bytů.
esptool.py v3.0
Serial port COM4
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: e8:db:84:dd:8f:98
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 272016 bytes to 199686...
Writing at 0x00000000... (7 %)
Writing at 0x00004000... (15 %)
Writing at 0x00008000... (23 %)
Writing at 0x0000c000... (30 %)
Writing at 0x00010000... (38 %)
Writing at 0x00014000... (46 %)
Writing at 0x00018000... (53 %)
Writing at 0x0001c000... (61 %)
Writing at 0x00020000... (69 %)
Writing at 0x00024000... (76 %)
Writing at 0x00028000... (84 %)
Writing at 0x0002c000... (92 %)
Writing at 0x00030000... (100 %)
Wrote 272016 bytes (199686 compressed) at 0x00000000 in 4.8 seconds (effective 452.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
after connection nodeMCU with FTDI to my TV shine (fully shine all RGB on 255) only first LED on my strip...

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

Posted: Sun Feb 13, 2022 7:55 pm
by markush6302
Hi fromul!
I also had issues with WS2812B led type.
At the beginning everything was working perfect and after a few weeks only the first led was showing up in strange colours. After a lot of research I found out, that the first led was broken. After replacing the first led everything was working like it should. Maybe this helps you

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

Posted: Sun Feb 13, 2022 8:27 pm
by tasshack
markush6302 wrote: Sun Feb 13, 2022 7:55 pm Hi fromul!
I also had issues with WS2812B led type.
At the beginning everything was working perfect and after a few weeks only the first led was showing up in strange colours. After a lot of research I found out, that the first led was broken. After replacing the first led everything was working like it should. Maybe this helps you
Can you send the /dtv/Sambilight.log file?

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

Posted: Sun Feb 13, 2022 8:45 pm
by fromul
i maked steps:
- I've copied libSambilight.so and libSambilight.config to /mnt/opt/privateer/usr/libso
- I've copied 01_99_Sambilight.init to /mnt/etc/init.d/
- I've set file permissions with chmod

but i don´t have a Sambilight.log in /dtv/
...only libOscamE_T-MST.log

...Sambilight.log was created after manually testing (but with disconnected NodeMCU and FTDI):
VDLinux#> samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libSambilight.so H_L
EDS:35 V_LEDS:19 BOTTOM_GAP:7 START_OFFSET:68 CLOCKWISE:1 CAPTURE_POS:0 COLOR_OR
DER:RGB BAUDRATE:921600 TEST_FRAMES:1 TEST_PATTERN:1 TEST_PROFILE:0 TEST_SAVE_CA
PTURE:1
samyGOso v1.2.5 (c) bugficks 2013-2014, sectroyer 2014-2015
Injecting '/mnt/opt/privateer/usr/libso/libSambilight.so' resident: '0'
mprotect: 0x42379c80
dlopen: 0x428f8b28
dlclose: 0x428f8ccc
dlsymaddr: 0x428f8d1c
pc=428234dc lr=428234c8 sp=be976ef8 fp=72d2f5c
r0=fffffe00 r1=80
r2=1 r3=0
stack: 0xbe95a000-0xbe97b000 length = 135168
executing injection code at 0xbe976cdc
library injection completed!
Succeeded.
VDLinux#>


...i try it again to morrow