RAK811 Tracker - HowTo

  • This is the Code I have been trying to get going

    void TestEeprom() {
            printf("Eeprom test begin");
            char buffer[] = "hello out there";
            char buffer2[64];
            memset(buffer2, 0, sizeof(buffer2));
            memcpy(buffer2, "placeholder", sizeof("placeholder"));
            uint8_t result = EepromWriteBuffer(0, (uint8_t*)buffer, sizeof(buffer));
            printf("Write result: %d\n", result);
            printf(result == SUCCESS ? "success\n" : "fail\n");
            result = EepromReadBuffer(0, (uint8_t*)buffer2, sizeof(buffer2));
            printf("Read result: %d\n", result);
            printf(result == SUCCESS ? "success\n" : "fail\n");
            printf("Read: %s\n", buffer2);

    This code is resulting in both the read and write code reporting as a fail.

  • @laurent.b

    Hi @laurent.b,
    I was seen your post for programing RAK811 on Ubuntu. There, it says: https://github.com/oguiter/RAK811_BreakBoard/#flash-over-usb

    I wonder if it is possible to program the RAK811 through USB with that, or I must buy some J-Link

    With best regards


  • @barillaro

    How to Edit and Upload the code without a J-Link on Win10 and Atom
    Download Atom.


    Once Download, install and open Atom up.
    Then go to settings > install, search for platformio

    Install the following.

    Once done, download and install the comm drivers for the RAK811
    http://docs.rakwireless.com/en/RAK811 TrackerBoard/Tool/CP210x_Windows_Drivers.zip

    Then download the git from OlofAst


    open Atom, on the PlatformIO Home Tab, go to Platform

    Search ST STM32, Install

    Then click Reveal

    It will open up a Explorer window, then open folder ststm32/boards

    copy the file from OlofAst’s git, rak811.json to the ststm32/boards folder.

    Then in Atom, click open folder.

    Open the folder RAK811_BreakBoard from OlofAst’s git.

    Then open the Terminal in Atom

    To edit the DevEUI and etc… open the file src\Commissioning.h
    Save, and close the tab.

    Now to Compile.

    In the Terminal window in Atom type: pio run
    if you see SUCCESS, compiling went ok

    Calculating size .pioenvs\rak811\firmware.elf
    text data bss dec hex filename
    53236 1628 5244 60108 eacc .pioenvs\rak811\firmware.elf
    ===[SUCCESS] Took 12.25 seconds

    Now to Upload .bin file to the board
    Change the jumper on the board.

    Connect the usb, go to Device manager and check what is you comm port number for the board.

    Then in the terminal window In Atom, run the following
    stm32flash_src/stm32flash.exe -w .pioenvs/rak811/firmware.bin COM5

    This will upload the .bin file, the result should be

    stm32flash 0.5


    Using Parser : Raw BINARY
    Interface serial_w32: 115200 8E1
    Version : 0x31
    Option 1 : 0x00
    Option 2 : 0x00
    Device ID : 0x0429 (STM32L1xxx6(8/B)A)

    • RAM : 32KiB (4096b reserved by bootloader)
    • Flash : 128KiB (size first sector: 16x256)
    • Option RAM : 32b
    • System RAM : 4KiB
      Write to memory
      Data size: 54868 bytes
      Erasing memory
      Wrote address 0x0800d654 (100.00%) Done.

    You should all be done. Unplug, change the jumper back to original position.
    Power up the board and it should connect to the AP.
    To monitor the board, download Uart Terminal, Connect to the Comm port of the board, at baud rate 115200


    RAK811 BreakBoard soft version: 1.0.2
    Selected LoraWAN 1.0.2 Region: EU868
    OTAA Join Start…
    OTAA Join Success


  • @qlion
    AMAZING explanation!!!

    I will try this today. Also, I will try on MacOS. (I don't have a windows10 now). I will let you know.

    Thank you very much for all your help.

    With best regards

    Sebastian Barillaro

  • @qlion Your instructions are awesome. Thank you!!!

    I am having a problem uploading the .bin file.

    You stated to "Change the jumper on the board." Change it to what? I originally had the jumpers on SWD_CLK and SWD_TMS. I tried running the code with the jumper in place and after removing it.

    This is what I see everytime:
    0_1523828088934_upload-c2007c4e-f934-4ca2-a21f-c16439665d43 It seems like it is not recognizing serial_32.

    How can I fix this issue. I believe I followed all of your instructions. Thanks

  • Hi,
    In rak 811 sensor node I want to measure LDR(light dependent resistor) value an analog one.With which pin can I measure , i mean pin definition and pin name!
    In arduino i used to write
    int sensorValue = analogRead(A0);
    How can i write that in RAK811 sensor node?

  • @barillaro

    1. If you need to flash your .bin file then the jumper should be in this mode0_1524140655430_photo_2018-04-19_17-53-58.jpg

    2. If you need to communicate/at commands with the device you should change the jumper to this position0_1524140706814_photo_2018-04-19_17-53-52.jpg

    Correct me if I'm wrong

  • @maheshblazer1
    You need to modify it in open source projects.
    First find an unused ADC pin, then initialize it to ADC, then read the voltage value of this pin.

  • @xc.c
    how many ADC pins are there in RAK811 sensor node!(i haven't used any pins)
    (As I read from schema PB12, PB14, PB15, PA1 are ADC pins right, correct me if I'm wrong)
    How to initialize them?
    What is the syntax for analog read?

    int sensorValue = analogRead(A0);

    could you write an example code for above line?

  • @maheshblazer1

    Thank you for yours picture! I will try soon and let you know!

  • @maheshblazer1 The pictures helped, thank you. I was able to upload the .bin file and get the proper output on the terminal.

    Another question:
    I did this -->"You should all be done. Unplug, change the jumper back to original position. Power up the board and it should connect to the AP."
    I unplugged, changed the jumper to your picture 2, and plugged it back in.

    I tried this several times. I even took it outside for 5 min. The rak811 never connects to ttn. I have a gateway setup and connected.
    The device and application EUIs and app key have all been changed.

    I am also monitoring using Uart Terminal. The following is what I get:
    Dev_EUI: XXXX...
    AppEui: XXXX...
    AppKey: XXXX....
    OTAA Join Start...

    This is what I see on the ttn:


    What am I missing? How do I get my device to connect and map?

  • @Blue_Spring we frequency are you using for your gateway and RAK811?

  • @coeus I am using 915MHz for the gateway.
    For the device, the ttn network shows it connected to "ttn-handler-us-west (current handler)". But the UART terminal states:
    RAK811 BreakBoard soft version: 1.0.2
    Selected LoraWAN 1.0.2 Region: EU868
    Dev_EUI: XXX..
    AppEui: XXX..
    AppKey: XXX..
    OTAA Join Start...

    I am guessing this is where the problem is. It should be US915 for both instead of EU868 for the device.
    How can I change it? - Thank you

    I changed the frequency of RAK811 to US915 by going to platformio.ini in atom but the problem still persists. I still get:
    Dev_EUI: xxx...
    AppEui: xxx..
    AppKey: xxx...
    OTAA Join Start...

    What am I missing? - Thanks

  • IM having the same problem, stuck on "OTAA Join Start...."

    Gateway and node had the same region, i checked on the gateway and see a rx and then a tx in the same channel (the specs says tx ch = rx ch modulo 8) so it has sense that almost always the gateway respond to the same channel, but the node can catch the response....

    anybody had this working? can you share node code AND global_conf.json from the gateway please? for US915 or AU915

  • @Blue_Spring


    in main.c change the following.

    #if defined( REGION_EU868 )
    #if defined( REGION_US915)

    Should be line 54..

  • @Kevlar042 Do you still have trouble with the EEPROM?

  • hi everybody!
    Is available anyone uart port on rak811 tracker?

  • @carlos.soria The current hardware is not supported, so we have summarized some of the user's opinions and found out where these need to be modified. Do you have anything else to add?

    1. The R1/C1 pin of GPS power switch chip U5 needs to be connected to a pull-up circuit。
    2. Power indicator LED1 light removed. Reserve charge indicator, and two GPIO control status indicators.
    3. The EXTINT0 and ANTON pin of the GPS module needs to be connected to GPIO to facilitate wake-up in low power mode.
    4. CP2102 chip removed, add a serial adapter board accessories。
    5. Add GPIO to detect the power supply type of the device, battery-powered or USB-powered. It can be detected using the power chip PG pin and CHG pin.
    6. Directs one UART interface for users to expand to other devices

  • @qlion

    Great Great Great explanation.
    This is what I was missing in the RAK documentation.
    This way I got it up and running in 1 hour from scratch.

    Many many thx.


  • @xc.c HI! I am really new on the stm32 enviroment, but i know on the arduino ide you can use some digital pins for create a virtual serial interface (and you can use ftdi for comunicate with PC). I can do this with stm32 (keil uvision) enviroment?
    For your suggestions can i write:
    1-The recomended desing fot texas for the switch is; correct for your apreciation: R1/C1 connecte to Vin.
    2- for the Power indicator LED1 light you can maybe put a jumper for desingn uses and we can remove the jumper on production enviroment. The reverse charge indicator and two gpio control status are very ussefull.
    3-The ublox gps drink to much current, if you indication is possible; we are thinking on buy alot of rak modules.
    4-For productions cases we dont use the usb module, only use for charging propose with a solar charger.
    5-I don't any example of this use, maybe it be very ussefull. I m only use the voltaje level of battery.
    6-A better antenna for us915 mhz.0_1530192109441_IMG_20180622_111405_1.jpg

Log in to reply

Looks like your connection to RAK Support Center was lost, please wait while we try to reconnect.