PlatformIO Community

Add custom platform from command line

I am developing a custom platform for GSM development (https://github.com/siwiembedded/platform-siwigsm) based on our company software SDK. I want to know how can I make user add this platform without have to go through advance installation process?

So user can simply do:
platformio platform install platform-siwigsm

You can install platforms without PlatformIO having to register them.

i.e. platformio platform install https://github.com/siwiembedded/platform-siwigsm

Just as you can do the following in your platformio.ini to have the platform automatically installed if you’ve never built a project against it before.

platform = https://github.com/siwiembedded/platform-siwigsm
board = s20gsm
framework = siwisdk
monitor_speed = 115200

Is this enough or are you asking this be added as a built-in platform?

btw, I got this error (Windows 10) when trying to compile the gpio-blink example… another :bug: for you to quash I expect! :wink:

image

2 Likes

yes I know… but it would be great if I can just search the platform from list :slight_smile:
image

A bug :scream: Its working fine for me. What python version are you using?

Can you please tell me python version you’re running right now?
I do not understand the syntax error there but, If possible can you please add a space after colon or remove the type altogether and see if that fix the issue?

1 Like

That’s what I thought. Well, that would probably involve a pretty-please and begging to @ivankravets :wink:

Good point… It’s still on 2.7.16… PlatformIO has been using Python 3 for a little while now (3.7.5, atm, it seems) , so I just just accidentally-on-purpose deleted my penv folder so it would upgrade the python environment… it’s still mulling that idea over, so may need application of a cattle prod.

1 Like

Thanks for confirmation. should I be worried about someone running python 2? How can I test with python 2?
I do not understand the version scheme of default python package (ms-python.python) by Microsoft :confused:

1 Like

No, not really, it’s only because I’ve been using this install of PlatformIO for a while, so it’s before PlatformIO jumped to Python 3. It’s not related to the ms-python, as PlatformIO uses it’s on python virtualenv to … insulate … itself from the rest of the OS, and also not muck up a pre-existing python setup (if any).

Edit: So cattle prod was applied, Python 3.7.5 didn’t want to auto-install willingly (ended up manually uninstalling it and letting PlatformIO try again). Now it compiles just fine. So it’s definitely something in the python 2 -> 3 transition.

1 Like

You need to submit your development platform to the PlatformIO Registry. We plan to make it public soon. However, we can add your dev-platform manually to the registry from our side.

  1. When do you plan to publish the first release?
  2. Do you plan to cross-compile tool-siwiflasher for other systems? macOS, Linux?

Thank you @ivankravets.

  1. Very soon, just finishing up some documentation and examples.
  2. Siwiflasher is based on dll provided by mediatek. I do not have any open source alternative to flash GSM module. On linux it can work using wine but thats not really a solution for platformio. However I am thinking to understand the serial protocol and maybe able to provide a pyserial based flasher. But that might come later as reverse engineering protocol may take some time.
1 Like

Just ping me here when you will be ready. Thanks for using PlatformIO!

1 Like

Hi @ivankravets, I have made the first release of platform-siwigsm today :tada:. Tested everything :sweat_smile:
I am preparing more examples will update on github as they are finished.

Thanks for supporting.

2 Likes

Hi @ivankravets, sorry to bump this topic again. Can you please add platform to PlatformIO registry?
Also I wanted to know how the release will work after platform is added. From what I understood, the tar.gz + sha1 sum has to be added to manifest.json to prepare a release. Is this an automated process in PlatformIO
registry?

Just for update, I have started my work on adding arduino framework support for siwigsm platform :slight_smile:

Could you update your releases with the valid tags? See example https://github.com/platformio/platform-atmelavr/releases

siwigsm release v0.2.0 => 0.2.0, etc.

:+1: Its done
Also done the same for framework siwisdk

For the Python 2 issue. Maybe just a quick note in your README on Github that says an “up to date version of PlatformIO based on Python 3.x is required” or something to that effect?

On OSX and “pip” in my path, it looks like the easiest way for users to check the version is:

[$]> which pip
/Users/jnr2820/.platformio/penv/bin/pip
[$]> pip --version
pip 20.1.1 from /Users/jnr2820/.platformio/penv/lib/python3.7/site-packages/pip (python 3.7)
1 Like

Thank @jeremiahreddy Maybe mentioning minimum version of PlatformIO and python required should also be enough? so while installation itself things get verified by itself.
I am not sure if platform.json manifest file has such dependency field? There is engines in platform.json

"engines": {
    "platformio": "~3.0.0"
},

can we specify python version here?

1 Like

@ivankravets Can you please check? I have made modifications to release.

Hi @ivankravets, i know you’re busy with the development of PlatformIO but please take a moment and see the modifications i have made as per your suggestions.
thanks!

Sorry for the delay. See my answer here

Give us please some time and you will be able personally publish your dev-platform into the new Universal Package Registry for embedded development. We don’t maintain more legacy registry. Sorry.

3 Likes

No problem, Well actually It took me some time to understand even though you hinted some time back

I am not in hurry as of now since I am also working on getting Arduino framework ready :slight_smile: I am sure PlatformIO team is working day in day out to get PIO IDE 2.0 with new features. Looking forward to it :+1: Good luck!

1 Like