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.
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?
- Download the hex and burn it to RAK5010 by jlink.
- Connect RAK5010 to pc with usb.
- Download the serial tool and open it. Choose COM of RAK5010 and open port.
- If you see the start up infomation, congraulations! It runs normal and in REPL mode. You can use it as a python terminal.
- 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:
- Close Serial port tool. Run in cmd.exe in follow order.
ampy --port COM33 put rui.py
ampy --port COM33 put init.py
Close cmd and open serial tool, use CTRL+D to restart device, it shows like:
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/
git submodule update --init
make -C mpy-cross
make BOARD=pca10056 SD=s140
6.firmware.hex will be in micropython/ports/nrf/build-pca10056-s140
- Our hex provides the basic api for sensors and bg96 on board. Micropython original thing is still work, like CTRL+D for restart
- It runs the ble_uart_nus demo as periphral, device name is rak5010
- User can do any change they want.
- 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