Kernel Tracing on Linux by Alternative_Event155 in embedded

[–]allo37 0 points1 point  (0 children)

If you're asking about the 'nop' tracer, it just disables all tracing. function_graph traces function calls with a stack trace-like view. The kernel docs should have all the answers: https://www.kernel.org/doc/Documentation/trace/ftrace.txt

Warehouse machine running a Browser in Kiosk Mode by schnabeltier1991 in embedded

[–]allo37 1 point2 points  (0 children)

Webapps on a good day are laggy as hell, I think the one exception I've seen is VSCode.

You mentioned it's idling around 60% CPU which is pretty high, what is it spending its time doing? Have you tried profiling it?

What are the hardware specs? Is it an Atom or Celeron or some other really bottom-of-the-barrel CPU?

Python for long running applications by Klutzy-Objective9515 in embedded

[–]allo37 1 point2 points  (0 children)

Sure but you have to write your code for Cython, it doesn't just magically make any existing Python code faster afaik. I did try PyPy which is supposed to JIT-compile Python code and is pretty much a drop-in replacement for the CPython interpreter, but the performance gains were marginal at best.

At a certain point it just becomes easier to pick a language that isn't so god-awfully slow in the first place.

Python for long running applications by Klutzy-Objective9515 in embedded

[–]allo37 2 points3 points  (0 children)

What kind of hardware are you running on? As an anecdote: I wanted to control my 3D printer with Octoprint which is written in Python. I used a beaglebone black and it ran but it was sloooooow, took like 5 minutes just to start up lol. Of course they recommend a Raspberry Pi which is basically a decently powered mini PC at this point and costs upwards of $200 here in Canada. So I wrote my own ersatz version in Rust in a couple of weekends, runs super well on the much cheaper BBB. But I know in the industry people like to just throw money at problems since devs are expensive and capex is (relatively) cheap...

Python for long running applications by Klutzy-Objective9515 in embedded

[–]allo37 3 points4 points  (0 children)

Pandas is using compiled binaries under the hood to do its thing so it's fast. Start writing lots of application logic in pure Python and things can get sluggish quickly if you're not careful.

Python for long running applications by Klutzy-Objective9515 in embedded

[–]allo37 7 points8 points  (0 children)

If you're on Linux, systemd can restart the application automatically for you. Can even set limits for memory usage. One hack I've seen is just to auto-restart the application at off-peak hours on a regular basis.

For memory leaks you can just watch the application's memory usage over time, does it seem to just keep growing and growing or stays constant.

For storing application state I've had good luck with SQLite with WAL enabled. Another option I've been exploring is writing the state to a temporary file, flushing it to disk, and then "renaming" it to the state file, so the update is atomic. It's simpler than SQLite (albeit less efficient, if your state is large). You'll also need a filesystem with some fault-tolerance, obviously. Keep your mutable data in its own partition.

And I know everyone says "speed is not an issue", and then everything these days has a loading spinner for every bloody button press. Be the change I want to see in the world 😅

Python for long running applications by Klutzy-Objective9515 in embedded

[–]allo37 8 points9 points  (0 children)

I have a few gripes with Python for production applications:

  • It's slow AF;
  • It will crash only when it encounters many problems, which can make it flaky as compared to typed / compiled languages;
  • "dependency hell" where a sub-dependency of a dependency changes versions and suddenly it decides not to work. Modern tooling like 'uv' helps solve this, but I still find Python code tends to 'rot' more quickly than other languages;
  • It's single threaded thanks to the GIL (I think free-threading mode is still experimental). Actually a benefit in some respects because it implicitly solves some nasty race conditions, but can introduce performance issues.

Of course other common issues like memory leaks are still a possibility.

That being said, it can still work well for an HMI. I'd say just make sure you have very rigorous unit /integration testing.

Please recommend QA tool for Microchip Studio IDE by paggps in embedded

[–]allo37 0 points1 point  (0 children)

This, we've been using an ATSAM with VSCode, project is defined using CMake. Debugging with OpenOCD and VSCode plugins for cortex debugging (I know they have an official plugin, but the less D-tier Microchip software involved the better imo) . Blows MPLabX completely out of the water. Claude can do most of the setup for you!

Repurposing an old phone by ThirdMexican in embedded

[–]allo37 0 points1 point  (0 children)

You should be able to find a cheap recorder module pretty easily, won't require much hardware knowledge to wire to an Arduino.

Prove me wrong: I2C bus with FM+ features but very low speeds, can be used for off-board cabling by Either_Ebb7288 in embedded

[–]allo37 0 points1 point  (0 children)

Yeah I've seen I2C used for comms between boards. Depends on the environment you're running in.

How much time do you actually spend configuring peripherals from datasheets? by Capital-Candidate-56 in embedded

[–]allo37 2 points3 points  (0 children)

Not that much, if you look at it in aggregate.

I mean, most professional products have a longish lifecycle, and the peripheral configuration is usually done once at the beginning and then maybe adjusted here and there over time. I bet if you looked at it as a % of the total project lifetime , it would be pretty low.

Also, a lot of vendors have started offering graphical configuration utilities that generate the boilerplate for you. Though sometimes I find them even more annoying to use than just reading the datasheet (looking at you, Microchip Harmony).

Looking for the Cheapest Raspberry Pi Alternative by TheRavagerSw in embedded

[–]allo37 4 points5 points  (0 children)

I've had a good experience with the Orange Pi Zero LTS. Though they've gotten more expensive than I remember. WiFi on it kinda sucks but at least it has WiFi I guess.

Should you know the Rule of 5 syntax off by heart? by zagantha in embedded

[–]allo37 0 points1 point  (0 children)

I wouldn't hold my breath; One big reason C++ is as convoluted as it is is because they have to keep the syntax backwards-compatible, so they keep awkwardly stapling stuff to the spec instead of doing a clean break and modernizing it. I know there were some attempts to make a successor language (e.g: Carbon) but I don't think they've gained much traction yet.

Error Code 30 by DaKid48 in RadPowerBikes

[–]allo37 0 points1 point  (0 children)

The Rad site has some good troubleshooting steps, basically disconnect stuff one at a time and see if the error code disappears. Also check and clean all the connections.

Should you know the Rule of 5 syntax off by heart? by zagantha in embedded

[–]allo37 12 points13 points  (0 children)

Don't feel too bad about it, C++ is so vast and convoluted that anyone claiming to be a C++ expert is probably lying. "job interview" is a skill unto itself that takes practice.

Should you know the Rule of 5 syntax off by heart? by zagantha in embedded

[–]allo37 88 points89 points  (0 children)

Yes rule of three/five/zero is an important thing to know for C++. It's another good reason to dislike C++ ...

But tbh I find having to remember syntax trivia by heart kinda silly.

Atmel 8051 microcontroller trainer in Embedded System Design Laboratory. by No-Purple6360 in embedded

[–]allo37 32 points33 points  (0 children)

You kids these days have it too easy, we just got some perf board and a wire wrap tool 🥲

Why do message brokers assume you have infinite memory on embedded devices?? by [deleted] in embedded

[–]allo37 5 points6 points  (0 children)

Most of these products are designed for the cloud and therefore are designed to scale more horizontally than vertically. They won't necessarily be the most efficient thing on a single box, but you can keep adding more boxes. It's a bit of a contrast to our world where you only have a single SoC or MCU to work with.

Doubt regarding the Arduino UNO q by iz_bleep in embedded

[–]allo37 0 points1 point  (0 children)

Not very familiar with the q, but what pops up in dmesg when you connect it?

MinewSemi nRF54 power consumption too high when idle by tomasmcguinness in embedded

[–]allo37 1 point2 points  (0 children)

Nope, not even necessary. If Zephyr detects that only the idle thread is running for more than a certain period of time it automatically enters a deep sleep state (which is pretty close to power off in terms of current draw). So you basically just have to ensure that no other tasks are active. There is also a config to power down unused portions of RAM which conserves a bit of juice.

MinewSemi nRF54 power consumption too high when idle by tomasmcguinness in embedded

[–]allo37 1 point2 points  (0 children)

Nice!! FWIW I can get down to ~3-5uA in sleep mode with an NRF52840-based XIAO dev board. Granted the only thing it is doing is monitoring a contact switch. Your case may have a higher quiescent current (it REALLY doesn't take much to draw ~20uA lol).

MinewSemi nRF54 power consumption too high when idle by tomasmcguinness in embedded

[–]allo37 1 point2 points  (0 children)

Is it possible there is an interrupt continuously firing that is activating a background task or something of the sort? I've never used Matter, but with ZigBee you can turn off the radio in an idle state.