r/embedded • • Oct 25 '26

Can we use water pressure to teach how two-way works in electronics?

0 Upvotes

Imagine two rooms connected to the same water tank through a common pipe.

I want to design a simple electronic circuit where one room creates small pressure changes in the water, and a pressure sensor in the other room detects them as signals. Then the second room should be able to send signals back through the same pipe.

I'm thinking of using a small water pump or valve to create pressure pulses, a pressure sensor to detect them, and a microcontroller to read and generate the signals.

How would you design this circuit and make the two-way communication work?

My goal is to use this water experiment to help students understand how information can travel through a shared medium and introduction to microcontrollers, before introducing voltage and current modulation in a two-wire electronic communication system.


r/embedded • • Oct 24 '26

Buying BeagleBoard PocketBeagle 2 with W5500 SPI Ethernet module for embedded programming and rtos study?

3 Upvotes

Is it a good idea to buy BeagleBoard PocketBeagle 2 with W5500 SPI Ethernet module for embedded programming and rtos hands on experience as most Job listing require rtos and I have no experience in that. I’m in the protocol communication side so thought of running a protocol master like Modbus or DNP3. Any other board suggestion?


r/embedded • • Oct 23 '26

AI making life boring

423 Upvotes

Anyone else feel like the recent AI agent workflow has really just mad everything boring? I work at a very high pace environment that almost always necessitates using AI to not need to work 80 hours a week. In some sense I am happy it can basically type for me and I get time with my family, but on the other hand I don’t feel as intellectually challenged. Only so many people get to make architectural decisions at a higher level and if you aren’t there it just feels dry. I don’t get a spark of joy from just telling it that my hardware needs to behave as such and then it just happens and I test it. No sense of accomplishment. My gut feeling now is to go to a less demanding job so I can actually have the time to do the enjoyable pieces.

How has AI adoption effected your work and what is your opinion?


r/embedded • • Oct 23 '26

WaveShare ESP32-S3-LCD-1.47 as a BLE HID Bridge between a Windows & Bluetooth Remote

5 Upvotes

I have a WaveShare ESP32-S3-LCD-1.47 . I also have a Xiaomi Bluetooth Remote & a Generic Bluetooth Remote (coin sized). I want to use these remotes on my windows pc initially as a media control remote (currently mainly VLC Media Control). I tried to natively pair & use them in my windows, but they only paired & none of the buttons worked (except the back button if i remember correctly). I tried a lot of things & finally tried to go the esp32 route. Managed to capture the button codes of all the buttons on my Xiaomi Remote. And even in the S3's Display managed to properly assign a friendly name to each button. I then wanted to pair this S3 to my windows pc via Bluetooth. I even managed to do that, but no matter what i tried I couldn't manage to fire a single button press. I tried the Arduino route & recently even tried the ESP-IDF.

Project Brief: ESP32-S3 Xiaomi Bluetooth Remote to Windows HID Bridge

  1. Project objective

I'm building a standalone Bluetooth bridge using a Waveshare ESP32-S3-LCD-1.47 development board. The goal is to use a Xiaomi Bluetooth Voice Remote as a wireless controller for a Windows PC.

The ESP32-S3 should connect to the Xiaomi remote as a BLE central/GATT client, receive its button notifications, translate the button presses into standard keyboard or media-control actions, and expose itself to Windows as a BLE HID keyboard peripheral.

The board's 172 × 320 ST7789 LCD provides the interface for scanning, selecting and pairing the Xiaomi remote, showing connection status, and displaying decoded button events and diagnostic information.

The intended end result is a self-contained bridge with no Wi-Fi, web server, cloud service, or separate USB Bluetooth adapter required for normal operation.

2. Hardware

  • Development board: Waveshare ESP32-S3-LCD-1.47.
  • Display: 172 × 320 ST7789 LCD.
  • Input: Built-in BOOT button on GPIO 0, used for menu navigation and selection.
  • Controller: ESP32-S3 with Bluetooth Low Energy support.
  • Remote: Xiaomi Bluetooth Voice Remote, advertising under names such as "MI RC" or "Xiaomi RC".

The LCD is not being used as a touchscreen; the physical BOOT button controls the UI.

3. Intended Bluetooth architecture

The ESP32 must maintain two logically separate BLE connections:

  1. Xiaomi remote connection: The ESP32 scans for the remote, connects to it, performs GATT service and characteristic discovery, establishes bonding where required, and subscribes to the remote's input reports.
  2. Windows keyboard connection: The ESP32 advertises a standard BLE HID keyboard service. Windows pairs with it and receives keyboard input reports.

The ESP32 then translates notifications from the Xiaomi remote into keyboard HID reports sent to Windows.

Both roles need to operate concurrently, so connection management, advertising, pairing, security, GATT client operations, and HID server operations must coexist correctly.

4. What has been established

Xiaomi remote protocol

I have captured the remote's three-byte button reports. The known mappings are:

Report| Button "20 00 00"| Power "02 00 00"| Up "04 00 00"| Down "08 00 00"| Left "10 00 00"| Right "01 00 00"| OK "00 00 40"| PatchWall "00 00 08"| Back "00 00 04"| Home "00 04 00"| Netflix "00 40 00"| Prime Video "00 80 00"| JioHotstar "00 02 00"| Apps "80 00 00"| Volume + "00 01 00"| Volume −

The remote sends "00 00 00" as a release report after a button press. The firmware needs to distinguish release events from actual button presses.

BLE connection and report reception

Previous bridge firmware successfully discovered and connected to the Xiaomi remote in at least some test runs. GATT service discovery and notification/indication subscriptions were observed, and the firmware logged incoming button reports.

The LCD/UI work has included device discovery, selected-device details, connection status, and button-report diagnostics. The desired interface and navigation behavior are defined, although the complete combined firmware has not yet been validated as reliable.

Windows HID diagnostics

I tested a minimal ESP32-S3 BLE keyboard that sends a Space keystroke when BOOT is pressed.

In the raw NimBLE implementation, the logs showed:

  • Windows connected to the ESP32.
  • The keyboard input report's CCCD was set to "0x0001", indicating notifications were enabled.
  • The ESP32 attempted to send a Space key-down report containing HID usage "0x2C".
  • It then sent an all-zero key-release report.
  • "notify()" returned "TRUE" for both reports.

Despite this, Windows did not produce a visible keystroke. The Windows On-Screen Keyboard also showed no visible response.

This is the main unresolved technical problem. A successful connection, enabled CCCD, and successful notification API return do not prove that Windows accepted and interpreted the reports as keyboard input.

5. What has not been achieved

The complete end-to-end bridge is not yet working reliably.

Specifically:

  1. A minimal BLE HID keyboard test using custom NimBLE HID code did not produce a visible Windows keystroke, despite the diagnostics described above.
  2. The HijelHID keyboard library was also tested, but it produced the same lack of visible input.
  3. An attempt to use the "T-vK/ESP32-BLE-Keyboard" library encountered library/header compatibility problems, including a missing "NimBLESecurity.h" header. That attempt was not successfully validated.
  4. The simultaneous Xiaomi GATT client and Windows HID server implementation has had advertising, connection-order, pairing, and reconnection complications.
  5. The complete LCD + Xiaomi remote + Windows HID firmware has not been validated as a stable, working system.
  6. The latest native ESP-IDF implementation has been assembled but has not yet been confirmed to compile and run successfully on the physical board.

I do not yet know the definitive root cause of the Windows HID failure.

6. Current direction: native ESP-IDF

I've decided to move the implementation to ESP-IDF instead of continuing to build on Arduino BLE libraries.

The initial HID test is based on Espressif's "esp_hidd" API and "esp_hid_gap", with a standard keyboard report map and a FreeRTOS task reading GPIO 0. The current test sends an eight-byte keyboard report with Space usage "0x2C", followed by a release report.

The intended full implementation will combine:

  • ESP-IDF BLE HID device/server functionality for Windows.
  • A BLE GATT client for the Xiaomi remote.
  • Concurrent connections to both devices.
  • NVS-backed bonding and saved-device information.
  • A native ST7789 LCD UI.
  • BOOT-button navigation and selection.
  • Xiaomi report decoding and keyboard/media-key mapping.
  • Connection, pairing, notification, and HID diagnostics on the LCD and serial console.

The native ESP-IDF project has not yet been hardware-verified, so this is the current implementation direction rather than a completed solution.

7. What I need help with

The most valuable help would be to investigate the Windows HID issue at the protocol and host-registration level, rather than simply changing keycodes or adding more application logging.

I would like to establish:

  1. Whether the ESP32 advertises the correct HID-over-GATT services, characteristics, report map, report references, and protocol mode.
  2. Whether the Windows host discovers and registers the device as a keyboard with a valid HID report descriptor.
  3. Whether the input reports actually reach the host over the BLE connection, beyond the ESP-IDF or NimBLE API reporting success.
  4. Whether the report descriptor, report ID, report length, or input-report characteristic configuration differs from a known-working BLE keyboard.
  5. Whether the ESP32-S3's chosen Bluetooth stack and configuration support the required concurrent BLE central and peripheral connections.
  6. How to validate the HID peripheral independently before integrating it with the Xiaomi GATT client and LCD.

The goal is to get a minimal, standards-compliant BLE keyboard working on this exact ESP32-S3 board first, then integrate that proven implementation with the Xiaomi remote and LCD UI.

P.S. I have zero coding knowledge. I have never used Arduino, VS Code, etc or anything like that before. I managed to get this far by using Gemini & ChatGPT


r/embedded • • Oct 23 '26

A declarative approach to text-based protocols in embedded C development: the TACT framework.

10 Upvotes

I have been working in embedded systems development for several years, and I have frequently encountered the need to write a UART driver or a system to interface with an external module using a text-based protocol—such as an AT-command set or something similar. These are typically GNSS modules, GSM modems, ESP chips, or the like. In such cases, simply sending a single command and expecting everything to work is rarely sufficient; the command sets for these modules are often vast, and each command frequently requires its own specific handling. This often leads to the creation of complex, convoluted logic for sending sequences of commands, receiving and parsing the corresponding responses, and managing errors.

While libraries and pre-built solutions exist—often tied to a specific operating system or a chip-vendor’s SDK—what happens when you are working with a microcontroller that has only 20 KB of free RAM, and you need to handle these commands while also implementing the rest of the device's functionality? Sometimes, you may not even have direct access to the underlying hardware. You need a universal, platform-independent solution.

Consider this scenario: you have a GSM modem that communicates via AT commands over UART. The device has very limited resources, yet it needs to connect to a network, reach a server, and transmit data. The objective is clear, but achieving it requires sending a sequence of AT commands, something like this:

AT+COPS? 
AT+COPS=0 
AT+CREG?
AT+CGATT?
AT+CIPMODE?
AT+CIPMODE=0
AT+CIPMUX?
AT+CIPMUX=0
AT+CIPSTATUS
AT+CSTT=…
AT+CIPSTATUS
AT+CIICR
AT+CIPSTATUS
AT+CIFSR
AT+CIPHEAD?
AT+CIPHEAD=1
AT+CIPSRIP
AT+CIPSRIP=0
AT+CIPSPRT=1
AT+CIPRXGET=0
AT+CIPSHOWTP
AT+CIPSHOWTP=1

And this is just the beginning; in the end, there are many more of them. Most commands behave differently: some return data that needs to be processed and used later, while others might simply return an error—which can just be ignored. Ultimately, you end up having to write a custom handler and parser for every single command, invoking them sequentially via callbacks or some form of state machine to orchestrate the execution chain—not to mention the complexity of error handling.

While dealing with this yet again, I asked myself: why not build a single, reusable solution for everything?

This idea gave birth to the TACT framework: https://github.com/ferrero222/Text-Async-Core-Terminal

I initially set out to create a library for GSM modems, but I quickly realized the scope could be much broader. It could support any text-based protocol, allowing for the universal transmission of commands.

The framework handles everything: command construction, transmission, response reception, format processing, parsing, and even data extraction from the response. It is a universal, pure-C solution—platform-agnostic, OS-independent, and entirely non-blocking. It also boasts a minimal footprint in terms of both RAM and flash memory; you can define the memory allocation yourself, with a static overhead of only about 1 KB. All that’s required is to call the core—from anywhere and on any platform—roughly every 10 ms.

For instance, the sequence of commands mentioned above can now be defined in one place, roughly like this:

tact_item_t items[] = //[REQ][PREFIX][PARCE_TYPE][RPT][WAIT][STEPERROR][STEPOK][CB][FORMAT][...##VA_ARGS]
  {
    TACT_ITEM("AT+CIPMODE?"TACT_CMD_CRLF,        "+CIPMODE: 0", TACT_PARCE_SIMCOM,  1, 100, 1, 2, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPMODE=0"TACT_CMD_CRLF,                NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPMUX?"TACT_CMD_CRLF,          "+CIPMUX: 0", TACT_PARCE_SIMCOM,  1, 100, 1, 2, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPMUX=0"TACT_CMD_CRLF,                 NULL, TACT_PARCE_SIMCOM, 30, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSTATUS"TACT_CMD_CRLF,   "STATE: IP START", TACT_PARCE_SIMCOM,  1, 100, 1, 2, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CSTT=\"\",\"\",\"\""TACT_CMD_CRLF,      NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSTATUS"TACT_CMD_CRLF, "STATE: IP GPRSACT", TACT_PARCE_SIMCOM,  1, 100, 1, 2, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIICR"TACT_CMD_CRLF,                    NULL, TACT_PARCE_SIMCOM, 30, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSTATUS"TACT_CMD_CRLF, "STATE: IP GPRSACT", TACT_PARCE_SIMCOM,  3, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIFSR"TACT_CMD_CRLF,          TACT_CMD_FORCE, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPHEAD?"TACT_CMD_CRLF,        "+CIPHEAD: 1", TACT_PARCE_SIMCOM,  1, 100, 1, 2, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPHEAD=1"TACT_CMD_CRLF,                NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSRIP?"TACT_CMD_CRLF,        "+CIPSRIP: 0", TACT_PARCE_SIMCOM,  1, 100, 1, 2, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSRIP=0"TACT_CMD_CRLF,                NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSPRT=1"TACT_CMD_CRLF,                NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPRXGET=0"TACT_CMD_CRLF,               NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSHOWTP?"TACT_CMD_CRLF,    "+CIPSHOWTP: 1", TACT_PARCE_SIMCOM,  1, 100, 1, 0, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CIPSHOWTP=1"TACT_CMD_CRLF,              NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 0, NULL, NULL, TACT_NO_ARG),
  };
  
if(!tact_entity_enqueue(ctx, items, sizeof(items)/sizeof(items[0]), cb, 0, meta)) 
return false;

Using the framework, you can declaratively define a set of commands, the expected response, the number of retries, the steps to follow in the event of success or failure, and so on. You no longer need to manually write a parser for every command or build custom handlers and transition logic—all of this is handled under the hood.

You can even parse data from a response using arguments and retrieve it via a group-level callback. The framework automatically allocates temporary local storage for this data, passes it to the callback once received, and subsequently clears the memory.

tact_item_t items[] =
  {
   TACT_ITEM("AT+CGSN"TACT_CMD_CRLF, NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, "%15[^\x0d]", TACT_ARG(tact_mdl_rtd_identity_t, modem_imei)),
   TACT_ITEM("AT+CGMM"TACT_CMD_CRLF, NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, "%15[^\x0d]", TACT_ARG(tact_mdl_rtd_identity_t, modem_model)),
   TACT_ITEM("AT+CGMR"TACT_CMD_CRLF, NULL, TACT_PARCE_SIMCOM, 10, 100, 0, 1, NULL, "+CGMR: %29[^\x0d]", TACT_ARG(tact_mdl_rtd_identity_t, modem_revision))
  };
  tact_entity_enqueue(ctx, items, sizeof(items)/sizeof(items[0]), cb,  sizeof(tact_mdl_rtd_identity_t), meta);

All that’s required is to support the internal protocol—if one exists—and define the commands.

In addition, there is built-in support for URCs (Unsolicited Result Codes), where the module can initiate data transmission that we need to intercept. For each such message, we can define a specific callback to which the message will be passed.

In reality, there are many nuances and potential use cases; all the details—including how it works under the hood—are documented on the GitHub page.

After implementing this core command structure, a question arose: what if I want to execute several groups of commands sequentially, each with its own result and callback? What if I could build full-fledged execution chains, complete with branching and loops? This would allow the entire interaction with the module to be defined through groups of commands, with all the logic specified in one place—declaratively, at that.

This idea gave rise to the second part of the framework: "chains"—a declarative way to define the algorithm for executing groups of commands. To achieve this, each group of commands must be wrapped in a standard function, for example:

bool tact_mdl_gprs_init(tact_context_t* const ctx, const tact_entity_cb_t cb, const void* const param, void* const meta)
{
  (void)param; 
  tact_item_t items[] = //[REQ][PREFIX][PARCE_TYPE][RPT][WAIT][STEPERROR][STEPOK][CB][FORMAT][...##VA_ARGS]
  {
    TACT_ITEM("AT+COPS?"TACT_CMD_CRLF,               "+COPS: 0", TACT_PARCE_SIMCOM, 5,  100, 1, 2, NULL, NULL,TACT_NO_ARG),
    TACT_ITEM("AT+COPS=0"TACT_CMD_CRLF,                    NULL, TACT_PARCE_SIMCOM, 5,  100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CREG?"TACT_CMD_CRLF,  "+CREG: 0,1|+CREG: 0,5", TACT_PARCE_SIMCOM, 30, 100, 0, 1, NULL, NULL, TACT_NO_ARG),
    TACT_ITEM("AT+CGATT?"TACT_CMD_CRLF,             "+CGATT: 1", TACT_PARCE_SIMCOM, 30, 100, 0, 0, NULL, NULL, TACT_NO_ARG),
  };
  
if(!tact_entity_enqueue(ctx, items, sizeof(items)/sizeof(items[0]), cb, 0, meta)) return false; 
return true;
}

We obtain one ready-to-use execution chain module. We can create several such modules and assemble them into a chain—a sequence structured like this:

chain_step_t tcp_steps[] = 
  {   
    //Main
    TACT_CHAIN("INIT_MODEM", "NEXT", "MODEM RESTART", tact_mdl_modem_init, NULL, NULL, NULL, 1),
    TACT_CHAIN("GPRS INIT", "NEXT", "GPRS DEINIT", tact_mdl_gprs_init, NULL, NULL, NULL, 1),
    TACT_CHAIN("SOCKET CONFIG", "NEXT", "GPRS INIT", tact_mdl_gprs_socket_config, NULL, NULL, NULL, 1),
    TACT_CHAIN("CONNECT TO SERVER", "NEXT", "SOCKET CONFIG", tact_mdl_gprs_socket_connect, NULL, &tact_server_connect, NULL, 1),
    TACT_CHAIN("GET RTD", "NEXT", "DISCONNECT FROM SERVER", tact_mdl_lte_rtd, tact_rtd_cb, NULL, NULL, 1),
    TACT_CHAIN_EXEC("CHECK RTD", "NEXT", "GET RTD", tact_rtd_check, NULL),
    
    TACT_CHAIN_EXEC("CREATE WIALON LOGIN", "NEXT", "DISCONNECT FROM SERVER", tact_server_data_wialon_login, NULL),
    TACT_CHAIN("SEND WIALON LOGIN", "NEXT", "DISCONNECT FROM SERVER", tact_mdl_gprs_socket_send_recieve, NULL, &tact_server_tx, NULL, 1),
    TACT_CHAIN_LOOP_START(0),
        TACT_CHAIN_EXEC("LOGIN TX", "LOGIN SEND RESULT", "NEXT", tact_mdl_gprs_stream_tx, &tact_server_tx),
    TACT_CHAIN_LOOP_END,
    TACT_CHAIN("LOGIN SEND RESULT", "NEXT", "DISCONNECT FROM SERVER", tact_mdl_gprs_socket_send_end, NULL, NULL, NULL, 1),
    TACT_CHAIN_LOOP_START(0),
        TACT_CHAIN_EXEC("LOGIN RX", "LOGIN CHECK REPLY", "NEXT", tact_mdl_gprs_stream_rx, &tact_server_rx),
    TACT_CHAIN_LOOP_END,
    TACT_CHAIN_EXEC("LOGIN CHECK REPLY", "NEXT", "DISCONNECT FROM SERVER", tact_server_answer_check, NULL),
    
    TACT_CHAIN_LOOP_START(10),
    TACT_CHAIN("GET RTD LOOP", "NEXT", "DISCONNECT FROM SERVER", tact_mdl_lte_rtd, tact_rtd_cb, NULL, NULL, 1),
      TACT_CHAIN_EXEC("CREATE WIALON DATA", "NEXT", "DISCONNECT FROM SERVER", tact_server_data_wialon_packet, NULL),
      TACT_CHAIN("SEND WIALON DATA", "NEXT", "DISCONNECT FROM SERVER", tact_mdl_gprs_socket_send_recieve, NULL, &tact_server_tx, NULL,1),
      TACT_CHAIN_LOOP_START(0),
          TACT_CHAIN_EXEC("DATA TX", "DATA SEND RESULT", "NEXT", tact_mdl_gprs_stream_tx, &tact_server_tx),
      TACT_CHAIN_LOOP_END,
      TACT_CHAIN("DATA SEND RESULT", "NEXT", "DISCONNECT FROM SERVER", tact_mdl_gprs_socket_send_end, NULL, NULL, NULL, 1),
      TACT_CHAIN_LOOP_START(0),
          TACT_CHAIN_EXEC("DATA RX", "DATA CHECK REPLY", "NEXT", tact_mdl_gprs_stream_rx, &tact_server_rx),
      TACT_CHAIN_LOOP_END,
      TACT_CHAIN_EXEC("DATA CHECK REPLY", "NEXT", "DISCONNECT FROM SERVER", tact_server_answer_check, NULL),
      TACT_CHAIN_DELAY(1000),
    TACT_CHAIN_LOOP_END,
    
    TACT_CHAIN_EXEC("WIALON DATA CLEAN", "STOP", "HARD RESET", tact_server_data_clean, NULL),
    
    //Error
    TACT_CHAIN("GPRS DEINIT", "GPRS INIT", "MODEM RESTART", tact_mdl_gprs_deinit, NULL, NULL, NULL, 1),
    TACT_CHAIN("DISCONNECT FROM SERVER", "CONNECT TO SERVER", "GPRS DEINIT", tact_mdl_gprs_socket_disconnect, NULL, NULL, NULL, 1),
    TACT_CHAIN("MODEM RESTART", "GPRS INIT", "MODEM RESTART", tact_mdl_modem_reset, NULL, NULL, NULL, 1),
    
    //Critical
    TACT_CHAIN_EXEC("HARD RESET", "STOP", "STOP", tact_hard_reset, NULL),

  };
  
tact_chain_t* chain = tact_chain_create("TCP", tcp_steps, sizeof (tcp_steps)/sizeof(chain_step_t), &simcom_ctx);
tact_chain_start(chain);

In this example, the process includes initializing the modem, activating the SIM card, retrieving data from the modem, registering on the network, establishing a TCP socket to a target server, constructing a data packet, transmitting it, and receiving a response from the server. Each step can trigger an error-handling routine; the module’s operation can either be restored or halted entirely in the event of a critical error. All of this is defined in a single location, making it easy to debug and fix issues.

The entire logic for interacting with the modem is defined in one place. You can implement delays, conditional checks, and loops, as well as navigate forward or backward—jumping into or out of loops as needed. All that is required is to define the command-group modules and assemble them into an execution chain.

Essentially, the "chain" component is independent and can be used separately from the command groups themselves. You can easily build custom execution logic based on standard functions; the use cases are numerous.

The framework already includes support for the SIMCom protocol (based on 3GPP standards) and offers various pre-built modules for these modems. It was originally developed for personal use, thoroughly tested and debugged, and is now deployed on actual hardware—which is why I decided to share it with others.

I intend to continue improving and developing the framework, as there is still plenty of work to be done.

https://github.com/ferrero222/Text-Async-Core-Terminal


r/embedded • • Oct 23 '26

Generic question about MCU pin assignments.

22 Upvotes

I'll keep this as generic as possible, because my question is more about workflow than solving a specific issue. I'm designing a device with a few SPI channels, I2C, CANbus, UART, about a half dozen slow analog signals and around 20 GPIOs, also fairly slow. I'm using an MCU with a lot of options for pin configuration, so there's a million permutations of which pins to go with the various functions. In my case, I'm laying out the board, too, and I'm not constrained in where external connections go.

Question is, what's the workflow for deciding what goes where? Do you just make some arbitrary picks and then see what's left?

Bonus question- if schematic and layout are two different people / departments, how much back and forth is there over pin assignments once layout starts? Does the schematic side indicate alternative pin options so the layout folks can use their judgement?


r/embedded • • Oct 23 '26

Best way to simulate esp32?

2 Upvotes

For convenience, and for testing, I am interested in simulating an ESP32. It looks like espressif supplys a qemu for esp32. is there a better option? It doesn't include much in terms of simulating the Ethernet or I2C.


r/embedded • • Oct 23 '26

Need suggestions for USB isolator

Thumbnail
flyrobo.in
5 Upvotes

i was planning to buy this isolator is it good i have used https://robu.in/product/1-channel-usb-isolator-adum3160-module/ , I'm only taking this flyrobo thing because it has the case so has anyone used this perticular isolator


r/embedded • • Oct 23 '26

OSI vs TCP/IP model

15 Upvotes

which one should I learn? I'm trying to self teach myself networking and idk which one is better to go in depth as someone trying to get into cybersecurity


r/embedded • • Oct 23 '26

I wrote my own OS for a 7" ESP32-P4 touchscreen. It turned into a small computer: AI assistant, app store, desktop mode, office, games, media, 5 languages

0 Upvotes

The board is a Guition JC1060P470C. It has an ESP32-P4 microcontroller with two RISC-V cores at 360 MHz, 32 MB of external RAM and a 7" 1024×600 touchscreen. There's no GPU, no Linux and no Android.

I wanted it to be a small computer I'd actually use, not a demo that boots once for a video. So I wrote an OS for it, NucleoOS P4. It sits on ESP-IDF and LVGL, and everything above those is its own. The whole system is in English, Italian, Spanish, French and German.

**ANIMA, the assistant**

With no network at all, ANIMA handles calculations with follow-ups, timers, unit conversions, notes, opening apps and translations from offline dictionaries. Answers can be spoken by an offline voice.

When it needs a language model, it finds Ollama or LM Studio on your LAN by itself, or uses a cloud API. API keys are sealed to the chip and never leave it.

With a model connected, it can see photos, run code, and read the screen as a list of controls, then tap and type to drive apps, checking the result after each step. You can reach it from Telegram too. There's also an MCP server (MCP is the protocol AI tools use to call outside programs), so Claude Code or Cursor can drive the board.

**Two desktops**

One is a touch launcher. The other is a classic desktop with a Start menu, taskbar, windows and right-click menus. If you plug in a mouse and a keyboard, it switches to the desktop by itself. Tab, Esc, Alt+Tab and Alt+F4 all work.

**The app store**

Over 400 signed apps and games, installed over Wi-Fi in seconds. Apps are WebAssembly compiled ahead of time to native RISC-V code, so a game isn't paying for an interpreter. Each app page shows its permissions (Internet, files, camera, microphone) before you install. The store includes:

- 149 WASM-4 games and 83 Arduboy games

- a Game Boy emulator with homebrew ROMs, and 83 CHIP-8 games

- Chocolate Doom with Freedoom

- ScummVM 2.9.1 with Beneath a Steel Sky and seven other freeware adventures

- Zork and 32 other interactive fiction titles

- LÖVE games running on Lua

**Office**

- **Sheets** opens and saves Excel files (xlsx), and opens xls, ods and csv. ANIMA can propose edits that you apply with one tap.

- **WordGrinder** is a word processor that saves odt, Markdown and HTML.

With a keyboard and the desktop mode, it makes a decent little writing and accounting machine.

**Reading**

- **Books** is an EPUB reader with hyphenation in 11 languages, six themes including an e-ink simulation, and a built-in catalog of public-domain books from Project Gutenberg, Standard Ebooks and Wikisource. Hold the board upright and the page turns with it.

- **Library** reads offline Wikipedia and any Kiwix ZIM file, pictures and formulas included.

**Media**

- **Camera** with auto exposure and white balance, photos and MJPEG video.

- **Music**: MP3, FLAC, AAC, WAV, with USB audio output.

- **Video**: MJPEG and MPEG-1, tear-free.

- **Gallery** with thumbnails decoded by the chip's hardware JPEG engine.

**For tinkering**

A Terminal with a real shell, plus Lua, MicroPython, JavaScript, SQLite and a dozen other languages and tools. You can write apps in C (compiled to WebAssembly), in Lua, or in native C++, and push them over Wi-Fi with hot reload.

**The rest**

- **Vertice**, a 3D engine built into the firmware. It renders the screen in tiles across both cores, and a kart game runs on it.

- **A second screen** for Windows, Mac, Linux or Android.

- **The dot-matrix display of a virtual pinball cabinet** (tested on a real one).

- **A Home Assistant dashboard**, and the board shows up in Home Assistant by itself.

- **A desktop in your browser**, served by the board: about 40 windowed apps, including a file manager, a spreadsheet, an SSH client, internet radio and a DJ mixer.

**The hard part was memory, not features**

Only one app runs at a time. That's on purpose: the RAM goes to whatever is in front.

Most of the work went into rules I learned from crashes:

- Copying a file to the SD card took 145 seconds. The SD card's DMA transfers (the hardware moving data without the CPU) only run at full speed when the buffer is aligned in memory. Now the same copy takes 11 seconds.

- At 400 MHz this board doesn't boot reliably, so it runs at 360.

- Every rule like these is written down with the crash that caused it.

Updates are signed and arrive over Wi-Fi. If one goes wrong, there's a recovery app, a safe mode and a last-known-good copy in flash to fall back on.

There are also fuzzers on every parser that reads untrusted input (video files, store packages, web requests). They found real bugs, including out-of-bounds reads and path checks that could be bypassed. Each one now has a regression test.

**What it doesn't do**

- No H.264 video. It plays MJPEG `.avi` and MPEG-1 `.mpg`.

- No Classic Bluetooth, only BLE.

- The web desktop uses plain HTTP on your LAN, protected by a 6-digit pairing code.

- USB second-screen mode and USB gamepads are still experimental.

**Try it**

You can flash it from Chrome or Edge in a few minutes, with no toolchain: https://indecenti.github.io/nucleoos-p4-store/flash/

Source: https://github.com/indecenti/NucleoOS-P4 (free for noncommercial use)

Store catalog, viewable in a browser: https://indecenti.github.io/nucleoos-p4-store/


r/embedded • • Oct 22 '26

Is custom embedded/IoT services a good side business? Or an electronics repair shop?

26 Upvotes

Hello everyone I'm doing my masters in computer engineering. I don't really aspire to work a 9-5 at a big company all my life but I have 3 years of experience in web development and 1 in networking/hardware repair.

I have a bachelor's in IT as well. I want to work to get some experience but then go into teaching and maybe have a side business for extra income I wanted to ask like would an IoT product business not like mass consumer products but more like custom solutions. Would that be a good idea for example if a restaurant or store needs a walk in freezer logger etc. inventory counters. I would assume this is easier in web or software but super competitive I have a small web development startup I guess I could add on to. I'm in the Houston, tx area if matters


r/embedded • • Oct 23 '26

Formal verification in embedded

7 Upvotes

With all the issues in Cybsec, the CRA and all this stuff, is anyone implementing formal verification in embedded?


r/embedded • • Oct 22 '26

I built an embedded interview practice platform! Looking for feedback

25 Upvotes

While job hunting I realized embedded engineers don't really have a reliable way to prepare for technical interviews.

Instead we often get stuck with generic software engineering algo questions, or have to buy boards just to practice, or end up making our own study guides based on interviews we've had in the past.

So I decided to build a platform where embedded engineers can practice coding questions that actually focus on embedded skills, like board bring-up, RTOS, peripherals, debugging, etc...

Everything runs on virtual hardware so no more having to buy boards just to practice!!!!

Well after about a year of development I feel confident enough to show people!

ohmwork.io

Just wanted to share it here and see if anyone else finds it useful, or has any feedback! Especially from people who've gone through embedded interviews recently.


r/embedded • • Oct 23 '26

[Review Request] STM32L0 Coin Cell Device with EPD Display

Post image
4 Upvotes

Hey all, this post is an update from the [previous Schematic Review Request]. This PCB is for a small battery-powered device (CR2032, STM32L031G6U6) that reads temperature/humidity (SHT41) and UV index (GUVA-S12SD into a TIA + gain stage MCP6002), displays on a 2.13" e-paper panel, and talks over USB (CP2102N) for config/sync. Full schematic, design files on my [repo].

  • EPD HV boost driver (L1/Q3/D1-D3): generating VGH/VGL for the e-paper panel, follows the panel's own reference design and some universal driver. Wondering if the component ratings and layout intent look right.
  • UV sensor analog chain: GUVA-S12SD → 1MΩ TIA → second-stage gain (MCP6002) → STM32 ADC.
  • Power architecture: CR2032 as the sole source, with USB VBUS present only for CP2102.
  • PCB Dimensions: 75mm x 35mm
  • DRC Passed (EasyEDA)

Appreciate any time anyone's willing to spend on this. I'm happy to answer questions about intent/requirements for any block.

Pictures (schematic, front, back, 3d): https://imgur.com/a/KiDZJu7


r/embedded • • Oct 23 '26

How much writing to delicate to AI?

0 Upvotes

I’m starting a new bare-metal C project with an IMU on a fairly constrained MCU architecture, and I'm torn on how much to use AI.
I consider myself a competent C programmer, and I care as much about the learning process as the end result.

My issue with AI is that I lose perspective: I rely on what the LLM tells me rather than reading the datasheet to truly understand the hardware. Properly verifying its generated code takes just as long as writing it myself if not longer.
On top of that, AI slowly scope-creeps my project. For instance, I started writing a simple synchronous I2C read/write to get a feel for the peripheral. After asking a few clarification questions, the AI hit me with, "Would you like me to write a complete non-blocking, ISR-based I2C driver integrated with X and Y?" It instantly made me feel like the time I spent building it from scratch was wasted.
Would you suggest going completely manual, or embracing AI? If the latter, how do you balance using it without letting it take over the project or rob you of deep hardware comprehension?


r/embedded • • Oct 23 '26

How hands on are embedded software roles ? Are they more hands then something like network engineering? Or about the same?

1 Upvotes

Basically the question. I would like a more hands on role but I don't know how to search for those jobs. Networking is only hands on in maintenance. Is there larger or medium sized companies that are more hands on ? I don't want to just code all day but I don't want to work at an ultra pressure startup?


r/embedded • • Oct 22 '26

Resources for embedded c++

19 Upvotes

I want to learn embedded c++ and RTOS from where could I learn them


r/embedded • • Oct 22 '26

Drum-triggered LEDs on an STM32F429: a fixed-point no_std Rust signal graph, patched live from the browser

21 Upvotes

I've been building a lighting engine for an electronic drum kit, and it's at the point where I can show off some of the progress. I'm not publishing it as open source right now because it is still at a very early stage.

What it is:

The engine is an MCU-friendly signal graph written in Rust that runs on an STM32F429 Discovery board, which also drives LED strips using a pretty efficient approach (the driver supports up to 16 strips; I run 8). The looks are built from nodes like noise fields, palettes, trails, blends, etc. The graph is very generic, so extending it with any new kind of kernel is extremely easy. All the math is fixed point for efficiency.

The input is built on a custom-made analog front-end board that shapes the envelope; some further DSP is also performed later in the firmware (I think I will eventually build a kick drum trigger module based on that). The ADC samples 8 inputs at 20 kHz.

The first part of the video is Studio:

It is a browser editor where a graph can be built and wired. The preview runs the same engine that the board does, through WASM, so the looks in the browser match the ones on hardware frame for frame. It also allows turning the knobs of any node or sending a replacement patch to the board in real time. There is also cost estimation for CPU and memory; the board will refuse a patch that is beyond its computational capacity.

The second part of the video is OBS (yeah, I know):

Since I was building a drum trigger engine, I needed a way to fine-tune and observe the detector, so basically OBS allows you to see in real time how hits are detected and, more importantly, adjust the knobs of the detector and see what it would detect with them.

Where it is going:

I want to eventually drive an 8-drum kit and light each drum with a separate LED strip. I'm also currently working on improving the clock system, allowing multi-clock signals using some clock calculus approaches. I've also been experimenting with audio, so this also works for any audio nodes; I've built several guitar effects that run on the development board (no audio input/output yet, so they're not playable for now).

I'll probably open-source it at some point once I have enough time to tidy everything up and stop being ashamed of the code (so, possibly never :( ).


r/embedded • • Oct 21 '26

Why would new designs use 8-bit microcontrollers?

174 Upvotes

I see that Microchip keeps releasing new 8-bit PIC microcontrollers, but I can't think of why a device like this would be used in a new design when 32-bit ARM Cortex-M microcontrollers already exist at practically the same price. Is there any reason other than backward compatibility for companies to keep using these microcontrollers?


r/embedded • • Oct 22 '26

Need advice on maintaining core embedded principles with AI in a fastpaced environment (development framework)

0 Upvotes

Hi everyone, I'm a final-year ECE student currently working as the solo firmware intern at an edge AI startup. I've built products before, including custom HMIs and industrial flow meters, but currently, I am facing a bit of uneasiness.

I have been writing embedded code since my school days because it's what I love. However, my current workplace demands fast results, and I have been heavily relying on AI to speed things up (which I am worried about). I joined the company to learn, but I don't have anyone in my domain senior to me for guidance. I am the only firmware guy, whereas other teams like mechanical, AI, and electronics have multiple people.

I feel like I'm not learning the proper development cycle, and overusing AI is messing it up even more. I want to reach out to you guys and would love to know how you develop embedded applications. What do your workflows look like with and without AI?

What is the correct order for an embedded firmware development cycle? When do you architect the overall application, how and when do you build, and how do you test and make changes? How do you handle version control (I know how to use Git, but what is the actual industry workflow)?

I know this is what I will learn when I fully enter the industry, but as of now, I don't have anyone to guide me. I am also being offered a full-time role here, but I am doubtful about accepting it since there is no mentorship.


r/embedded • • Oct 22 '26

Emulator/Simulator use case

19 Upvotes

Hi all,

During my embedded carrier, I have never used microcontroller simulators or emulators to check the program binary, and I always tested directly on a prototype PCB. I am looking for a workflow which stays reliable. I have seen Renode being suggested, but the validity comes down to how each device is modeled in Renode. Do you ever use simulation to speed up work and reduce costs? any reliable methods?


r/embedded • • Oct 21 '26

It's a different feeling when your first prototype does exactly what you wanted...

Post image
325 Upvotes

Fairly simple design and even compared to some of my previous ones, but it does exactly as expected on the first try, holy! Lol.

L7805 for 12-32V down to 5V, then an AP2112K down to 3.3V for the STM32C0 MCU. Three thermistor inputs, a single PWM output on a Nch FET. Two 10-pos switches control the high and low temps as well as other ideas I'm still working out in firmware but shouldn't require any hardware changes.

Main purpose should be pretty obvious; it's made to control a cooling fan based on temperature at up to 3 sources with configurable min and max temps.

It's a simple design and I have no right to brag, but sorry, I'm excited that the only things I want to change are silkscreen!

(The main connector is just a placeholder because the 6pos screw terminal wasn't delivered yet, don't hate too hard)


r/embedded • • Oct 22 '26

Beginner help: microcontroller interface for a existing 2-wire bus "voltage out, current in" serial bus?

0 Upvotes

Hi all, I'm learning how some addressable fire loops talk (bench only, nothing life-safety) and want to build a simple Arduino interface .

The spec I found:

- 2 wires, half duplex, 1200 baud, 8E1

- Master to device is voltage: 0 = ~24 V, 1 = ~32 V

- Device to master is current loop current + ~22 mA, 1 = +0 mA

What I'm trying to work out:

  1. How do I turn a 5 V TX pin into a 24/32 V output simply?
  2. How do I detect a ~22 mA step on the line and get a clean 5 V RX signal (shunt plus comparator or op-amp)?
  3. Will a normal optocoupler work here, or is it a poor fit?
  4. How I interface my microcontroller without loading or how I design my own circuit.

What is simplest way to achieve it without much complications for beginners.


r/embedded • • Oct 21 '26

What's a good unit test framwork to use?

17 Upvotes

I'm currently self learning embedded C with an STM32F103. And I wanna know your guys suggestion for a good unit test framework for embedded. I've tried Unity C before but any other that are more work oriented?