RAK12009 WisBlock MQ3 Alcohol Gas Sensor Module PlatformIO Setup
PlatformIO Setup (Optional)
PlatformIO provides an alternative development environment for building and uploading the RAK12009 example.
If you prefer to use PlatformIO IDE instead of Arduino IDE, follow this guide.
Build RAK12009 Example on PlatformIO IDE
This procedure was tested only on Windows 10 and Ubuntu.
- Install the original PlatformIO platform, as shown in PlatformIO First Install section.
-
For WisBlock Core RAK4631, install Nordic nRF52 platform.
-
For WisBlock Core RAK11200, install Espressif 32 platform.
-
For WisBlock Core RAK11310, install Raspberry Pi RP2040 platform.
-
Open a project example that uses the new installed platform.
-
Launch Visual Studio Code and select PlatformIO PIO Home.
-
On the PIO Home, click on Project Examples.
-
Choose arduino-blink project then click on Import button.
Figure 1: Import arduino-blink project- Click the Yes button on the trust window.
Figure 1: PlatformIO trust authors-
Build the project and ignore warnings and errors.
-
Download and install the RAK Patch script.
-
Unzip the contents of RAK_PATCH.zip into the folder RAK_PATCH in your PlatformIO installation folder.
The table below shows the PlatformIO installation directory for each operating system:
| PlatformIO path on different OS | |
|---|---|
| Windows 10 | %UserProfile%\.platformio\ |
| Linux | ~/.platformio/ |
| MacOS | /Users/{Your_User_id}/.platformio/ |
Figure 26 shows the PlatformIO installation directory on Windows 10.
Figure 1: RAK patch folder on Windows- Open a command prompt in
%UserProfile%.platformio\RAK_PATCHfolder and execute python./rak_patch.py.
Figure 1: RAK patch installed on WindowsIn case of any platform update on PlatformIO, the RAK_PATH script must be executed again after the platform update.
-
Import the RAK12009 Arduino Project to PlatformIO.
-
Open PlatformIO PIO Home and select Import Arduino Project.
Figure 1: Import RAK12009 Arduino Project-
Select your preferred WisBlock Core option.
-
Then choose the directory of the original RAK12009 Arduino Project.
Figure 1: Select Arduino Project folder- To finish the import, click on Import button.
Figure 1: Finish PlatformIO import-
Build the imported project on the PlatformIO.
-
Open the platformio.ini file on the imported project, then add library option lib_deps configuration as shown below. The upload_port parameter is your USB Serial Device address.
[env:wiscore_rak4631]
platform = nordicnrf52
board = wiscore_rak4631
framework = arduino
upload_port = COM4
lib_deps =
rakwireless/RAKwireless MQx library
olikraus/U8g2
Now, you can build the project by clicking on the highlighted icon.
Figure 1: Build Arduino imported project- Upload the imported project on PlatformIO.
To upload the project on the target board, click on the highlighted icon.
Figure 1: Upload Arduino imported project