To make the support of WisBlock Core modules in PlatformIO easier we created a small script that installs or updates RAKwireless WisBlock modules in PlatformIO BSP's This script does not install the required BSP's (platform and package), it only patches already installed BSP's.
đź“ť NOTE: Download the patch package from RAK_PATCH.zip You will need it during the installation or update. |
First Install
Install PlatformIO
First of all, install Visual Studio Code which is a great and open source tool, and you can download it here:
https://code.visualstudio.com/
After installing VS code, you can search PlatformIO and install it in the Extensions item:
After installing PlatformIO, you can see the PlatformIO icon and open it as follow:
Once PlatformIO installation is finished, you have to get the BSP's. Before you can use the WisBlock Core modules with PlatformIO you need to install the original platforms:
- RAK4631 => install nRF52 platform
- RAK11200 => install ESP32 platform
- RAK11300 => install Raspberry Pi RP2040 platform
After the required platforms are installed, follow the steps as shown in Update
Update
After updating or installing the nRF52, ESP32 or Raspberry Pi RP2040 package do the following steps:
- Open or create a project that uses the updated platform.
- Compile the project so that PlatformIO is installing the packages belonging to the platform
- Ignore the Unknown board ID or variant.h: No such file or directory errors until the following patch has been applied
- Patch the platform and package
- Unzip the contents of RAK_PATCH.zip into folder RAK_PATCH in your PlatformIO installation folder.
Paths on different OS: | |
---|---|
Windows | %USER%\.platformio\ |
Linux | ~/.platformio/ |
MacOS | /Users/{Your_User_id}/.platformio/ |
Example (Windows 10):
Install the patch
Open a terminal in the .platformio folder and execute python ./rak_patch.py
Example (Windows 10 terminal):
Example (Linux terminal):
OK, you've install and configure PlatformIO for WisBlock successfully.
Example:
- Now, let's try to compile an example of WisBlock using PlatformIO. We use the RAK13007_Relay_G5LE-14-DC3 example in this document:
https://github.com/RAKWireless/WisBlock/tree/master/examples/common/IO/RAK13007_Relay_G5LE-14-DC3/
Just copy the source code of the .ino file into the main.cpp of the PlatformIO project we just created:
Then compile it by click the compiling icon at the bottom tool bar as follows:
We've compiled this example successfully!
đź“ť NOTE: As same as Arduino IDE, there is an upload icon on the right of compiling icon which can be used to upload the compiled firmware into your device. |
Bernd Giesecke Electronics Engineer, 23 years of experience in industrial and automotive HW and SW R&D. Supporting Arduino open-source community since 2014. |
Updated