Atom IDE and PlatformIO on Linux (Fedora)

steps: (at a high level) For anyone interested in the same:

  1. Install Atom
    1b. Make sure to select the options to show certain hidden files.
    under preferences > core:


    and another under Preferences > Packages > search tree-view > settings:

    I, like a dingus, spent two days trying to figure out why “Pokitto lib wasn’t installing into my project.” when in fact is was there the whole time. (previously I had these settings already changed before doing Pokitto in PlatformIO. Whoops)

  2. Install PlatformIO from settings.

  3. Start new PlatformIO project targeting the lpc11u68.

  4. Install the Pokitto PlatformIO lib (just search Pokitto in the library pane on PlatformIO home 1) into the project (3). (there is a drop down)

  5. Copy and replace the platformio.ini and pokitto_pre.py files and the hello world example files (main and settings.h) from the .piolibdeps/Pokitto_ID5600/ directory into your project’s root and src folder.

  6. If SDFileSystem exists, remove it from two places (.pioenvs, .piolibdeps)

  7. open the terminal in Atom and run pio run

  8. And on linux the quickest way I know to put the corresponding bin to the pokitto (in flash mode) is dd bs=1024 conv=nocreat,notrunc if=/location/of/firmware.bin of=/location/of/CRP\ DISABLD/firmware.bin the firmware file is in .pioenvs/lpc11u86/ directory

Proof!

OS: Fedora 28/Fedora 29
IDE: Atom + PlatformIO plugin + Pokitto Library

I noticed in the git commit history from the PokittoIO that the SDfileSystem was removed due to conflicts. But the library is still in the PlatformIO Pokitto libs?

Edit: It seems it takes a good amount of time for the PlatformIO to update. So I could be trying too soon. I’ll try manually stripping it out and see if that helps at all.

Edit2: That seemed to work. It built the firmware.bin! Now to see if it’ll load onto the Pokitto hardware :smiley:

edit3: On Fedora there has been some weirdness with getting the bash shell working. The simplest workaround and one that I use is to just launch Atom from the terminal.

steps: (at a high level)

  1. Install Atom

  2. Install PlatformIO from settings.

  3. Start new PlatformIO project targeting the lpc11u68.

  4. Install the Pokitto PlatformIO lib (just search Pokitto in the library pane on PlatformIO home 1) into the project (3). (there is a drop down)

  5. Copy and replace the platformio.ini and pokitto_pre.py files and the hello world example files (main and settings.h) from the .piolibdeps/Pokitto_ID5600/ directory into your project’s root and src folder.

  6. If SDFileSystem exists, remove it from two places (.pioenvs, .piolibdeps)

  7. open the terminal in Atom and run pio run

  8. And on linux the quickest way I know to put the corresponding bin to the pokitto (in flash mode) is dd bs=1024 conv=nocreat,notrunc if=/location/of/firmware.bin of=/location/of/CRP\ DISABLD/firmware.bin the firmware file is in .pioenvs/lpc11u86/ directory

Proof!

2 Likes

The reason why the SDFilesystem is causing problems is because it is already inside the new mbed framework that is pulled automatically by Platformio

The reason why it is still visible in the library is the completely crappy library management system of Platformio.

If I make a change in the git repo, it takes days for it to get updated in the PIO library registry. I am not kidding. (edit: I’m just ignorant)

1 Like

Are you sure that’s not because the library’s still listed as being on version 0.0.1,
and the system doesn’t attempt to update if the version number hasn’t changed?

Oops. Do I have to change that manually… I guess so.

Let me do that immediately

1 Like

I saw that it took a while to update in another discussion here. That’s what led me to delete it manually to make it work since I didn’t see it on github.

But I am absolutely excited and happy that I can get working on some projects now! (I have a sort of aversion to online editors)

1 Like

I would suspect PlatformIO only looks at the version number in the library.json as a means of comparison.

That’s not unusual though.
Going without proper versioning and potentially commiting unstable code to master is the unusual behaviour.

It seems their scanner also only scans each library once per day (rather than using GitHub webhooks),
which isn’t ideal, but compared to other alternatives it’s still probably the best we’ve got at the moment.


I’d like to point out that as of this thread we’ve now got people successfully using both VSCode+PlatformIO and Atom+PlatformIO on different operating systems.

That’s actually a better position than we were in before with only Windows users being able to use EmBitz and everyone else using mbed online without access to C++11 or the assembly optimisations.


Likewise.

2 Likes

This excites me so much! Mostly because I’m a Fedora Linux and Atom user. Glad I could confirm a functional option!

2 Likes

@torbuntu & @Pharap

You are, ofcourse, entirely right

2 Likes

I’m so happy I pushed you guys to get PIO working, everybody is happy now! \o/
(I still need to find some time to write code for the pokitto, but just getting ‘hello world’ on the screen was worth it :wink: )

1 Like

Could you describe in detail your setup, in particular how you like to copy the bin over to the Pokitto?

Edit: I guess you’re using the same command as @torbuntu

(just thinking of writing an automatic post-processing script for the uploading, thats all)

I’m pretty sure we already have one for Mac that should work on Linux as well (but obviously it requires execution permission).

And I’m sure I remember reading that there’s a Windows equivalent somewhere.
(I’m not sure it’s as important for Windows though,
because the folder with the .bin isn’t hidden on Windows.)

I’ve been reading through some PlatformIO documentation because of my work on the Arduboy2 port and I’ve discovered some useful info about how the system works that might be relevant to this issue.

In library.json you must specify either an "authors" field or a "repository" field.

If you specify "repository", one of the options in it is "branch".
If you specify "branch" then the library will be pulled from that branch.
If you do not specify "branch" then the library will be pulled from the default branch (typically master).

However, if you have specified a "version" and the repo has a tag (i.e. a release) matching that version (presumably following the semantic versioning convention of v0.0.0) then the library will be pulled from the release.

So perhaps it’s worth creating some releases to see if that provides a more stable system?


In particular there’s an explanation here of how the library manage behaves under different conditions:

Case 1:
version and repository fields are defined. The repository is hosted on GitHub or Bitbucket.

PlatformIO Library Registry Crawler will lookup for release tag named as value of version or with v prefix (you do not need to pass this v prefix to the version field).

Case 2:
version and repository fields are defined and repository does not contain tag/release with value of version.

PlatformIO Library Registry Crawler will use the latest source code from repository and link it with specified version. If repository branch is not specified, then default branch will be used. Also, if you push new commits to repository and do not update version field, the library will not be updated until you change the version.

Case 3:
version field is not defined and repository field is defined.

PlatformIO Library Registry Crawler will use the VCS revision from the latest commit as “current version”. For example, 13 (SVN) or first 10 chars of SHA digest e4564b7da4 (Git). If repository branch is not specified, then default branch will be used.

We recommend to use version field and specify the real release version and make appropriate tag in the repository. In other case, users will receive updates for library with each new commit to repository.

In particular, this part explains why updates weren’t happening before:

Also, if you push new commits to repository and do not update version field, the library will not be updated until you change the version.

2 Likes