
CRAM - Caseville! 44 boats registered!
Join CRAM next weekend on Lake Huron. Never too late to make plans to come.

Join CRAM next weekend on Lake Huron. Never too late to make plans to come.
I've had a few post here regarding converting some Lumary 6in Slim ceiling lights that originally came with WB2L Tuya chips, that I then chip swapped them with ESP-C05 chips to move them to ESPHome, and now want to move over to Zigbee. Without an identical pinout option on the market I'm using the ESP32-C6 chips wired in.
I want to share what I have that seems to be working really well now. I had some issue with RGB color mixing, but after adding the gamma curve adjustment the colors are much better. While I left it in the code commented out I didn't care for the gamma adjustment when it came to the white lights so I switched that back to a linear mix. I'd say that it's as good or maybe better than the color mix of ledc in ESPHome, at least for these specific lights.
Anyways, why I called this the prime day update is there is a deal going for the ESP32-C6 chips. Unfortunately they are limiting to one per customer, but thanks to some friends & family members, and being happy enough with my below Arduino code I pulled the trigger and plan to chip swap (Again) all 24 of my light and get them off of Wi-Fi.
I hope my code here (yeah I should probably put it on github) is helpful to others. I hadn't worked with Arduino code before this and I wasn't able to find any direct examples for RGBWW lights like what I was after.
// Check for the Coordinator/Router compiler flag instead of End Device
#ifndef ZIGBEE_MODE_ZCZR
#error "Zigbee Coordinator/Router mode is not selected in Tools->Zigbee mode"
#endif
#include "Zigbee.h"
// Define the GPIO pins for your MOSFETs/drivers ruling the LED strips
#define PIN_RED 19 // D8
#define PIN_GREEN 20 // D9
#define PIN_BLUE 17 // D7
#define PIN_WARM 23 // D5
#define PIN_COLD 16 // D6
#define ZIGBEE_ENDPOINT 10
// LEDC PWM Setup
#define PWM_FREQ 20000
#define PWM_RESOLUTION 10 // 10-bit resolution = maximum PWM value is 1023
// Global Light Variables
bool current_state = false;
uint8_t current_level = 255;
uint8_t color_r = 255, color_g = 255, color_b = 255;
uint16_t color_temp = 250; // Mireds
uint8_t color_mode = 0; // 0 = RGB, 1 = Color Temperature
uint16_t min_mireds = 154; // mireds ~ 1000000 / 6500
uint16_t max_mireds = 370; // mireds ~ 1000000 / 2700
// Instantiate the endpoint
ZigbeeColorDimmableLight zbLight = ZigbeeColorDimmableLight(ZIGBEE_ENDPOINT);
// 10-bit Gamma Correction Lookup Table (Gamma = 2.2)
// Maps linear 8-bit inputs (0-255) to human-perceived 10-bit PWM outputs (0-1023)
const uint16_t gammaTable[256] PROGMEM = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 18, 19, 20, 22, 23, 25, 27, 28, 30, 32, 34,
36, 38, 40, 43, 45, 47, 50, 52, 55, 58, 60, 63, 66, 69, 72, 75,
79, 82, 85, 89, 93, 96, 100, 104, 108, 112, 116, 121, 125, 129, 134, 139,
143, 148, 153, 158, 163, 169, 174, 179, 185, 191, 196, 202, 208, 214, 220, 226,
233, 239, 246, 253, 259, 266, 273, 280, 288, 295, 303, 310, 318, 326, 334, 342,
350, 359, 367, 376, 385, 394, 403, 412, 421, 431, 440, 450, 460, 470, 480, 490,
501, 512, 522, 533, 544, 555, 566, 578, 589, 601, 612, 624, 636, 648, 660, 673,
685, 698, 711, 724, 737, 750, 763, 777, 790, 804, 818, 832, 846, 861, 875, 890,
905, 920, 935, 950, 966, 981, 997, 1013, 1029, 1045, 1062, 1078, 1095, 1112, 1129, 1146,
1163, 1180, 1198, 1216, 1234, 1252, 1270, 1288, 1307, 1325, 1344, 1363, 1382, 1401, 1421, 1440,
1460, 1480, 1500, 1520, 1541, 1561, 1582, 1603, 1624, 1645, 1666, 1688, 1709, 1731, 1753, 1775,
1797, 1819, 1842, 1864, 1887, 1910, 1933, 1956, 1979, 2003, 2026, 2050, 2074, 2098, 2122, 2146,
2171, 2195, 2220, 2245, 2270, 2296, 2321, 2347, 2373, 2399, 2425, 2451, 2478, 2504, 2531, 2558,
2585, 2612, 2640, 2667, 2695, 2723, 2751, 2779, 2807, 2836, 2865, 2894, 2923, 2952, 2981, 3011
};
void update_hardware_leds()
{
if (!current_state)
{
ledcWrite(PIN_RED, 0);
ledcWrite(PIN_GREEN, 0);
ledcWrite(PIN_BLUE, 0);
ledcWrite(PIN_COLD, 0);
ledcWrite(PIN_WARM, 0);
return;
}
float dim_factor = current_level / 255.0;
if (color_mode == 0)
{ // RGB Mode
// 1. Calculate uncorrected, scaled 8-bit color values
uint8_t r_lin = (uint8_t)(color_r * dim_factor);
uint8_t g_lin = (uint8_t)(color_g * dim_factor);
uint8_t b_lin = (uint8_t)(color_b * dim_factor);
// 2. Fetch gamma-corrected 10-bit properties (scaled down from 12-bit array map via >> 2)
ledcWrite(PIN_RED, pgm_read_word(&gammaTable[r_lin]) >> 2);
ledcWrite(PIN_GREEN, pgm_read_word(&gammaTable[g_lin]) >> 2);
ledcWrite(PIN_BLUE, pgm_read_word(&gammaTable[b_lin]) >> 2);
ledcWrite(PIN_COLD, 0);
ledcWrite(PIN_WARM, 0);
}
else
{ // White Spectrum Mode
// 1. Map color temperature variables linearly to standard 8-bit format
uint8_t warm_lin = map(color_temp, min_mireds, max_mireds, 0, 255);
uint8_t cold_lin = 255 - warm_lin;
// 2. Incorporate master dimming levels into 8-bit tracking variables
warm_lin = (uint8_t)(warm_lin * dim_factor);
cold_lin = (uint8_t)(cold_lin * dim_factor);
// 3. Process outputs using gamma-corrected curves, shifting values to 10-bit PWM range
ledcWrite(PIN_RED, 0);
ledcWrite(PIN_GREEN, 0);
ledcWrite(PIN_BLUE, 0);
-
//With Gamma Correction:
//ledcWrite(PIN_COLD, pgm_read_word(&gammaTable[cold_lin]) >> 2);
//ledcWrite(PIN_WARM, pgm_read_word(&gammaTable[warm_lin]) >> 2);
//Without Gamme Correction:
ledcWrite(PIN_COLD, (uint16_t)(cold_lin * 4));
ledcWrite(PIN_WARM, (uint16_t)(warm_lin * 4));
}
}
void setRGBLight(bool state, uint8_t r, uint8_t g, uint8_t b, uint8_t level)
{
current_state = state;
current_level = level;
color_r = r;
color_g = g;
color_b = b;
color_mode = 0; // Toggle to RGB Mode
Serial.printf("RGB -> State:%d, Level:%d, R:%d G:%d B:%d\n", state, level, r, g, b);
update_hardware_leds();
}
void setTempLight(bool state, uint8_t level, uint16_t mireds)
{
current_state = state;
current_level = level;
color_temp = mireds;
color_mode = 1; // Toggle to White Temp Mode
Serial.printf("Temp -> State:%d, Level:%d, Mireds:%d\n", state, level, mireds);
update_hardware_leds();
}
void setup()
{
Serial.begin(115200);
ledcAttach(PIN_RED, PWM_FREQ, PWM_RESOLUTION);
ledcAttach(PIN_GREEN, PWM_FREQ, PWM_RESOLUTION);
ledcAttach(PIN_BLUE, PWM_FREQ, PWM_RESOLUTION);
ledcAttach(PIN_COLD, PWM_FREQ, PWM_RESOLUTION);
ledcAttach(PIN_WARM, PWM_FREQ, PWM_RESOLUTION);
// Enable XY (RGB) and Color Temperature capabilities
zbLight.setLightColorCapabilities(ZIGBEE_COLOR_CAPABILITY_X_Y | ZIGBEE_COLOR_CAPABILITY_COLOR_TEMP);
zbLight.setManufacturerAndModel("Lumary", "6in Slim Light");
// Bind callbacks
zbLight.onLightChangeRgb(setRGBLight);
zbLight.onLightChangeTemp(setTempLight);
zbLight.setLightColorTemperatureRange(min_mireds, max_mireds);
Zigbee.addEndpoint(&zbLight);
Serial.println("Starting Zigbee Subsystem...");
if (!Zigbee.begin(ZIGBEE_ROUTER))
{
Serial.println("Failed to start! Rebooting...");
delay(2000);
ESP.restart();
}
}
void loop()
{
delay(100);
}
It's official! Just signed the agreement with the Amway Grand Plaza Hotel to host my K'nex Mackinac Bridge for this year's r/ArtPrize competition in Grand Rapids, Michigan!
My dad has been complaining about the internet not working lately. I have a Unifi network stack at his house so fortunately I have the data to verify his claims. Looking at the last weeks worth of data I can see that pretty consistently he's getting about 10% packet loss (red line) starting around 1PM and lasting until 11PM ( ± an hour for either). He has 600/25 Spectrum cable internet and hardly breaks 15Mpbs streaming TV (blue line). These stats are for the WAN connection and don't have anything to do with Wifi. Regardless, his closest neighbors are over 100ft away.
I just updated the UDM-SE router I have there, but I doubt that will change much. He's got the latest cable modem from Spectrum in anticipation of High-Split rolling out in the next few months. Power cycling the modem did not resolve the issue.
Any theories? His usage doesn't really match up with the packet loss. If anything he's been watching DVDs when the internet stops internetting properly. Kind of reminds me of that story of the dude in England who's old TV would knock out the broadband from when he turned it on in the morning until he turned if off when he went to bed.
Was diving I-96 in the Fowlerville area roughly 5PM yesterday (May 31st) and there was a pretty massive plume of black smoke south of the highway. I'd ballpark it around the Fowlerville Proving Grounds. Just wondering what happened. Couldn't find anything googling.
I'm with a sail racing fleet and our fleet just purchased a 21ft center console that we will be used as our Race Committee boat. The trailer does not currently have any brakes which is something we would like to add. This boat and trailer will be towed by a whole host of vehicles as we move it around the state every summer for our various events.
Personally, I would like electronic brakes as I have a truck with a tow package, but I'm aware that not everyone does. The logistics of moving the "RC Boat" around are difficult enough and we don't want to limit our options.
Before commit to a plan I wanted to make sure there aren't any other or hybrid options out there that we aren't aware of? Are surge controlled electronic brakes a thing, but use a 7 pin and they work like regular electronic brakes? Any other general items we should be considering as we add brakes to our new trailer?
Looking for 7x 10tb HGST SAS drives. Not super picky on hours, but do want to see smartctl output.
Is this how boomers feel when they hear millennials talking about the housing market?
We call it the CRAMpound. For 5 years now I've been camping Catamaran Racing Association of Michigan (CRAM) events with my 10x20 ABCcanopy pop-up and EZ-UP camping cube. Last year 2 of my friends decided to follow suit, and part of the event fun has been coming together with our tents to create a 10x30 communal space for everyone attending our regattas to hang out and play a lot of euchre.
We have created a little sub-community sharing things like the best gutters for putting between our tents or modifying window walls so they use velcro along the top.
This was at Manistee, Michigan last summer. Already looking forward to our next event where I expect all 3 of us to be there with our tents. First time posting in this sub. Let me know if I should take more pictures and share.
Currently have 2 ISPs. $40 for 500/500 after $5 Educator discount with a regional fiber provider, and $30 for 500/25 with Charter Spectrum with a "begged me to come back" discount price after I initially dropped them for the regional fiber provider. ISPs have down time, planned or unplanned, and as a WFH and a power user it's worth it to me.
AT&T recently ran fiber in my neighborhood so I was curious about replacing Charter with them purely for the better upload speed. Base price for 500/500 is $50 and no discounts so already more expensive than their direct fiber competition. With phone plan they would go down to $35 but their 3 line phone plan is $10 more than I'm paying Verizon. Looks like they do an educator discount only on cell plans, but Verizon has better service the places I go while my AT&T friends are complaining about theirs.
Wondering if anyone has had any luck in getting AT&T to break from their list price especially as a new customer in a price competitive market.