The guid of customizing a firmware based on RUI!

As you know, RAK has supplied an IoT SDK named RUI for users to customize their own firmware according to their personalized usecase, even they can make a personalized product easily based on RAK IoT modules like RAK811, RAK4200, RAK4600, RAK4400, RAK8212, and RAK5010.
RAK has supplied a set of RUI APIs which you can find here:
and some more and more product practice source code for reference:

and an online compiler which you can get a account here by yourself freely:
You can use RUI online compiler according to this document:

Actually, you can think that RAK7204, RAK5205 and RAK7205 are some customized products which are customized by us based on RAK811 module according to the above resource, and we’ve open source the customized source code of them on Github (The above product practice source code link). So, you can customize a personalized product according to your good idea based on RAK IoT module surely.
RAK sincerely hope that “RUI software platform” + “RAK IoT modules” can help you to create more and more amazing IoT products!

I’ll update more and more information in this topic about RUI.


Hello, everyone!

Thank you for using RAK products.
RAK team has developed a simple web version RUI online compiler which is much easier to use than the commandline compiler:
You can create an account by yourself now. More details, please have a look at the document “How to use RUI online compiler”:

1 Like

Hi @Fomi
I think there is a problem with RAK RUI online compiler. It seems some files in its directory missing.
Below is the output log of online compiler:
mkdir _build
CC sx1276-board.c
CC gpio-board.c
CC rtc-board.c
CC timer-board.c
CC i2c-board.c
CC adc-board.c
CC spi-board.c
CC board.c
Copying file 20.00%
…//Source/stm/STML151/board/board.c:16:10: fatal error: rui.h: No such file or directory
#include “rui.h” ^~~~~~~
compilation terminated.
stm/Makefile_stm32l151cb:246: recipe for target ‘_build/board.o’ failed
make: *** [_build/board.o] Error 1
make: *** Waiting for unfinished jobs…
Copying file 30.00%
Copying file 40.00%
Copying file 50.00%
Copying file 60.00%
Copying file 70.00%
Copying file 80.00%
Copying file 90.00%
Copying file 100.00%

I used the source files from Products_practice_based_on_RUI-master in RAKWireless GitHub.

Hi @mojtabazare1371,

I think maybe you forget to copy rui.h to your project folder. rui.h is in this folder:

Hi @Fomi
Yes, It’s working now!

Hey All,
I am seeing this error when I include and when I omit the rui.h file. Additionally I do not have a board.h, where should that file come from. The links to customizing the firmware above do not point to anything talking about customizing firmware. The links only go to configuring the gateway and nodes.

What does it take to get the RAK811_app running? Thus far I have added the rui.h to the directory, zipped it and used the online compiler.


Hi @megaplow,

Sorry, these links are old, and i’ve just updated them.
In a word about how to do customization, you just need to do your customized Application (or use RAK811_app on Github directly), and compile it on RUI online compiler.

1 Like

Hello trying to use the compile and compiling the ADC folder i get this error:

Is it the compiler?


The asnwer is yes…i then fing a newer BETA RUI compiler (newer) and the error does not exist anymore.

Beta RUI where it is avaiable?

Welcome to RAK forum @Jaloten12 ,

The latest is here -

Updated example codes are here - GitHub - RAKWireless/Products_practice_based_on_RUI_v2.0

Be carefully with theRUI ADC! because if you are working with batteries and your VCC isn’t 3.3V your calculations will be wrong, because RUI ADC functions assume Vref=Vcc=3.3v always. There is no way to use internal voltage source as Vref with RUI

1 Like

you said two things that alerted my interest.
One: if you are using batteries your VCC isnt 3.3…can the RAK811 be powered with voltages above 3.3?
Two: can we use the a internal voltage source with the RAK811?

Yes, but probably no more than 3.9V which is the absolute max operating voltage of the semtech chip inside. I don’t know the absolute max of the other chips inside ( oscillator, power amplifier)

It is impossible for now to use the internal voltage source in RUI for RAK811. So basically ADC is useless if you plan to use RUI and disposable batteries ( ~3.0v )

1 Like

Sadly, you are right. You need to have an external buck-boost board that can adapt to large voltage range input that will still have an output of 3.3v.

1 Like

I see…
On a remote note, i am facing an issue on reading the ADC on the RAK811 using the arduino IDE on this library.

The AnalogRead on a ADC pin gives me a 0 value.
Any idea?

Hi @bioshock2k ,

I haven’t tried the ADC of STM32DUINO of RAK811 yet. But can you share your code? Also on what pin you put the analog voltage?

Btw, best is to create an issue ticket on STM32DUINO itself - GitHub - stm32duino/Arduino_Core_STM32: STM32 core support for Arduino. They are the ones handling the code and probably they can answer quickly if there’s an ongoing issue with the ADC.

1 Like

Hi @carlrowan ,

Yes i can, I´ve started by doing a ADC test using PB14 and PA3(but i´ve tried other adc Pins) code as follows:

#include <arduino_lmic.h>
#include <arduino_lmic_hal_boards.h>
#include <arduino_lmic_hal_configuration.h>
#include <arduino_lmic_lorawan_compliance.h>
#include <arduino_lmic_user_configuration.h>
#include <lmic.h>

#include “STM32LowPower.h”
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>

#include <Arduino.h>
#include <NewPing.h>
#include <MedianFilter.h>
#include <Wire.h>

int ADC_pin=PA3;
int ADC_pin2=PB14;
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 26,
.rxtx = 32,
.rst = 21,
.dio = {27, 28, 29},

void setup() {
// put your setup code here, to run once:
while ( !Serial ) delay(10);
Serial.println(“System Starting…”);
pinMode(ADC_pin, INPUT);

void loop() {
// put your main code here, to run repeatedly:
float battery=analogRead(ADC_pin);
// int battery2=digitalWrite(ADC_pin2,HIGH);
Serial.print("Batery: ");

This was the issue i created in github: STM32L(RAK811 chip) ADC value=0 in arduino IDE · Issue #1395 · stm32duino/Arduino_Core_STM32 · GitHub

For this specific library(by default) you can only use the pins:

#define PA1 PIN_A0
#define PA2 PIN_A1 // ADC_VBAT
#define PB12 PIN_A2

Changing to one of these solved my issue.

1 Like

Nice @bioshock2k . The STM32Duino guys are the real expert on that. They easily spotted the issue.

Thanks for sharing and contributing to the RAK811 STM32duino port :100:

1 Like

they were lighting fast!.
No worries, whenever i can i share :blush:

1 Like