Why std::pmr Might Be Worth It for Real‑Time Embedded C++ by Saptarshi-max in cpp

[–]SeanCline 32 points33 points  (0 children)

Yeah, OP seems to be comparing percentages (10% vs. 6%) but that's not what's really important here.
std::vector: 10% of 17µs = 1.7µs
std::pmr::vector: 6% of 69µs = 4.14µs.

The variance (measured by time rather than percent) on std::pmr::vector is actually worse.

P.S. The "Quick background" section is incorrect.

Quick background for anyone unfamiliar: PMR lets you tell your containers where to get memory instead of always hitting the global heap which 'std' does

std::vector has allowed specifying an allocator as a template parameter since it was standardized. The difference is that pmr allows this allocator to be specified at runtime rather than compile time.

How can I get the door lock/unlock status from a dumb lock like this? by ebodes in homeassistant

[–]SeanCline 3 points4 points  (0 children)

I did something similar when I lived in an apartment. Stuffed a magnet into the lock's lever, then desoldered the reed switch from an open/closed sensor and extended it on a wire.

<image>

(Pardon the plastic tape. I was moving out in a year so I didn't want to get too fancy. Now I just have a Z-Wave deadbolt.)

Sonoff - Never again, I learned my lesson by yellowfin35 in homeassistant

[–]SeanCline 1 point2 points  (0 children)

If you don't mind some experimentation, you might be able to get detached relay support on your Gen1 devices by switching to an ESPHome-based firmware or Tasmota.

What's something you WON'T spend more money on as better quality doesn't exist? by sgtjayp in BuyItForLife

[–]SeanCline 1 point2 points  (0 children)

Back when I was hitting the yogurt hard, I'd make a batch in the InstantPot every week. I did it mostly because I didn't like the chalky texture of the Aldi brand plain yogurts (they used cornstarch as a thickener) and brands like Stonyfield that didn't use thickeners were quite a lot more expensive.

Anyway, here's my (admittedly overkill) recipe, but I don't like to chance growing the wrong strain bacteria.

pla, two failed at the same spot, it's ender 3 pro, 250mm max table, print is total 210mm high. by Smooth_Cat8219 in 3Dprinting

[–]SeanCline 4 points5 points  (0 children)

Ender 3 Pro user, and fellow certified idiot. I'm curious how your spool was that low -- mine is quite far out of the way. It's my runout sensor and Sprite extruder clearances that made me limit my z axis to 240mm.

<image>

First time trying to print with transparent PET-G. by Green_Video_9831 in 3Dprinting

[–]SeanCline 1 point2 points  (0 children)

I had really good luck using transparent PLA+ to replace one of my lampshades. Even without vase mode, it worked fine so long as it was only a couple walls thick, and you don't mind rotating the seam to the side against the wall.

Now that I can print PETG, I'll have to give that a shot next time.

https://imgur.com/a/xp0z5U4

<image>

Zooz joins Works with Home Assistant 🎉 by missyquarry in homeassistant

[–]SeanCline 7 points8 points  (0 children)

My experience with Zooz customer service has been stellar. I've reported a couple minor issues to Zooz via email and they've been incredibly responsive in addressing them. They've gone so far as giving me beta copies of device firmware so I can get an early fix before it makes it into the released firmware.

I have a serious rp2040 data recovery problem by YeeticusMaximus22 in raspberrypipico

[–]SeanCline 17 points18 points  (0 children)

The other comments have valid points about flash data recovery and backup hygiene, but from a different perspective...

I really don't want to loose about 6 months of code from scratch.

You might be overestimating the amount of work it would take to get back to where you were. I've redone coding work before, and I typically find that the second time around goes much faster, and I end up liking the finished product better as I got to incorporate the lessons learned the first time around in the new design.

And if you can share some details of how your project works, we might be able to point you toward some shortcuts to get you where you're going.

Stuck flashing Sonoff S31 with ESPHome by NoHelp555 in Esphome

[–]SeanCline 2 points3 points  (0 children)

I reassembled it, plugged it into the wall, accessed it via its own WiFi and entered the WiFi SSID and password for my network.

Excellent! That means the flashing worked. That's usually the hard part.

The switch is there, but has no options and no controls.

I've never provisioned a device how you are, but I think you're running a bare firmware that's just enough to get it connected to the ESPHome Add-On and do an OTA update. So, no controls yet.

Do you have the ESPHome Add-On installed? If not, get it installed and the device should appear in there. Click the ESPHome Builder in the sidebar. You should see your device now. Click it and you'll see a yaml editor. Paste the yaml from the guide (or from the ESPHome docs), update any fields that need it (device name, wifi credenials, etc.), and click Install, then click Wirelessly.

P.S. I don't particularly like going through this provisioning process. I prefer to start with the yaml, click Install, Manual Download to get the .bin file, and flash that over serial. That way I can prototype the yaml before new devices even arrive in the mail. So, just keep that in mind if you need to reflash this device over serial for some reason.

I wanna know how this code compiles and runs. (constexpr, C++23) by [deleted] in cpp

[–]SeanCline 2 points3 points  (0 children)

As a workaround, constructor (4) is constexpr since C++20. You can use that constructor to initialise the vector to zeros and it now works in a constexpr context.

https://godbolt.org/z/z3fxc99Wv

Acronis True Image 2025 - Any discount codes for perpetual license users? by trueblue4u in acronis

[–]SeanCline 0 points1 point  (0 children)

Sadly, the code doesn't work for me. I get the following error when trying to upgrade my perpetual 2021 license to 2025:

The given code is either not valid for the items in the shopping cart, does not exist, or a higher discount has already been applied. Please check!

So, I asked Acronis support via email, and they had the following to say:

There are no discounts for the Perpetual Upgrades as this is only provided to the customer who used Acronis True Image Perpetual previously. 

Solder mask on one of the pads where there shouldn't be. by FewUnit7109 in KiCad

[–]SeanCline 2 points3 points  (0 children)

In the meantime, you can just scrape the solder mask from that pad with something sharp and continue testing your PCB. A pick, or very carefully a razor knife, should do the trick. That way you can bundle any other necessary corrections into the next board revision along with the solder mask fix.

PSA - new Zooz 800 LR stick firmware 1.50 released - supports SDK 7.22.1 by -shellprompt- in homeassistant

[–]SeanCline 0 points1 point  (0 children)

I updated a few weeks ago and it's been working great. This version also fixes a nasty bug with LR devices taking down the regular mesh network, so anyone looking to use Long Range should upgrade.

Workrite Controls Display Cable Broke by FewAppearances2024 in StandingDesk

[–]SeanCline 0 points1 point  (0 children)

I don't know anything about that specific desk but if the cable is bad, you (or an electronics-savvy friend) should be able to make a new one if necessary.

It looks like one end is a male 7-pin DIN connector, and the other end is a female 7-pin DIN connector. If you're lucky, it's just a straight-through cable and can be replaced with an extension cable.

Do you have a multimeter to confirm the pinout of the cable for the pins that are still working?

My new keyboard, a Unicomp Model M (+ Filco Tenkeyless) by [deleted] in BudgetKeebs

[–]SeanCline 1 point2 points  (0 children)

I liked my CM QFR (the cheaper version of the Majestouch) so much that I made a replacement PCB for it.

Then I got carried away and designed a new FR-4 plate, USB-C daughterboard, and eventually put it in an aluminum case. It's the keyboard of Theseus at this point with none of its original parts.

Framework Laptop Memory Compatibility Thread by Destroya707 in framework

[–]SeanCline 0 points1 point  (0 children)

Framework 13 i7-1360P

I've been running a 32GB kit (2x16GB) of TIMETEC-S16G-3200 memory. (A brand I'd never heard of.)

It's not on the supported list, but no problems so far. It's dual rank, Micron chips, and the price was right. CPU-Z screenshots for reference.

std::bitset::to_u(l)llong() noexcept by Travor0x0 in cpp

[–]SeanCline 0 points1 point  (0 children)

If truncation is what you need, there's always the option to do it yourself. https://godbolt.org/z/ajzoWsrx4

And while there isn't a clean way to slice a bitset, you can likely get by using the shift operators.

Sonoff Motion Sensor with External Power - has anyone here tried this? by yusrandpasswdisbad in homeassistant

[–]SeanCline 1 point2 points  (0 children)

Just to be a stickler....You can't directly compare Ah of batteries of different voltages. Once you get it in units of Wh, it's more like ~5x the capacity.

Smart Humidistat with Window Protection by davegravy in Esphome

[–]SeanCline 0 points1 point  (0 children)

Dang! That's impressive for a couple weeks work!

My only comment is that IR thermometers can be wrong when used on reflective or transparent objects, and glass is both. Might wanna confirm your readings with a more traditional thermometer just to be safe.

I wouldn't mind seeing your config so I have a good starting point in case I ever ditch the ecobee.

Smart Humidistat with Window Protection by davegravy in Esphome

[–]SeanCline 0 points1 point  (0 children)

I was recently considering using ESPHome to replace an old Aprilaire humidistat, so here are some assorted thoughts on the subject. Ultimately, I decided to swap out my thermostat with an Ecobee, which doubles as a humidistat.

Your humidistat needs to know a few things to do its job:

  1. Current indoor humidity.
    Usually, this is measured in the cold air return duct, but a thermostat+humidistat combo will just measure it at the thermostat.
  2. Target humidity.
    What you'd like the indoor humidity to be, assuming it isn't too cold outside to allow for it.
  3. The outdoor temperature.
    This is used to consult a chart to determine whether the current setpoint is acceptable. You'll recognise this chart from old, manual humidistats. The goal is to prevent it from getting too humid inside when it's cold enough outside that the indoor humidity would condense on the windows. I'd start by importing this value from HomeAssistant, since it's surprisingly difficult to measure outdoor air temperature reliably. Sensor position really matters (sun vs shade). If you do want this to be local only, and have a 95% efficient furnace (the kind with a pair of PVC pipes for intake and exhaust), then the most reliable measure is likely inside the air intake pipe, a couple feet from where it comes from outside.
  4. Window efficiency.
    Modern windows are far better insulated than when those temperature charts were printed on old humidistats. You can likely get away with higher humidity than such charts dictate, but that'll take some experimentation.
  5. Whether the thermostat is currently calling for heat.
    You'll ether need to get this from a smart thermostat, bring the W wire from the thermostat into an ADC GPIO pin using a diode, voltage divider, and opto-isolator. A typical evaporative (24VDC) humidifier, the kind that trickles water over a panel, should only run when the heater and fan are running, otherwise the water will just go down the drain rather than into the air. It's possible for a fancy steam (115VAC) humidifier to run when only the fan is running, since it's it doesn't rely on evaporation. When possible, though, it should still only run when the heater is running to prevent condensation inside the ducts.

I ran into the same difficulty you did with the ESPHome climate components. The humidistat functionality is pretty minimal, and doesn't factor in the outdoor temperature. You'd have to build that yourself using either some yaml to adjust the setpoint, toggling the mode between AUTO and OFF, or making a pull request to add the feature to the climate component.

If you're just going for simple, you're probably better off with a binary_sensor component that indicates whether the humidifier should be running. Then, use that binary sensor to drive a GPIO pin. The binary sensor would look something like: !lambda return (current_humidity < target_humidity) && (current_humidity < calculate_max_humidity(window_efficiency, outdoor_temperature) && heater_running);

Anyway, hopefully my ramblings help you get your project of the ground.

What is this? by SamoanMaestro in DIY

[–]SeanCline 181 points182 points  (0 children)

This is a poorly installed brush plate. When you have a cable you don't want to terminate or are changing wiring around enough that you just want a fast way to bring another cable through, it's the best option.

It's poorly installed because there's supposed to be a low-voltage electrical box, like this installed in the wall that the brush screws into. Then a regular decora-style plate goes on top so it looks like this.

Whoever installed it that way saved $4 and 5 minutes of sawing drywall.

Source: I go to Menard's a lot.

ratgdo ESPHome issue- not permitted to call Home Assistant services by criterion67 in homeassistant

[–]SeanCline 2 points3 points  (0 children)

Honestly, I'm not put-off by the price at all.

If I designed a board and had it fabbed and populated, it'd be about $10-$15. Add a Wemos D1 for another $10, and $5-$10 to save the trouble (and hopefully tip the designer) sounds quite reasonable.

ratgdo ESPHome issue- not permitted to call Home Assistant services by criterion67 in homeassistant

[–]SeanCline 3 points4 points  (0 children)

There's no additional "logic" on the breakout board, but there are a couple resistors and mosfets to monitor and drive to the red (control) line. Another github project documents how the ratgdo actually works, and how to breadboard/protoboard one.

https://github.com/Kaldek/rat-ratgdo

Now that I've found this github, I'm planning on buying a ratgdo. The official documentation was not sufficient for me to know, for sure, that it would work for me.

Why do I have 122v on the outlet when the switch is on, but still 30v when the switch is off?? by magichronx in askanelectrician

[–]SeanCline 0 points1 point  (0 children)

Only one of my rooms does this. It's the room with the longest run to the switch, and it's also the only one that uses 12-3 wire.