Micropython on RAK5010!

Glad to announce we have run micropython on RAK5010. I will introduce the details below, here we go!

If you know little micropython, maybe you can see it first:

OK, you get the point of micropython, let’s begin. We provide the source code, firmware, python script and serial tool at:


Source code of 5010, its path on micropython is \micropython\ports\nrf. If you are developer, you can replace the orginal code on micropython.

serial tool:
We provide a powerful serial tool to debug. You also can use others like putty(DTR is needed).

Include application and softdevice

Initialization script of RAK5010

RAK5010 moudle with api like get_acceleration, get_light_strength, get_pressure, get_gps, cellular_tx

How to run?

  1. Download the hex and burn it to RAK5010 by jlink.
  2. Connect RAK5010 to pc with usb.
  3. Download the serial tool and open it. Choose COM of RAK5010 and open port.
  4. If you see the start up infomation, congraulations! It runs normal and in REPL mode. You can use it as a python terminal.
  5. Import the init.py and rui.py. Here we need use ampy. I use mingw32 in msys32, install method is:
  • Install Python2 or Python3

  • Add the python and pip path to system path: C:\Python27\Scripts C:\Python27

  • enter cmd.exe, run : pip install adafruit-ampy If successful, it will show:

  1. Close Serial port tool. Run in cmd.exe in follow order.
  • ampy --port COM33 put rui.py

  • ampy --port COM33 put init.py

  1. Close cmd and open serial tool, use CTRL+D to restart device, it shows like:

  2. Use rui.py like below:

How to develop?
We supply the source code for user. So user could do own application. I compile in linux, as below:

1.Download the micropython:

2.Replace \micropython\ports\nrf with our code.
3.Install arm-none-eabi-gcc for linux
sudo apt-get install gcc-arm-none-eabi
4.Install python3, refer to: https://www.tecmint.com/install-python-in-ubuntu/
cd micropython
git submodule update --init
make -C mpy-cross
cd micropython/ports/nrf
make BOARD=pca10056 SD=s140
6.firmware.hex will be in micropython/ports/nrf/build-pca10056-s140


  1. Our hex provides the basic api for sensors and bg96 on board. Micropython original thing is still work, like CTRL+D for restart
  2. It runs the ble_uart_nus demo as periphral, device name is rak5010
  3. User can do any change they want.
  4. We are keeping study how to run script automatically, other than just in REPL mode. If you make it true, it is nice to share with us and other developers
1 Like

Hi everyone,

This is the first version firmware based on Micropython for RAK5010, so there may be some incompleted features. We open all the source code here so that everyone can use it to do more customized features based on RAK5010. Surely, it will be grateful that anyone can help to complete all features togather with us, and any suggestions from you will be great! :slight_smile:

We have got a contribution, the rui.py will be more abundant. Everyone can submit code to :

If test ok, it will be merged.

I have added a lot more today :slight_smile: You’ll get a proper diff on Monday!

We have an issue, we can not connect to the device after we install the micropython hex file.

We start the RAK5010. We flash rak5010_micropython.hex using JLink and the USB to device cable. We then start the serial tool, but it does not find the RAK device anymore, the COM port is not in the ports list.

If we flash the device using the standard firmware - https://downloads.rakwireless.com/en/Cellular/RAK5010/Firmware/RAK5010_V3.0.0.8.rar, than we can connect to the device using the COM port…

Any ideas?

I have test the rak5010_micropython.hex, it is ok. Do you copy all files of serial tool? The .ini is the config file of serial. After download, remove usb and insert again. It should be like below:

If you just supply power with usb, sholud keep usb voltage stable.

Hi and sorry for the late reply!

We downloaded the .hex file again and it worked well.


This is an amazing news! Micropython and RAK :slight_smile:
Looking forward to more.

Hi, were can I get the python library documentation?


What kind of library do you want? micrpopython documentation? Or about other?