Close

Going WIFI - Integrating Liblouis

A project log for BrailleRAP DIY Braille embosser

An Open source Braille embosser in the spirit of RepRap

stephaneStephane 10/10/2023 at 13:080 Comments

Now that we have a working solution to enable a BrailleRAP as wifi access point, and giving access to BrailleRAP feature via a mobile web app. It's time to give a try to a more useful Braille Translator : LibLouis.

Liblouis is an open source Braille translator library : https://liblouis.io/. A  nice library giving you the feature of translating text in Braille in 200 Braille standards, for many languages all over the world.

We've already done the work in AccessBrailleRAP, compiling all liblouis code and data files in a webassembly to build our react app with accessibility features (ie aria- html tags). But in AccessBrailleRAP the liblouis WebAssembly is about 12 Mo, no way to integrate that in a 4 Mb ESP 32.

The great idea at the bases of liblouis, is that the library itself is 'just' an interpreter for grammar file defining how you can translate a language into Braille dots patterns.

So we test selecting a subset of language (english, french, german, spanich, italian, portuguese) and build a webassembly with all the files needed for these languages:

"unicode.dis",
"spaces.uti",
"latinLetterDef6Dots.uti",
"latinLetterDef8Dots.uti",
"digits6DotsPlusDot6.uti",
"litdigits6DotsPlusDot6.uti",
"loweredDigits6Dots.uti",
"litdigits6Dots.uti",
"digits6Dots.uti",
"latinUppercaseComp6.uti",
"IPA-unicode-range.uti",
"braille-patterns.cti",
"fr-bfu-comp68.cti",
"es-chardefs.cti",
"en-ueb-chardefs.uti",
"fr-bfu-comp6.utb",
"en-ueb-math.ctb",
"en-ueb-g1.ctb",
"es.tbl",
"es-g1.ctb",
"de-comp6.utb",
"it-it-comp6.utb",
"it.tbl",
"text_nabcc.dis",
"pt-pt-g*"

After rebuilding the webassembly with the selected file the verdict is :  493 Ko ! this is much better than 12Mo.

We then upgrade our previous  ESP32 firmware with our new Braille translator , just adding a combo box to select the Braille standard you want to use. And everything work fine, we now have up to date Braille translation available, allowing to use BrailleRAP embossing features from a single mobile phone.

the firmware code for ESP32 is available here : https://github.com/braillerap/espbraille

Discussions