I’ve been away a while and am now trying to setup the a fresh dev environment for:
MacOS + VS Code + Platform IO + RAK4631 + RUI3
I’ve previously used the Arduino environment because I couldn’t get the Platform IO thing working. I’d hoped that after a break of a year it might have been easier this time, but I’m still stuck, possibly with more dead links than before.
I have worked my way very carefully through the Platform IO setup tutorial. I think my issue is getting the board support packages into the right place. The tutorial refers to a python patch script that I’ve since read only works to update existing BSPs. Looking at the script, I don’t understand what it’s trying to do with the “. ./” referenced destination directories, because they don’t have any agreement to the default directory structure under “/Users/me/.platformio”
@beegee, would you please take a look at the setup platformIO tutorial and verify it is up to date. Alternatively, could you point me to another run sheet to work my way through.
The python script works and the tutorial is still up-to-date.
But I can’t test on MacOS, I do not have any Apple device.
But installation should be similar on MacOS, I just don’t know where PlatformIO is installed.
You need to install the nRF52 platform in PIO first. AND
you need to have an application compiled. Only after a compilation the complete platform+package is installed.
You place the unzipped files into a folder RAK_PATCH into the PlatformIO installation directory:
There might be errors for platforms you haven’t installed. You can ignore them.
If that doesn’t work, you can patch the platform and package manually:
You need to install the nRF52 platform in PIO first. AND
you need to have an application compiled. Only after a compilation the complete platform+package is installed.
I believe I did all those steps. The first indication of the process going off the rails was when I ran the python script.
% python rak_patch.py
Patching RAK4631
Could not find ../platforms/nordicnrf52/boards
Patching RAK11200
Could not find ../platforms/espressif32/boards
Patching RAK11310
Could not find ../platforms/raspberrypi/boards
Patch done, check output if successful
The .platformio directory is by default directly under /User/me. This is where I unpacked the ZIP file.
% pwd
/Users/markjeffree/.platformio
% ls -la
total 2584
drwxr-xr-x 13 markjeffree staff 416 20 May 15:24 .
drwxr-x---+ 40 markjeffree staff 1280 20 May 19:37 ..
drwxr-xr-x 6 markjeffree staff 192 20 May 15:32 .cache
-rw-r--r--@ 1 markjeffree staff 1065058 20 May 10:29 RAK_PATCH.zip
-rw-r--r--@ 1 markjeffree staff 236954 6 Sep 2021 Update RAK WisBlock modules in PlatformIO platforms and packages.pdf
-rw-r--r-- 1 markjeffree staff 259 20 May 13:39 appstate.json
-rw-r--r-- 1 markjeffree staff 90 20 May 13:50 homestate.json
drwxr-xr-x 15 markjeffree staff 480 20 May 13:50 packages
drwxr-xr-x 8 markjeffree staff 256 20 May 10:19 penv
drwxr-xr-x 6 markjeffree staff 192 20 May 13:47 platforms
drwxr-xr-x 9 markjeffree staff 288 20 May 10:19 python3
-rw-r--r--@ 1 markjeffree staff 3111 20 May 15:24 rak_patch.py
-rw-r--r--@ 1 markjeffree staff 3111 20 May 15:03 rak_patch.py.backup
The double dot slash (which doesn’t render well) ". . / " prefix on the destination directories in the script would seem to point nowhere useful, since it’s effectively trying to find a user called “platforms”. I’m happy to patch the python patch script, but I’m not completely clear on what it’s trying to do.
Ahh. I think I need another layer of directory under the .platformio directory. Stand by …