Updates on BLE-RC and RC transmitter firmwares
The BLE-RC project continues and is getting some updates again.
Now there are 2 tasks I work on:
-
Persistent storage (to be able to change BLE device name, otherwise all receivers will be displayed as "MicroRC", which is confusing)
-
Support for expansion boards (to connect trailers to trucks, or increase number of channels on a vehicle)
Persistent storage
The firmware now uses fds library from Nordic SDK to read and write device name. A command was added to BLE communication protocol to set it.
Side feature: Unicode support
Since BLE device name is Unicode by standard, it seems like a good idea to have truck names that can be localized. And as a fun excersize, emojis in device name also sound like a fun addition.
On the receiver side, nothing actually needs to be done as UTF8 strings can be stored as normal null-terminated C strings. The firmware doesn’t need to know what is inside and treat it as an array of bytes.
Nothing needs to be done on Android demo app as well, as it supports unicode out of the box. UI for changing the name is missing at the moment.
On ESP32 remote controller side, however, a lot of things are needed. First of all, UI library LVGL supports UTF8 text, which is already very good, but built-in fonts don’t have non-latin characters, not to mention emojis. So additional glyphs are needed to display unicode.
Luckily it is very easy to do, there is an online tool to extract LVGL-compatible data from TTF/OTF/WOFF fonts, https://lvgl.io/tools/fontconverter.
I used Monserrat front from Google fonts for cyrillic letters and Font-Awesome for some vehicle-related emojis.
After adding custom font configuration to lv_conf, no changes to code is needed to make it work.



Support for expansion boards
The idea is that some commands will be relayed to boards connected to BLE board via UART.
This can be a board in trailer; in this case 3 wires are needed to connect trailer: power, ground, TX. Or if trailer has its own power, only GND and TX are needed.
This can also be a secondary board inside same vehicle to increase the number of LEDs or motors available for control.
NRF52810 has only 1 UART, so debug logs will have to go elsewhere if this communication is used. The options are RTT (SWD connection is needed) or BLE.
Another problem is that my current PCB does not have spare pins, so one light channel will have to be sacrificed. The logical choice is to combine marker lights with headlights and reuse marker lights pin as UART TX.
The expansion PCB has been developed in 2024 and its firmware is in development. It has a PY32F003 MCU with up to 4 motors and 7 PWM outputs. It will need its own page on this site later.