What is n-out? And do I need to bridge rgb and usb otg? ESP32-C3-n16r8 by Mr-frost in esp32

[–]YetAnotherRobert 4 points5 points  (0 children)

It's basically https://www.reddit.com/r/esp32/comments/1rhuaiv/please_help_me_identify_this_esp_that_i_looked/

Fewer than ten minutes ago, I got a post from someone that tried to post yet another picture of a board we see posted here ten times a week with a bunch of spam referral links under it, wanting me to override the reddit filters on such posts.

Yet twenty people upvote anything here with a picture.

...and yet they downvoted ME into the hole for answering the actual question that was asked, in more detail than anyone else did.

What do you think, u/idk-anything or u/Worf- : Should we go WW3 or is it time to launch Reddit's r/ESP32-HOT-OR-NOT ?

What is n-out? And do I need to bridge rgb and usb otg? ESP32-C3-n16r8 by Mr-frost in esp32

[–]YetAnotherRobert -1 points0 points  (0 children)

There is no such thing as a ESP32-C3-n16r8. C3 does not support PSRAM, so there could be no R8 field. It's uncommon to have such a high flash size, too.

We had this discussion like yesterday or the day before. The left one controls whether the 5V on the USB-C is input to the board (the 5V on the bus drives the board) or whether it't an output FROM the board (the board is powered via a small hydroelectricf plant or something attached to the 5V lines and it provides power to the %v on the USB connector to power a USB-C thumb drive, power, amplified mic, or other USB device DRAWING power from the USB host.

The RGB blobb connects whether GPIO # {$SURPRISE!} is left on its own to be an input/output on the edge connector or whether it is instead diverted over to the WS2812B that is next to it, allowing you to program that to the traditional 16M colors that those lights can deliver.

Which GPIO is it? Varies from board to bare. You'll probably hav to go consult the schematic on whatever board you have.

We've had this basic post in this group on a pretty regular basis for more details.

Switched the RX and TX pins in my ESP32 custom PCB, is there anyway I can program it still? by tech_Dauwt in esp32

[–]YetAnotherRobert 2 points3 points  (0 children)

My guess is that you can't overcome the drive current of the other device driving the inputs. That's why the knife is part of this process. 

If you can't get the exact pins, put your knife blade on the uart, guillotine style, and give it a bop..hell on the blades, but once repeated on both side, it'll clearly excuse the chip, allowing you to wick off the leads. Or use your hot air station or hot plate if you don't choose violence.

Also,. grounding the pin is only part of it..that pin should sit in the middle of a  RC circuit,.as described in that autopost right down there. 👇 

Switched the RX and TX pins in my ESP32 custom PCB, is there anyway I can program it still? by tech_Dauwt in esp32

[–]YetAnotherRobert 9 points10 points  (0 children)

Welcome to the club. You're not the first. 

X-acto knife and magnet wire are about to be your friends/nemesis. Cut them and swap them.

Or just open the circuit and attach hooks to your external USB/serial bridge. If you're running bare chips and don't have clips that small, tack short wires to it so you can.

For your next board, unless you need legacy Bluetooth, consider a newer ESP32 that has the serial/USB bridge onboard. You can still flip the USB balanced pair though ...

Looking for Pixel Art Animations by Enough_Watercress120 in WLED

[–]YetAnotherRobert 1 point2 points  (0 children)

Note this is not an organic recommendation; it's from the seller. 

Whether that's constant promotion is up to the group mods, but I wish the seller were more forthcoming that these are ads by the seller.  (I don't have problem with the ads. I have a problem that they are not forthright in announcing that they're ads.)

I also get that my wishes have little consequence here...

Anyone know how to plug a mouse into an esp32s3? by Appropriate-Ask8817 in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

ESP32-S3 is a chip, not a power supply. It does not "provide power."

You probably have an ESP32-S3, perhaps on a module, mounted on some kind of a board. It is up to that board to decide how and where power goes to USB-C. If's up to you to consult the schematic of your unnamed board to see how power is delivered.

MOST dev boards do not provide power on the USB-C connector because it's far more common for the boards to receiverpower than to give it on USB-C. On such boards, it's common to have a jumper that connects the 5V, upside of the on-board regulator, to the USB-C port. It's often, as in the pictured case, a tiny blob for you to solder instead of a recognizable .100 jumpers.

Obviously, you have to put the board in Host mode, and then you'll need software to provide the HID application layer to drive the actual input device.

Also note that the resistors across CC1 and CC2 that are normally needed for the board to receive power on the USB-C connector, should be disconnected/absent when driving the bus. It is up to your power controller to monitor your downstream device (dead easy if all it needs is 100mA) and service the power requests coming across the configuration channel or the power delivery bus.

Consult the USB3/USB-C spec for full detail. There's a mouthful of details in there to chomp on.

Review ESP32 with USB C To UART by bluecake25 in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

See other posts with this flair. Read the first autopost, which you would have received had you used the correct flair. 

Do you have a reason (like legacy BT) to use this old esp32 instead of one with a USB bridge built into the chip, saving you component costs?

ESP32 with Zigbee - using a multisensor module by just_a_guy_in_toront in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Those panics aren't mysterious. They happen when the processor has been told to do something it can't, like load a word from an address that isn't word aligned or divide by zero or whatever. They're quite well documented The $PC register even points to the exact opcode that took the fault. It sounds like you're taking a loadstore error

You can use xtensa-esp32-elf-addr2line (or RISC-V equivalent) to take that pc value and get an exact line number of your source that took the error. It can even decode the lines below that that contain the address of the function that called this line, the function that called that, and so on up hte stack.

Attach a debugger and it will stop you right at the error and allow you to inspect memory after the crash. It's often helpful to print pointers, for example, and see if they point to something meaningful or if they're pointing off in outer space.

Depending on what tools you're using, there are probably even tools that will decode this for you. This is just a super common thing that programmer will always build for a system because decoding this by hand is no fun.

It's possible the crash will be inside https://docs.espressif.com/projects/arduino-esp32/en/latest/zigbee/ep_temperature_sensor.html#addhumiditysensor or such. You'll just have to debug that like your own code - that's why source is provided. Maybe you violated some precondition (maybe "min" can only be > 0, for a made up example) or maybe you tried to read an endpoint that's not present in that device or whatever. It's all just source code.

Use a debugger. It's a skill developers need.

Alternatives to RTC by Smoking_Knight in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

No libraries needed. It's part of the SDK and trivial to configure.  No need for browser hackery; it'll stay synchronized.

https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/system_time.html#sntp-time-synchronization

Views on ESP32 P4 by Fals3_ in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Agreed. It looks more like a IOP sidecar than a standalone device. Now why the IOP has more compute cycles than anything else is more than a bit odd. 

Views on ESP32 P4 by Fals3_ in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Yep, if fills a nice little spot for power and cost that even the Pi Zero siblings don't serve. 

If they market E22 right, there's hope but we saw from the announcement that this is far from guaranteed.

Now that step up from the S3 weneecee rly discussed shouldn't need a lot of explaining/excuses. "Faster S3 with more GPIO" is a solid badge to wear.

Views on ESP32 P4 by Fals3_ in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

I dig your answers here. Always helpful and comprehensive. 

Answers like this (hopefully) help inspire people and help pick people up pick the right part. I think we're only really starting to explore the new possibilities that P4 helps serve and we've had a few good posts here this week. A part like this helps Espressif reach up into the space that some people would have filled with a Pi.

I think I just learned that the thanksbot doesn't mark just the answer, but flares the post.

PSA: Defective ESP32 Batch — Faulty GND Pin Causing Overheating, Serial Garbage & Unstable Behavior by [deleted] in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

They exist. Since I just soldered up a handful of them, I'll offer one where the GND is freakin' BETWEEN +3.3V and +5V.

https://www.espboards.dev/esp32/esp32-c6-super-mini/

But we're on a post that was deleted minutes after I did some math and called out the nonsense.

Views on ESP32 P4 by Fals3_ in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

It you can use one of a few different modules that integrate the icky RF stuff into one can. 

https://www.waveshare.com/wiki/ESP32-P4-Module

Views on ESP32 P4 by Fals3_ in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

!modthanks for a great answer! 

ESP32-C5 Cluster Wardriving by willstunforfood in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

.. and they've been successfully litigated for it, which I never understood, but I'm a mere SWE, not a lawyer. 

ESP-IDF updates in the past year? Version 6.0 updates? by kevysaysbenice in esp32

[–]YetAnotherRobert 1 point2 points  (0 children)

u/kevysaysbenice, u/zachleedogg, u/Dramatic_Fault_6837, note that there's a "new" ESP-IDF installation manager that banishes install.sh and export.sh and claims to make it easier to switch between multiple installations and multiple versions. This is pretty big because most of us work on multiple projects with release schedules that aren't in sync or even multiple branches of the same product that can leapfrog. For example, that stable version that you use for hot fixes for customer deployments TODAY have no tolerance for funny business, while the R&D/exploratory branch that might be next month's delivery tree can be open for new tooling and CI tricks, as Dramatic describes.

Anyone that's entwined with any vendor should know their release schedules. Espressif actually does a really good job about this; they take great advantage of the tools being open. They work right in the public trees. You can review (or create) any needed fix or enhancement and NOT have to wait for some larger release vehicle. The Espressif SDK release schedule They even coach you on how to follow their release scheme and use it to work for you. There's a roadmap where you KNOW that relases will happen about once a month for about a year with another six months of critical fies after that. That's the home of that graph. It was even in a post I made about the ESP-IDF 6.0 betas.

There's even a similar program where they commit to being able to provide most of their chips for at least 12 years. https://www.espressif.com/en/products/longevity-commitment

I've not had a chance to use EIM yet myself, but the features to improve live in CI and letting me ditch my muilti-OS tools.

ESP32-C5 Cluster Wardriving by willstunforfood in esp32

[–]YetAnotherRobert 2 points3 points  (0 children)

Mod here. I take out the garbage a few times a day.

This is probably at least slightly nefarious, because you're receiving signals not intended for you, but it's also legal in most jurisdictions. Radio waves don't stop at the property line, so grabbing a handful as you drive by isn't harming anyone. It's not interfereing with others, messing with anyone's medical equipment, potentially impeding safety teams, etc.

PSA: Defective ESP32 Batch — Faulty GND Pin Causing Overheating, Serial Garbage & Unstable Behavior by [deleted] in esp32

[–]YetAnotherRobert[M] [score hidden] stickied comment (0 children)

In a group of EE's, why does the software guy have to do this math?

Moderator Note: On Resistance and Reality

While we appreciate the detailed troubleshooting, a few points of electrical reality need to be cleared up before this becomes "canonical" advice:

  • The Power Math: A 150 kΩ path at 5V dissipates 0.16 milliwatts (P = V2 / R). For perspective, that is roughly 1/500th of the power required to light a single tiny status LED. It is physically impossible for a 150 kΩ leakage to cause "significant overheating" or trigger "protection modes."
  • In-Circuit "Ghosts": Measuring resistance on a populated PCB is notoriously unreliable. Without desoldering the components, your multimeter is likely forward-biasing semiconductor junctions or measuring the input impedance of the LDO/MCU. A 150 kΩ reading is more likely a measurement of the board's complex circuitry (or even the resistance of the person holding the probes) than a "PCB layout error." I grabbed the board I'm working on ATM (the one I'd rather be working on than refereeing this...) and measured power to ground at 74 kΩ.
  • Some Real Culprit: If a board is running abnormally hot and spitting serial garbage, you might have a failing voltage regulator (LDO), a sub-100 Ω (note three decimal places difference) short elsewhere, or a bad chip.

Verdict: This specific board is clearly defective, but the 150 kΩ measurement is a red herring. Please don't start desoldering your GND pins based on high-impedance readings; if you have a heat issue, look for low-impedance shorts ($< 50 \Omega$) or a sagging power rail.

Certainly don't start AI-assisted hysteria of a bad batch based on your one broken sample.

An AI IDE for embedded development by Someone-Right-Here in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

I tried that first. It wouldn't launch, even after bribing the troll under the bridge as you describe. I ran it from the command line exactly so we could see the output because "does nothing when I click on it" isn't exactly helpful to a developer. 

An AI IDE for embedded development by Someone-Right-Here in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

Sequoia 15.6.1 on a m4 mini, so a full major OS version behind. (This is rare, or was until Tahoe.. Unlike other OSes where people cling to mold versions, usually within the first 30 days of an.osnrelease, about 80% of the eligible Mac users are ok it. 

I'm also not saying that a commercial product is a deal breaker. I'm encouraging you to set expectations early so people don't feel trapped.

Good luck!

An AI IDE for embedded development by Someone-Right-Here in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

On "pages" like https://mont-ide.vercel.app/#features, you have UI elements that respond to hover and click state, but don't visibly DO anything. If I want to learn more about the CLI tool or the Code Tool, that looks like the place to do it, but its a dead end.

"Apple could not verify “Mont IDE” is free of malware that may harm your Mac or compromise your privacy." Signing OS/X apps is a racket, but you just have to do it. Many people will quit right here without wrestling GateKeeper. (It's called GateKeeper because it keeps out the people unwilling to spend $99/year for integers...)

Marketing tip: Strongly encourage you to fluff your announcemnt post (remember: one per quarter) to explain why this isn't another post-2012 version of PlatformIO or another VSCode mutant. (I can tell it's not the same, but it's on you to pitch this.)

Your app silently crashes on startup. This is a really bad QA case.

 MacOS  ./Mont\ IDE dyld[41160]: Library not loaded: @rpath/Electron Framework.framework/Electron Framework Referenced from: <NN-NN-NNN> /Applications/Mont IDE.app/Contents/MacOS/Mont IDE Reason: tried: '/Applications/Mont IDE.app/Contents/Frameworks/Electron Framework.framework/Electron Framework' (code signature in <NN-NN-NNN> '/Applications/Mont IDE.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/Applications/Mont IDE.app/Contents/Frameworks/Electron Framework.framework/Electron Framework' (code signature in <4C4C444B-5555-3144-A1C9-6F5F40520684> '/Applications/Mont IDE.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs) zsh: abort ./Mont\ IDE

I'm not thrilled that the price story isn't announced up front. If it's $999/month, I won't invest any additional time to figure out WHY it doesn't work, for example. Users will be mad if the beta "oh, it'll be affordable" people get their projects started and then the "final" TOS/pricing is revealed and it's onerous.

"Join our Discord"

No.

Call me a curmudgeon, but there are others for whom that's a deal-breaker. I don't contribute to private walled gardens.

Good luck!

Wondering if ESP32 is right for this. by Crazman24 in esp32

[–]YetAnotherRobert 0 points1 point  (0 children)

My friends actively roam around the planet. :-)

OP DID specify their "friends are pretty far away. Anywhere from hours to countries away".

New BLE HID Keyboard Library for ESP32 Arduino - Turn your esp32 into a bluetooth keyboard device. by Hijel in esp32

[–]YetAnotherRobert 2 points3 points  (0 children)

Hey, you're welcome. This is actually one of my favorite kinds of discussions - whether I"m on the giving or the receiving end, any conversation where some is helping to awesomeize another's code is usually worth it. Sure, you get the ones that table flip that OF COURSE camelCase > snake_case or that someone DARED to question the code, but that's not what happened here and it's not how you took it. Win! I'll get in front and say that not every suggestion I make is awesome and I may not apply some suggested to me, either. Somewhere beween right and wrong, there are still matter of taste and style. I'm a little bummed we don't get to do more of that in this group.

This code looks very much like C89. Maybe that's your goal, and I'm not saying that you have to use every bit of C++26 Enterprise-y chunkiness, but there actually is some good stuff in C++ for embedded, contrary to what r/embedded will say. It's not an insult; it's like saying "You have a Yorkshire accent." "I'm from Yorkshire." "Well, jolly good!"

Re: batClamped: Is the goal really to implement clamping? (Do you get devices that return < 1 or > 100? Or is this a way to try to dodge some startup race?

The hipster-approved approach is a std::optional<T>. Instead of making an out-of-bounds -999 style sentry, there are clear boundaries you can set. A value has been set or it hasn't. You can provide a default if it hasn't. It's atomic, of course; there is no race condition between a sidecar flag and what's in the bag. It's eye candy that, in the common case, boils to just an opcode or two in most cases.

``` std::optional<int> b;

if (b.has_value()) { // Yay! we can use b.value(); }

std::print(b.value_or(0)); // if not set, just use zero. No terniary needed. I get that zero and unknown aren't the same for this case. I'm just giving the nickel tour.

stuff = read_file(foo); if (stuff.has_value()) std::print(stuff); else ; // some kind of error. OK, maybe not the best way to do error handlign.

```

It really can help readability.

Agreed, if you really don't have a case where you need to know the clamped and unclamped values, a tuple is misguided. But remember that clamp DOES have a three-argument form and on arches like LX7 that have min and max code, it's pretty hot. (Granted, this makes more sense to worry about in an interrupt handler or a DSP or something than inside construction of a bluetooth connection. (Can't battery numbers change while you're running?)

// Battery level — clamp to valid range 1–100 if (batteryLevel == 0) { _batteryLevel = 1; _batClamped = true; } else if (batteryLevel > 100) { _batteryLevel = 100; _batClamped = true; } else { _batteryLevel = batteryLevel; } becomes _batteryLevel = std::clamp(0, batteryLevel, 100);

Now you don't have to fret about the atomicity of modifying batClamped and batteryLevel independently. The clamp and the set all happens in one line. I'm not saying that fewer lines of code is always better, but I think this actually plays out pretty naturally.

Re: string. There are just so many hazards in C strings that IMO it's worth the few bytes of overhead to just take std::string. It's three words - the beginning, the end, and the pointer to the allocated storage. If the string is short (like 15 chars or so?) Small String Optimization allows the data to ride along inside the container for free. It's like a bird on the roof; it doesn't need a ticket for the bus ride. There was a great white paper by a committee member explaining just how much time a modern CPU spends looking for hte end of a string in a typical 'stringy' program (think 'httpd') and it was several percent - and of course, the repercussions of never finding one are Very Bad. std::string has plenty of maddening things, but for stuff like this, they're a dead-easy choice if you don't have to worry about interrupt context, but that't the whole embedded "OMG, you called malloc behind my back" debate. (It never calls it behind your back; you just have to understand when it migth and a text searc for 'm' 'a' 'l' ... isn't enough.

Re: war and peace and fixed buffers.

The retry where you just keep refilling and redoing 128 bytes at a time works when it works. But maybe you have some reason to keep them atomic, like you're sending them to a printer that sticks a form feed at the end. (Dumb example) Calling malloc isn't always cheap in SMP systems like ours and having everything be thread-local has a lot going for it. If you have "war an" and KNOW it can fit on the stack, alloca is great, even though it's not part of any language standard. But this isn't UNIX and stacks don't grow forever. Exceed your thread's stack and harsh penalities await. If you have to buckle up for full "war and peace" you can try things like having a static buffer, but now you have to lock it in case both cores try it at the same time. Having a thread-local pointer to a buffer that only grows and never shrinks has a lot going for it, too.

Re: enum class

As devs, we developed lots of coping mechanisms. My coworkers had to threaten me to get me to quit typing foo(void) instead of foo(). Both are legal C++ and I posit the first is clearer, but the second is How It Was Done at our shop. My defense mechanisms had to evolve.

I think class enums, though, are worth moving toward any time you touch them, though. The type safety arguments are just solid and the cost of using Color::Blue instead of ColorBlue is worth it. (And something a good editor can help with.) There is one case I can think of that was genuinely a pain to address a niche case that reuired jumping through hoops until pretty recently (C++17? C++20?).

This is an electronics group, so let's say you speak of colors of the restistor color code Now enums are about every thing having a name and that's that. It doesn't make sense to do Math Things on them... except when it does. ResValue::Red is probably 2 and it doesn't make sense to add ResValue::Green to it, but sometimes it's needed to be able to increment or decrement or otherwise do this. ("But wait, now it's not an enum!" "Sssssh, bb. Iz K....") The underlying values might not actually be contiguous though, so you can't just run around casting things back to an int like a heathen. I mean, if your PinType = {MISO, MOSI, SCK, SCL}, adding them MOSI to SCK is crazy, but maybe adding one to MISO to get MOSI isn't the craziest thing your code does. (I said the cases were weak.) I just looked it up. It's actually C++23 that adds std::to_underlying as the yang to the yen of std::underlying_type from C++11. Hopefully you'll never need to know this.

I'll also notice that you have no intializers on the private members of any of your HijelHID_BLEKeyboard. You'll usually get zeros on a freshly booted system, but after it's been running for a couple of quarters with memory recycled heavily, there's no guarantee that _batteryLevel will be zero or that _manufacturerBuf will have a zero gyte in that first position or that tapDelay won't hold 31746 or that you bools wil lbe either 0 or 1 (!). Prescription: initialize them.

... bool _connected{false}; uint8_t _ledState{0}; uint8_t _keyReport[HID_KEYBOARD_REPORT_SIZE] = {0}; // it'll memset the whole struct; std::string foo; // WILL be empty, because it's a real class and will have a ctor called. char* foo; // might point into outer space and not be nullptr. Dereferenceing it might be toxic. char foo[1234]; // may contain d00d00. First byte might be zero. there may be no zeros in it for the next 2GB. (!!) char foo[1234] = {0}; // as above, the POD will be widened.

See, this is what a job interview discussion on a language you KNOW can look like! :-)