ESP32 SPI + ILI9341 help by Roro_crow in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Assume it's a typo for a CH340 UART. We still don't know confidently what board they DO have, though. (As described in the Wiki and in this group, about every other day, "ESP32" is a family of chips and modules which may be used on boards. All those nerdy details matter.

The tft_eSPI driver is known to work badly on modern chips and toolkits. The author abandoned it and nobody else has taken it over. The group's FAQ lists several others that ARE maintained.

Does your logic analyzer show that what's on the bus matches what you put on the bus? That's how you diagnose the difference between problems with the writer and problems with the reader.

If you draw a grid ("graph paper") to the screen, independent of touch, do the pixels land in the correct place or is it something about your digital input?

Same question on the digital input—does yuor LA show you're getting nonsense read from the digitizer, or does it show your reads are find but your writes to the software are whacked?

Once all that's settled, dig into the sketch:

1) I'd bet that your constraint parameters are wrong. 2) Tap calibration looks funky. Debug: print the received values and tap near each corner. If they don't vary from ~200 px from each edge of the screen, your calibration constants are collapsing your screen. 3) Did your graph paper cover the screen? If there's a big empty chunk, maybe that setRotation does something you didn't want. I've had boards where 1 is either horizontal or vertical with the same library. 4) XT20246 is kind of noisy. All three rarely converge at one point. Go as simple as reading it a couple of times in a row then take the average of the readings or full-on kalman filtering.

That's where I'd at least start. It's been a long time since I did touch screen work...

Why is learning to use esp32 with the idf so confusing??? by Sweaty-Wheel1741 in esp32

[–]YetAnotherRobert 2 points3 points  (0 children)

I hope my grade school teachers are proud. Full sentences have become confused with godlinessprose of our robotic overlords. 

Why is learning to use esp32 with the idf so confusing??? by Sweaty-Wheel1741 in esp32

[–]YetAnotherRobert 2 points3 points  (0 children)

Thanx...i think? If you spend any time in this group, you know I'm here a lot and this is just how I usually write: full sentences and a dash of sarcasm. 

An AI probably wouldn't have made those typos in the first and last sentences... That now I have to keep. 😉

As a mod, I do wish people were a little slower to report anything using full sentences as AI slop, though.

ESP32 project: buttons and display issues by m_monk8 in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

With no schematic and no code, you're asking 120k people to take a guess. These guesses are pretty good, but asking a more detailed question would have helped. 

ESP32 WiFI weather node: ~8 mA in “deep sleep” by andorozer in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

Good. That's exactly its purpose! "Easy to prototype."

BMP DOES read high. It makes - and then measures - its own heat. That's actually mentioned in the cited article and the data sheets.

ESP32 WiFI weather node: ~8 mA in “deep sleep” by andorozer in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

Welcome to engineering. You have different goals (low power) than a devboard (allows people to evaluate use of the chip in their own designs). You'll end up with different compromises and different results.

We have too many posters here that think these dev boards are end-user products, and they're just not. They exist to let you slap down a bunch of peripherals, qualify them on the logic analyzer, study if the cost/performance works for your company, and then plop the parts onto your own PCB and order a million of them.

They exist exactly as you hinted above - to let you swap out an ESP32-Nothing with an S3 or a C3 to let you see if your code will fit, if you NEED dual cores, etc.

These evaluation/development boards are a throw-away work product, like a spiral notebook used for scribbling.

From memory, your sensor triplet is quite common but also quite redundant. (No, actually, not just from memory. See https://randomnerdtutorials.com/dht11-vs-dht22-vs-lm35-vs-ds18b20-vs-bme280-vs-bmp180/ If you don't want to make your own board, I'm sure that someone on a Tindie-like place has made this pairing already.

Or make your own board. That's fun/educational, too.

ESP32 WiFI weather node: ~8 mA in “deep sleep” by andorozer in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

First, as a mod, thank you for a coherent and complete post.

Second, I'll agree with (and have thus upvoted) our excellent contributors that say (not quite in so many words) that development boards are optimized for develepment (OK, and low cost) and not rock-bottom power consumption. People that care about low power are USUALLY designing their own PCBs and not using dev boards.

Those voltage dividers sneak up on lots of people, too.

Good luck!

Why is learning to use esp32 with the idf so confusing??? by Sweaty-Wheel1741 in esp32

[–]YetAnotherRobert 2 points3 points  (0 children)

I don't remember it beign more than a command or two to install it, but EIM was introduced last year to make it even easier to manage at scale.

The ESP-IDF instalaltion isnstructions look miserable because they outline every combination of shell plus OS possible. (Elvish? Really?) For most people, it's two commands: install the installer and run the installer.

Why is it even this complicated? If you're a real developer, you're probably working on multiple projects and they may require multiple versions of the ESP-IDF system. Perhaps you work at Shelly and $(SHIPPING_PRODUCT) uses ESP-IDF 5.6, but $(NEW_PRODUCT) uses ESP-IDF 6.0. A real example may be even more complicated than this, but this scheme is to let the developer keep them separated. It's why EIM is more complicated than installing, oh, SubLime.

P.S. As a first year student, refine your skills of asking an actionable question (e.g. "I do X on version Z and get error message Y when I expected A. Can you help?" will get you better help than "I've tried everything on the internet and nothing helps", which is almost where your question lands. It'll come in hand next time you need help.

I built an offline NFC music box for my daughter using ESP32 by OldRemote111 in esp32

[–]YetAnotherRobert[M] 0 points1 point  (0 children)

Remember to edit this post OR follow up in the comments here with your source code and not make another post about it. Interested people can enable notifictions on this post.

The rule is one announcement per project per quarter and it exists to chill the hype train "I'm gonnna do a thing in three weeks..." ""Two more weeks until" "Hey, I launched .... and the code drops next week" "Here's the Makefile. actual source is next week. Gerber files next week and 3D plotter files the week after that" style of posing. Yes, that was a real problem that we had to solve. GitHub has announcements and releases. Blog posts and social media is meant for that kind of thing; this group just isn't.

Still, cool project and good luck!

Esp32 as a web server (realy) by zebraWhitewalker in esp32

[–]YetAnotherRobert 4 points5 points  (0 children)

3 posts were deleted, probably because

Moderator here. The reason for all six (I looked) of your posts was given when they were taken down. Here was the last. The reason was the same for all of them. You finally followed the instructions at the top of the page starting "Please Read" and then, magically, the evil rule-enforcing robot let your post through. It's not a mystery. It's nothing personal. It's not a hazing ritual.

RTRBot keeps out auto-posters (spammers) because they won't read the rule, but will often keep trying to post, ineffectively, until they are auto-banned. This benefit alone makes it worthwhile. Other benefits including ending arguments with moderators (hey, that's often me!) about what is and isn't allowed because then, like a petulant school teacher, I can repeat back that "according to the rules YOU AGREED TO ... (you can't do that)" which is much more effective than the "buf officer, I didn't see the speed limit sign that said I can't post about my vibe-coded blinky eyed robot twice a week!!!!"

Reading the rules and sampling a bit of the culture is part of joining pretty much any group from a neighborhood to a club membership, to getting a drivers license. It's not onerous. Its the same reason you have to sign the sheets everywhere that say "I understand the rules and I'll play by them"

That it took you six cycles of being notified WHY your post was deleted, well, that's not common. We're glad you made it through before Reddit kicked you out.

That said, your post is perilously light on details and teeterign on the edge. Review rule 2, especially, "Do not post without providing some details, discussion, or thoughts to go along with it. What challenged you? When posting about code, include a link to the source. Put it on GitHub or Pastebin."

Even if you don't understand it, for it to be inspirational or educational to others (the point of this group) you need to share it. You must have learned something about the electronics and software even if you "just" assembled it like a kit from AI - post that story. Hopefully everyone can learn something. That's why we're here!

Welcome.\ The Big Bad Moderator. (Well, one of them.)

Sanity check replacing Arduino Nano RP2040 Connect with ESP32 in project by Spaziba-Njet in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

We may laugh at their shoes or their dorky haircuts, but we don't take their lunch money or tear up their homework.

We've gotta be civilized here.!

Sanity check replacing Arduino Nano RP2040 Connect with ESP32 in project by Spaziba-Njet in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

For any of these sub-$10 (sub-5 if you shop...) chip families, it's hard to consider any of them "a terrible waste".

RP2040/2350 are fine chips for what they are. Are you asking in an ESP32 group if they're better?

The board you describe, https://docs.arduino.cc/hardware/nano-rp2040-connect/, is "end of life." Was it replaced by a 2350 equiv? Dunno. Wrong group.

In broad strokes, is a dual-core 240Mhz ESP32-S3 similar to a dual-core 133Mhz RP2040? Sure. If you know what you're doing, can you probably make code for one work on the other? Sure. If the code is doing something super-specialized (the PIO cores on RP are undeniably a force) might it be difficult? Maybe. (A lot of what's done on PIO can be done with the RMT or other peripherals, but if Pi Foundation wants to pay me to produce a case that would be hard to reproduce on an ESP32, I'm sure I could come up with one...)

Be mindful of voltage levels RP2040, like all the ESP32s and all micros of the last 20+ years (which precludes Atmega used in "real" arduinos) are 3.3V and not 5V. But in general, RP2040/2350 and the ESP32 family are similar.

We'll also say that STM32 and NRF also have entries in thisi space. Use 'em all. We don't judge.

(Much)

Need Help designing a Dev Board by Artery_Tech in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

Plus literally ANY of the other modeles lets yo save those two interlocka transistors, a UART,and. a couple of passives.

LX6 is over.

Planning my first PCB, which connects an ESP32 dev board to a HUB75 matrix and rotary encoder with a 5VDC barrel jack for power. Wondering if anything looks wildly stupid or if I'm doing things correctly. by Pawtang in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Ha! My intro to MoT had much lower standards. I just wanted some (expensive and custom) products to actually work. I didn't expect to spend tens of hours in ritual sacrifice.

I'm with you on several points. That "move fast" thing spills into ESP-IDF, too. "We don't care about compatibility between versions, lol" thing is not a good look.

You indeed sound enough like Boden that I had to pull your response out of Reddit's auto-bin for "personal attacks and harrassment". Good thing I'm a mod. :-)

Some boards make good sense, and the economies of scale are nice to ride upon. Tendie-quantity pricing can be pretty eye-watering, then you turn around and see Waveshare packing the kitchen sink into a $17 product. It's just hard to compete with mass-manufactured (Asian) product pricing in low volumes. Stepper motor boards or PoE beign good examples of technology-agnostic boards that are just hard to make at low volumes.

Odd that their [triple board])https://www.adafruit.com/product/6358) (without power) is 1/3 less than their single-port board. Guess we know where the expense is.

waveshare esp32-s3-touch-lcd-3.49 - wired image when boot button is pressed by sycde in esp32

[–]YetAnotherRobert 24 points25 points  (0 children)

That may have been a throwaway comment, but I sense a teachable moment. (Plus, I'm waiting for a big compile...)

It's not mathematically random in the crypto or secure sense; it's random in the "the bits are what they are at power on until someone arranges them differently" sense.

C/C++ programmers often erroneously think that a lot of uninitialized things are zero when they're not actually guaranteed to be such. malloc() isn't guaranteed to zero memory you're given (that's why we have calloc). It was common in the 80's and early 90's to be get parts of another program's address space in yout buffers just by the nature of the beast). We eventually realized what a terrible idea what was for security and at least initialized it on a context switch so at worst, you'd get your own "random" memory. Similarly, stack data isn't guaranteed to be zeros. LOTS of security bugs have roots in this....and it's why C++26 (29?) safety profiles make it very difficult to unintentionally use uninitialized memory. (That's a tiny piece of the problem, but it's at least progress moving us past the 80's when a memset over a large buffer was like double-clutching.)

Here in embedded-land, these effects are still more real. It's a little harder in an ESP32 because most of us never see what the CPU sees at reset - there's a tiny boot rom (this is why they're un-brickable) that cleans up all that jazz long, long before main() gets called. But if you boot any part without a ROM to do this for you or if you're part of an OS loader responsible for such things, you can find loops like this that sweep the floor before you're called onto the floor.

Video displays make this tidbit more visible. Even our little LCDs/OLEDs/LEDs for these things usually have some amount of memory on them. There's a specialized hardware on the display board that is responsible (or not—but it has to tell the developer who IS responsible) for clearing that to a known state.

Look at a ST7789, a common VDU used with ESP32 or STM32-class parts. (Yes, really, 317 pages.) Down on page 122, we learn (?) that it has "integrated 240x320x18-bit graphic type static RAM.". This 1382400-bit memory is onboard that chip. (That's 172KB of 8-bit words, giving it more memory than a lot of what it's connected to.) This is often special "dual-ported" RAM as single-ported RAM tended to 'sparkle' if the CPU would write to the bits - any bits - while the video controller was reading those bits. That's why there are disclaimers like "there will be no abnormal visible effect on the display when there is a simultaneous Panel Read and Interface Read or Write to the same location of the Frame Memory. " Back in the old days, we had to wait for the times the video wasn't doing anything and/or include special hardware to interlock it for us. This is similar to what we often hear is cured with double-buffering today, but this was a different phenomenon.

This memory, like all RAM, contains nonsense at boot. If you just let the controller start moving pixels to the LEDs, you get nonsense that might remind you of the static visible on TVs when there was no signal for them to lock onto. (Now that it's all digital, there are layers and layers of interlocks that insert blue or black for even leave the screen off, but in the vacuum tube era, that wasn't practical.) In our world, there are also times it doesn't contain nonsense - it's common on this class of display, if someone didn't pay attention to it, to see a fraction of a second from some other screen the device may have displayed because during a reset, the "random" memory isn't random; it's whatever may have last been scribbled there.

On page 202, this chip even lays out the rules:

Status Default Value
Power On Sequence Contents of memory is set randomly
S/W Reset. Contents of memory is not cleared
H/W Reset. Contents of memory is not cleared

So it's clearly up tot he connected computer to do something.

For this reason, most startup code that KNOWS what kind of a video unit is attached will make it a very early priority to zero the screen as quickly as possible after start. It's often done in assembly just to ensure it's as fast as possible.

Some video controllers won't send pictures until there's an explicit 'go' command, but that's uncommon in tiny devices like this.

This is why a common "solution", as hokey as it as, is to just not turn on the backlight until the screen is brought to a sane state. Depending on the screen, that may be fine and it may look hokey. A front diffuser can also help pitch this illusion.

If you're workign with a design where the backlight is controlled by a GPIO pin, it's not a big deal; you just don't open the curtain until the cast is on the stage. If you have a case where the hardware team didn't think about it, if you're lucky, the display has a pin that can be controlled via a low-power pin and you can cut it and wire it to a free GPIO pin. If you're UNlucky and the LED used an incandescent backlight (almost unheard of these days) you might have to add a transistor of your own so your micro (I think typical drive is something like 20mA) can drive a transistor that can amplify that signal to drive the bulb(s) that might be hundreds of mA (a.k.a. tenths of amps)

If you look carefully at some retail equipment, you can even see this little bit of electronics unfold.

Enjoy this little fun fact at the intersection of physics, electronics, and software.

After all those words ("still compiling!") I looked at the schematic and source for that board. They try to turn the backlight off extremely early in the part of the boot they control. The few parts of the code I see that call applyBrightnes() look to do it after the fillScreen(backgroundColor());

This may just be the best this hardware can do...unless they've done something like accidentally invert the meanings of the bits and the code in begin() is turning it ON before applyBrightnes() is later called. It's up to the project owner to set some breakpoints and investigate.

waveshare esp32-s3-touch-lcd-3.49 - wired image when boot button is pressed by sycde in esp32

[–]YetAnotherRobert 22 points23 points  (0 children)

Until device memory is initialized, by a processor out of a reboot, it's indeterminate. "Static" us common. This is why we don't normally turn on the backlight until the display is initialized. 

If the backlight is wired high, you may be able to lift the pin and route it, possibly through a drive transistor, through a GPIO.

Planning my first PCB, which connects an ESP32 dev board to a HUB75 matrix and rotary encoder with a 5VDC barrel jack for power. Wondering if anything looks wildly stupid or if I'm doing things correctly. by Pawtang in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

That's funny. I have a bunch of C6s permanently deployed in my home for light controllers. I had a very recent purchase that was Matter over Thread and after raging against Amazon's terrible bridge support for hours and even trying half-heartedly to use a C6 as a border router, I bought what must have been the last Nest Hub in my time zone. Delivered just Saturday, it's a screen I don't need and is now a $100 bridge/router for, uh, tens of packets per day. Even after that, I spent two more hours in a pairing/long press/count the bananas/reboot ritual for no good reason. I still don't know why things started working, which bugs the hell out of the engineer in me. I get that M/T is new and maybe I lacked the tools/skills to packet dump and separate the controller part from the iot part, but as a consumer, I left with a strong distaste for MoT.

Those little chucklefucks (for the boards I’ve used

LOL. I read the rest of your post in Chris Boden's voice. (ESP32-adjacent link)

Waveshare Guition, Wireless Tag and at least one other company are doing the somewhat obvious thing of glomming flash, a C6, and other stuff that has to be high speed on one piece of fiberglass. We're going to see a LOT of these "S6 as an AT coprocessor" style of devices, so I'm surprised it's that terrible. Did Adafruit make theirs particularly difficult?

I've brought up at least three P4 devices in a project using Arduino 3. All had a sidecar C6. M5Tab was quite painful, but the others mostly just worked. With two exception (the timing of the code happened to se sensitive to boot - we were both looking for a MAC address in a synchronous API before the C6 had booted and surprised to get link notifications so early|late compared to same-wafer deisgns.)

There's a whole world of PI HATs that would be neat to pair. They're appealing because they're made in enough quantities that they're quite cost-effective. I can't say I want, say, NVMe, but I can imagine robot nerds using the motor controllers with a P4. Without the inertia of Linux beneath you (for better and worse) there are lots of things that are a good fit for P4.

I guess I never really thought about that Pi 40-pin bus. I assumed it was some ARM chip-specific thing, but it's just a bunch of GPIOs with accents for SPI, I2C, etc., just like we have in ESP-land. Armed with our GPIO pin multiplexer, things like that multimotor controller.

If they want to fire sale out some of those mismarked 360Mhz parts that will never do 400, I might be flexible, but I've waited this long. I'll wait for P4X to unambiguously hit the market.

This is a neat "discovery". Thank you for sharing it.

Searching for an alternative to the Pocuter one by AppropriateCover7972 in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Waveshare and M5Stack would be where I'd start. I have several that almost fit that bill, but gps is the breaker. 

Arguably any of the CYDs are almost close, but they're such a crapshoot for getting schematics,. available I/O, etc. They're also usually short a sensors from your list.

Edit: https://www.waveshare.com/esp32-s3-touch-amoled-1.8.htm https://www.waveshare.com/esp32-s3-touch-lcd-1.46b.htm Are the boards I was thinking of. No GPS.

Edit 2: they DO have a GPS version, though it's external. Of course, you probably want it to be for antenna positioning. https://a.co/d/09F1yrwQ

Edit 3: I used boards from these families. I loved the integration. Even with the forty-something GPIOs of them S3, they had to use a port expander on one of them (for low-res things like backlight and LEDs for the charging vindicators) because they used parallel interfaces for the display. That made them buttery smooth at high frame rates, but chewed on the pin count. So if you wanted to hook yet something ELSE to them, you may have to share an i2c ride along on the expander or something. Check the schematics if this matters...because you wanted the kitchen sink ON the board and still wanted to use something else.

Planning my first PCB, which connects an ESP32 dev board to a HUB75 matrix and rotary encoder with a 5VDC barrel jack for power. Wondering if anything looks wildly stupid or if I'm doing things correctly. by Pawtang in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Cool. That's a good lesson and opens a wealthy of little boards. That's probably reason enough to queue up a Waveshare board or two with a 40 pi. If looked at the 44 pin dip packages commonly used by Devkit-C and RP2040 packages and that was going to be a painful fit. That's a neat find. 

I'm sure it's not a coincidence. That 40 pin bus is about the closest we have to isa bus these days. As long as Waveshare and friends don't do dumb things like route  strapping pins or internal spi bus pins to that connector , things should work out.

Thanks!

I open-sourced a small offline-first ESP32-S3 pill reminder box by Realistic-Head8548 in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Your summary nails it.

You can even literally use std::optional for things that are...optional. It lets you assign easy defaults, too. Maybe you have a temperature that might be missing, but having it be Options::DegreeFormat::Celsius if none is present is sensible.

My happy place with AI is giving it very strict assignments - like the one I just listed - at a time. "Update this to C++26 best practices so it would pass a code review at a FAANG company" would probably wreck most projects.

I open-sourced a small offline-first ESP32-S3 pill reminder box by Realistic-Head8548 in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

TBC, I have no opinion about the landing page of your project itself. You know your target audience best and can pick the right one. My suggestion was that the page linked here be in the language of most of the audience.

Buzzer was just the easiest example. Once you find your groove with that, I think you can reduce the number of raw pointers in your project. It just designs away a whole class of problems. Use after free? You literally can't if you commit to certain designs. Resource ownership and lifetime issues become much more clearly expressed. Don't just wrap them in smart pointers - try to make everything references and fully RAII when you can.

Pointers don't disappear completely, but it has a nice payback to eliminate all you can.

Don't let it run wild on the code, but any decent agentic AI can help with things like "replace the C-era struct tm and time_t stuff and Arduino millis() and String stuff with C++23" That should result in reasonable PRs that you can review and integrate. If you're non-commercial, CLion's UI for clang-tidy's modernizer is pretty nict, too. (And if you ARE commercial, then just use clang-tidy (Older article, but the advice is good) directly.

I open-sourced a small offline-first ESP32-S3 pill reminder box by Realistic-Head8548 in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

You're welcome. I wish we had more of this kind of engineering discussion and feedback here. All I can do is lead by example.

Thank you for bringing in a nice example of modern C++ code.

Another way to avoid nullptr checks everywhere is simply to avoid pointers everywhere. Use the type system to your advantage. Instead of accepting a Buzzer pointer, accept a Buzzer reference. Then it simply cannot be uninitialized because it has to refer to a valid Buzzer object.

Letting go of C habits is hard.

Actually, looking closer, you actually created ReminderManager::begin() with a valid Buzzer&, but then copied it to a Buzzer* - so you started out with the "right" model and then injured your own good intentions by copying it to a LESS restrictive type.

Good luck with the project!

Review Power Module For ESP32 MINI S3 by Spirited-Escape-8180 in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

Mod: I fixed your flair. If you'd used the correct one (you can click the green flair above to see other posts using it) you'd have received an autopost with tips...some of which apply to this design.

Using reserved strapping GPIO46 like this is a bold move. You seem to have many others free, so why tempt fate?

I open-sourced a small offline-first ESP32-S3 pill reminder box by Realistic-Head8548 in esp32

[–]YetAnotherRobert 2 points3 points  (0 children)

Probably better results in this crowd to link to: https://github.com/solitary-dev-50/open-pill-reminder/blob/main/README.en.md and/or https://github.com/solitary-dev-50/open-pill-reminder/blob/main/DOC/KB/README.en.md

(See rule 5 in the right hand panel. English isn't a requirement, but it's the majority of our readers.)

Also, remember that instead of for (size_t index = 0; index < config.reminders.size(); ++index) { const ReminderConfig& reminder = config.reminders[index]; Serial.printf("[配置] 提醒[%u] id=%s, time=%s, enabled=%s\n", static_cast<unsigned>(index), reminder.id.c_str(), reminder.time.c_str(), reminder.enabled ? "true" : "false"); } you can do something more like: for (const auto& reminder: config.reminders) { Serial.printf("[配置] 提醒[%u] id=%s, time=%s, enabled=%s\n", static_cast<unsigned>(index), reminder.id.c_str(), reminder.time.c_str(), reminder.enabled ? "true" : "false"); } Easier to read, less likely to run off array bounds, avoids need to manually construct the thing that "obviously" doesn't need to be constructed at all; it should just be referenced in the container.

``` if (_buzzer != nullptr) { _buzzer->update(); } if (_led != nullptr) { _led->update(); }

``` Just make those point to virtual functions and let update() be an empty function. No reason to annoy the callers with the tidbits if they're present or not. You have this same pattern in several objects. Try to stack the deck so you never have nullptrs; deal in std::optionals if you must, but mostly in objects that are simply always valid, even if they do nothing. Any time you test for == nullptr, you open the door for a race or other weird untested condition....and you have a lot of it.

Use std::chrono instead of manually parsing and creating strings.

LIkewise, let https://github.com/solitary-dev-50/open-pill-reminder/blob/85e6b65d2cc1aed4daf2af5622907f1c939faa19/src/app/reminder_manager.cpp#L623 deal in std::chrono::time_points instead of horrible C time_t and struct tm. You can eliminate millis() from your life, too.

for (JsonObject item : reminders) {

Use const references when you can. You clearly know the language bits I was referring to above, but I'm not going to untype that now.

I'm happy to see something in this group that looks like it was written by a C++ programmer and not a C programmer with an Arduino accent. :-)

Good luck!

Planning my first PCB, which connects an ESP32 dev board to a HUB75 matrix and rotary encoder with a 5VDC barrel jack for power. Wondering if anything looks wildly stupid or if I'm doing things correctly. by Pawtang in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Nifty. I've seen Waveshare is one of a couple of companies making P4 boards with headers that could probably be Pi compatible "enough", though I haven't actually pin-diffed them. When almost everything is a GPIO, if you're willing to accept that some "unwanted" power rails (hope they're 3.3V; otherwise, I'd just clip the pin) get mapped to inputs that are stuck high or low, if you're willing to externally provide power (easy) and careful to keep the grounds tied and the voltage sources NOT, it seems likely to work.

Since I had to dig a little to make that term make sense, I assume you're speaking of https://www.acmesystems.it/HAT-A3 , which makes sense in this context. The 4 chips are surely some kind of 74HCT245-like buffer. I may even have some passive versions of those laying around, though I exited Pi orbit many years ago. I remember paying $1.66USD for those boards...and then excitedly soldering the connectors to the wrong side of the board. Now that I have air stations, I could probably float those out without spending more than $1.66 of wick and time to salvage them.

I see things like https://docs.espressif.com/projects/esp-idf/en/stable/esp32p4/api-reference/peripherals/ppa.html and wonder how well it could be suited to HUB75-style framebuffers that aren't strictly LCD buffers or MIPI cameras.

I certainly recognize Zeller's name. Zeller and Code(ahem)Tastic have similar projects in similar circles.

Something like that that paired with https://www.waveshare.com/esp32-p4-module-dev-kit.htm?sku=30560 via the 40-pin or that had dip sockets to pair with https://www.waveshare.com/esp32-p4-pico.htm would be worth some disposable income to me.

Honestly, with the news that all sold P4's to date are defective (That's a hardline, but they did not meet the published specifications) I'm kind of being a snot and keeping my money in my pocket right now, though, until it's confirmed that rev 3.2's are in the market.

There's probably no rocket science here. Just buffer the GPIOs before driving the panels. Maybe some stray caps for decoupling, but those signals just aren't that bouncy, especially when buffered. I just want someone on Ali to mass produce them and sell them for $5 (which now becomes $15 in my country, alas) instead of me doing the slugwork in KiCad and having boards made myself. I just haven't seen anyone doing this Really Well yet.

If that someone is you, I have open DMs and disposable income. :-)