Live data from Hacker News

I dread writing embedded GUIs

blog.benjamin-cabe.com

21–30 of 58 posts

Re: I dread writing embedded GUIs

#21
On an instrustial machine I worked on we got around this by hosting a node.js website on a Linux touch screen panel. There was a redis cache which was updated by a small python script that communicated with the embedded stuff via a serial interface.

If you have the budget for it, this is a great architecture since creating a website GUI is much easier than an embedded GUI. Also, you could very easily pull up the machine control panel remotely from any web browser (with proper remote vs local security enabled of course).

Re: I dread writing embedded GUIs

#22
post #12

On the contrary, I find writing embedded GUIs enjoyable. Sure, it's harder, but also very rewarding. You need an event queue, so you can handle internal and external events the same way. The rest is "just" programming.

Same here.

The constraints he talks about (hardware and memory) I find to be a lot easier to program for because they really put a hard stop to useless abstractions - I find myself just wiring straightforward code and getting things up and running immediately instead of wasting lots of time on design and architecture.

Re: I dread writing embedded GUIs

#23
post #19

Unless the use cases are very simple or there's a special reason not to for most embedded devices I think I'd rather communicate largely with an app (e.g. by bluetooth). I'm thinking for washing machines, dishwashers, aircon, things like that. Unless simple, embedded UIs are usually bad and usually make complex interactions (e.g. setting timers) especially horrible. Whereas android/apple/the web have been optimized f…

Personally I'd rather avoid apps. I already have like seven dozen apps from all the smarthome devices my partner buys. It clutters up my phone, I have no idea how much they're spying on me, and it's a pain to pull out my phone to change some hardware right in front of me.

Let me configure it physically, or do it over a web browser, but preferably the later. Especially for when the servers are shutdown because the product is no longer profitable (looking at you sonos)

Another thing, has anyone seen a well designed software made by a hardware company? They seem very rare. Just look at any printers.

Re: I dread writing embedded GUIs

#24

my takeaway from the article is I hope OP isn't responsible for that lag fest of an animation[0]. I hate embedded stuff that takes ages to animate while the hardware obviously just can't handle it. Skip the animation, and just make it snappy, damn it! There's nothing more infuriating than a slow interface that makes you wait needlessly. [0] https://blog.benjamin-cabe.com/wp-content/uploads/2021/10/re...

OP here :) That animation is laggy on the Renode emulator (at the moment at least), but definitely snappy and 30fps on the real HW...

Re: I dread writing embedded GUIs

#25
post #23
post #19

Unless the use cases are very simple or there's a special reason not to for most embedded devices I think I'd rather communicate largely with an app (e.g. by bluetooth). I'm thinking for washing machines, dishwashers, aircon, things like that. Unless simple, embedded UIs are usually bad and usually make complex interactions (e.g. setting timers) especially horrible. Whereas android/apple/the web have been optimized f…

Personally I'd rather avoid apps. I already have like seven dozen apps from all the smarthome devices my partner buys. It clutters up my phone, I have no idea how much they're spying on me, and it's a pain to pull out my phone to change some hardware right in front of me. Let me configure it physically, or do it over a web browser, but preferably the later. Especially for when the servers are shutdown because the pro…

This is true. If embedded device makers do make an app they seemingly can't resist doing it without vacuuming up your personal data / device telemetry or proxying device connections via their servers.

Re: I dread writing embedded GUIs

#26

my takeaway from the article is I hope OP isn't responsible for that lag fest of an animation[0]. I hate embedded stuff that takes ages to animate while the hardware obviously just can't handle it. Skip the animation, and just make it snappy, damn it! There's nothing more infuriating than a slow interface that makes you wait needlessly. [0] https://blog.benjamin-cabe.com/wp-content/uploads/2021/10/re...

The coffee machine at the office has the laggiest animated interface and as a software developer it's just painful. They have complete control over the hardware and software so there is just no excuse.

Re: I dread writing embedded GUIs

#27
post #14
post #7

That post really resonated with me. I attempted making my own ESP32-based remote for controlling my media centre while I'm in my kitchen, or generally away from my laptop. The nature of embedded with interrupts (e.g. from buttons) and trying to mix in MQTT events and nice multi-layered UI made me completely question my programming abilities. I really wanted to have modals/pop-ups (e.g. to show current volume on chang…

We are definitely spoiled on modern systems. But imo, this convenience is unreasonably costly. It is baffling to me that modern devices with ghz clock rates can hardly render guis and websites responsibly. At the moment everyone swoons over the new M1 processors. Not too long and those performance gains will also be lost to costly abstractions and badly written code. I'm not very optimistic this will change in the ne…

We are already at a point where a cpu (!) based raytracer can outrender some user interfaces. The amount of cycles lost on the equivalent of paper pushing is incredible these days.

Source: my own raytracer vs microsoft teams and 90% of all other electron apps or otherwise very javascript heavy frontends.

Re: I dread writing embedded GUIs

#28

For small systems, LVGL address all of these pain points. It works well with small amounts of memory, maintains a responsive, animatable UI that works over slower display interfaces, and is easy to port with only a small amount of driver code needed to get up and running.

OP mentioned that along with Azure RTOS GUIX deeper in the article.

Re: I dread writing embedded GUIs

#29
post #9
post #3

I suppose I'll be the outlier here, but on more powerful devices like Raspberry Pi or other Cortex-based devices, I have had good luck using LispWorks and their CAPI UI library. Plus, Lisp!

Don't want to put words in anyones mouth, but if it runs linux, it's probably not what the author was talking about. Hence Arduino rather than rpi

Good point! Sometimes I don't know where to draw the line.

Re: I dread writing embedded GUIs

#30
I think this is mostly a problem of finding good tools for your workflow. Admittedly, there are fewer of them in the space of embedded development than for the usual "apps", but there are some. Besides the already mentioned LVGL [1] for the actual GUI you'll need a proper build tool that can handle all that conversion stuff OP's talking about reliably. I can only recommend Bob [2] here. Unfortunately, it's very unknown but brings everything you need for embedded development (w/ or w/o GUI, higher-level stuff like custom Linux images, too). Using it for years professionally and for personal projects and will never look back.

[1] https://lvgl.io [2] https://bobbuildtool.dev

Post reply on HN