Best IDE to use for MySensors projects
-
One more question about the framework..
Right now, we only have a very minimal hardware definition setup for the Sensebender Micro / Gateway boards, and rely on arduino to have installed their board files for the mcu architecture that we are using (for example, by choosing SenseBender GW, SAMD board, you also need to have arduino zero installed as a target in Arduino IDE, to get arduino core files)
Can we do the same in platformio? Or do we need to include the complete arduino samd framework in our mysensors hw repositories, to be able to build in platform.io?
@tbowmo said:
There is no problem to add your custom board to existing development platform. What MCU is used in the board?
See existing SAM/SAMD manifests https://github.com/platformio/platform-atmelsam/tree/develop/boardsIn PlatformIO you have to specify
platformtype for the build environment inplatformio.ini.boardandframeworkoptions are optional. You don't need to keep framework/SDK code within library. Development platform depends on it. SeeSee project examples:
-
@hek , @tbowmo would you like to integrate you project with Travis CI and PlatformIO? See example. The config for this example is very simple.
Here is documentation for multiple continuous integration systems. If you want, I can prepare PR for you. It will allow you to test examples or unit tests over more than 250+ embedded boards without additional steps.
-
Ok, thanks for explaining.. I'll have to dig into it :) would be awesome to get platformio in as supported build environment as well (as standard arduino IDE is not that good).
We are using jenkins CI at the moment, to verify PRs to mysensors repositories at github, setup by our jenkins ninja @Anticimex :)
-
Ok, thanks for explaining.. I'll have to dig into it :) would be awesome to get platformio in as supported build environment as well (as standard arduino IDE is not that good).
We are using jenkins CI at the moment, to verify PRs to mysensors repositories at github, setup by our jenkins ninja @Anticimex :)
I'll have to dig into it :) would be awesome to get platformio in as supported build environment as well (as standard arduino IDE is not that good).
I recommend keeping CI with Arduino IDE builder no matter it is good or bad. A lot of developers use Arduino IDE and you need to be sure that your code compiles well. In PlatformIO we also have a lot of Arduino-IDE specific sketches that we test on each build. I understand that it sounds strange from me but we should think about users.
We are using jenkins CI at the moment, to verify PRs to mysensors repositories at github
I think that you can continue use Jenkins for Arduino IDE builder and Travis CI for PlatformIO Builder. As I've said before, I can prepare
.travis.ymlfor you. -
-
Did anyone get platformIO to work with MySensors? I get this error:
.pioenvs\pro8MHzatmega328\MySensors_ID548\core\MyGatewayTransportMQTTClient.cpp:35:2: error: 'byte' does not name a type
byte _MQTT_clientMAC[] = { MY_MAC_ADDRESS };
^and more...
- Do you use the latest http://docs.platformio.org/en/stable/installation.html#development-version ?
- Do you have
#include <Arduino.h>in one of your project file?
-
- Do you use the latest http://docs.platformio.org/en/stable/installation.html#development-version ?
- Do you have
#include <Arduino.h>in one of your project file?
@ivankravets said:
- Do you use the latest http://docs.platformio.org/en/stable/installation.html#development-version ?
- Do you have
#include <Arduino.h>in one of your project file?
You got it right, all i needed is to do is to use the development branch.
Thanks.
-
.travis.ymlconfig (should be placed in the root of project)language: python python: - "2.7" # Cache PlatformIO packages using Travis CI container-based infrastructure sudo: false cache: directories: - ~/.platformio env: - PLATFORMIO_CI_SRC=examples/AirQualitySensor - PLATFORMIO_CI_SRC=examples/BatteryPoweredSensor - PLATFORMIO_CI_SRC=examples/BinarySwitchSleepSensor - PLATFORMIO_CI_SRC=examples/ClearEepromConfig - PLATFORMIO_CI_SRC=examples/CO2Sensor - PLATFORMIO_CI_SRC=examples/DimmableLEDActuator - PLATFORMIO_CI_SRC=examples/DimmableLight - PLATFORMIO_CI_SRC=examples/DustSensor - PLATFORMIO_CI_SRC=examples/DustSensorDSM - PLATFORMIO_CI_SRC=examples/EnergyMeterPulseSensor - PLATFORMIO_CI_SRC=examples/GatewayESP8266 PLATFORMIO_CI_BOARDS_ARGS="--board esp01 --board nodemcuv2" - PLATFORMIO_CI_SRC=examples/GatewayESP8266MQTTClient PLATFORMIO_CI_BOARDS_ARGS="--board esp01 --board nodemcuv2" - PLATFORMIO_CI_SRC=examples/GatewayESP8266OTA PLATFORMIO_CI_BOARDS_ARGS="--board esp01 --board nodemcuv2" - PLATFORMIO_CI_SRC=examples/GatewaySerial - PLATFORMIO_CI_SRC=examples/GatewaySerialRS485 - PLATFORMIO_CI_SRC=examples/GatewayW5100 - PLATFORMIO_CI_SRC=examples/GatewayW5100MQTTClient - PLATFORMIO_CI_SRC=examples/LightSensor - PLATFORMIO_CI_SRC=examples/MockMySensors - PLATFORMIO_CI_SRC=examples/MotionSensor - PLATFORMIO_CI_SRC=examples/MotionSensorRS485 - PLATFORMIO_CI_SRC=examples/PHSensor - PLATFORMIO_CI_SRC=examples/PingPongSensor - PLATFORMIO_CI_SRC=examples/RelayActuator - PLATFORMIO_CI_SRC=examples/RepeaterNode - PLATFORMIO_CI_SRC=examples/SecretKnockSensor - PLATFORMIO_CI_SRC=examples/SecureActuator - PLATFORMIO_CI_SRC=examples/SecurityPersonalizer - PLATFORMIO_CI_SRC=examples/SoilMoistSensor - PLATFORMIO_CI_SRC=examples/UVSensor - PLATFORMIO_CI_SRC=examples/VibrationSensor - PLATFORMIO_CI_SRC=examples/WaterMeterPulseSensor install: # Don't forget to switch to stable PlatformIO 3.0 (line below) when it will be released # - pip install -U platformio - pip install -U https://github.com/platformio/platformio/archive/develop.zip script: - if [[ $PLATFORMIO_CI_BOARDS_ARGS ]]; then bash -c 'platformio ci --lib="." $PLATFORMIO_CI_BOARDS_ARGS'; else platformio ci --lib="." --board uno --board megaatmega2560 --board esp01 --board nodemcuv2 --board zero; fiHere are test results. Some examples are failed because I don't know if they should be compatible with all boards or just AVR-based. You can specify custom boards per example using
$PLATFORMIO_CI_BOARDS_ARGS. See example above forexamples/GatewayESP8266.Also, you can add a lot of boards as you need. Please check PlatformIO Board Manager.
To enable project for Travis CI please follow the steps 1, 2 and 5 here http://docs.travis-ci.com/user/getting-started/#To-get-started-with-Travis-CI
-
@stedew my congrats for your wife :blush: :bouquet: :birthday:
@ivankravets
Hello Mr IvankravetsOk birthday is done and bottles empty....
-Well When you compare to Arduino IDE vs PlatforIO is something slightly different:
Running the "BatteryPoweredSensor.ino" (Mysensors 2.0) example in Arduino 1.6
1)Load new Sketch "Examples">>Mysensors >> BatteryPoweredSensor
2)Compile >>will not work for all boards (due to INTERNAL is not defined for all AVR members )
3)Download to controllerPlatformIO: 1) Choose Board (here tested with UNO) 2) Choose Dir (only existing dir no create possible) (First make MKDIR BatteryPoweredSensor ) 3) Copy code file from Mysensors example dir to PlatformIO \src dir (right click open in explorer) 4) Enable Use development Version of PlatformIO (at the moment for PIO 3.0) in settings 5) Add PATH string variable in settings (Good explanation anyway) 6) Start cmd (Powershell in Windoze) from PlatformIO 7) Execute the cmd >> platformio lib install 548 (For Mysensors 2.0 lib) 8) Compile 9) Download to controller-This being sayed for these additional steps you get something what is non existing in Arduino ide:
+AutoComplete variables /suggest with function prototypes
+Acces to all used code off the included library
+Compile in seconds-Still some questions also:
Is there a quick way to refractor over source files (not readed the manual)?
Goto declaration does not work (maybe my fault) Clang is installed however.
Local version control?
Specify wich serial port for upload (and not use the default first one)Tnx in advance,
Stefan. -
@ivankravets
Hello Mr IvankravetsOk birthday is done and bottles empty....
-Well When you compare to Arduino IDE vs PlatforIO is something slightly different:
Running the "BatteryPoweredSensor.ino" (Mysensors 2.0) example in Arduino 1.6
1)Load new Sketch "Examples">>Mysensors >> BatteryPoweredSensor
2)Compile >>will not work for all boards (due to INTERNAL is not defined for all AVR members )
3)Download to controllerPlatformIO: 1) Choose Board (here tested with UNO) 2) Choose Dir (only existing dir no create possible) (First make MKDIR BatteryPoweredSensor ) 3) Copy code file from Mysensors example dir to PlatformIO \src dir (right click open in explorer) 4) Enable Use development Version of PlatformIO (at the moment for PIO 3.0) in settings 5) Add PATH string variable in settings (Good explanation anyway) 6) Start cmd (Powershell in Windoze) from PlatformIO 7) Execute the cmd >> platformio lib install 548 (For Mysensors 2.0 lib) 8) Compile 9) Download to controller-This being sayed for these additional steps you get something what is non existing in Arduino ide:
+AutoComplete variables /suggest with function prototypes
+Acces to all used code off the included library
+Compile in seconds-Still some questions also:
Is there a quick way to refractor over source files (not readed the manual)?
Goto declaration does not work (maybe my fault) Clang is installed however.
Local version control?
Specify wich serial port for upload (and not use the default first one)Tnx in advance,
Stefan.- Choose Dir (only existing dir no create possible) (First make MKDIR BatteryPoweredSensor )
Atom uses your system file manager and should allow creating a new directory. In most cases, the button in file manager is named as "New Folder". What is your OS?
- Add PATH string variable in settings (Good explanation anyway)
Why do you need that? It should work with empty field if "Use built-in PlatformIO CLI" is checked. This option is for advanced using when you want to use custom PlatformIO CLI that is installed in Python virtualenv outside IDE.
- Start cmd (Powershell in Windoze) from PlatformIO
- Execute the cmd >> platformio lib install 548 (For Mysensors 2.0 lib)
No need to do that. See my comment https://forum.mysensors.org/topic/1369/best-ide-to-use-for-mysensors-projects/24 . Just add 1 line to your
platformio.iniconfig:lib_deps = MySensors-This being sayed for these additional steps you get something what is non existing in Arduino ide:
Yep, that is our big disadvantage. We don't have similar behaviour as Arduino IDE. Arduino IDE allows building 1 sketch for the 1 board. PlatformIO is another planet. You can build the same source with the multiple build environments(platforms, boards) and upload it simultaneously.
Is there a quick way to refractor over source files (not readed the manual)?
We have
Menu: PlatformIO > Import Arduino IDE based project.... It allows keeping compatibility between 2 IDEs (you need to check a special checkbox in import wizard).Goto declaration does not work (maybe my fault) Clang is installed however.
We have some issue under Windows OS. It should work under macOS/Linux.
Local version control?
PlatformIO IDE is based on Atom text editor. You can extend IDE with hundreds cool packages and themes. Please visit https://atom.io/packages
Here is plugin what do you need https://atom.io/packages/local-historySpecify wich serial port for upload (and not use the default first one)
See upload_port option.
P.S: Thanks a lot for the feedback! What we should improve?
-
- Choose Dir (only existing dir no create possible) (First make MKDIR BatteryPoweredSensor )
Atom uses your system file manager and should allow creating a new directory. In most cases, the button in file manager is named as "New Folder". What is your OS?
- Add PATH string variable in settings (Good explanation anyway)
Why do you need that? It should work with empty field if "Use built-in PlatformIO CLI" is checked. This option is for advanced using when you want to use custom PlatformIO CLI that is installed in Python virtualenv outside IDE.
- Start cmd (Powershell in Windoze) from PlatformIO
- Execute the cmd >> platformio lib install 548 (For Mysensors 2.0 lib)
No need to do that. See my comment https://forum.mysensors.org/topic/1369/best-ide-to-use-for-mysensors-projects/24 . Just add 1 line to your
platformio.iniconfig:lib_deps = MySensors-This being sayed for these additional steps you get something what is non existing in Arduino ide:
Yep, that is our big disadvantage. We don't have similar behaviour as Arduino IDE. Arduino IDE allows building 1 sketch for the 1 board. PlatformIO is another planet. You can build the same source with the multiple build environments(platforms, boards) and upload it simultaneously.
Is there a quick way to refractor over source files (not readed the manual)?
We have
Menu: PlatformIO > Import Arduino IDE based project.... It allows keeping compatibility between 2 IDEs (you need to check a special checkbox in import wizard).Goto declaration does not work (maybe my fault) Clang is installed however.
We have some issue under Windows OS. It should work under macOS/Linux.
Local version control?
PlatformIO IDE is based on Atom text editor. You can extend IDE with hundreds cool packages and themes. Please visit https://atom.io/packages
Here is plugin what do you need https://atom.io/packages/local-historySpecify wich serial port for upload (and not use the default first one)
See upload_port option.
P.S: Thanks a lot for the feedback! What we should improve?
Ok as i mentioned before:
At start nothing worked like i wanted in PIO then start reading....
Testing &implement all steps that seems to be needed (forums are top sometimes :-)
Then changed computer (Wife...) and re-install everything from scratch.
And so i came to this exhaustive (wrong) list
So now the corrected one:PlatformIO:
1) Choose Board (here tested with UNO)
2) Choose Dir (only existing dir no create possible) (First make MKDIR BatteryPoweredSensor )
2) Choose Dir ( existing dir or create "BatteryPoweredSensor" )
3) Copy code file from Mysensors example dir to PlatformIO \src dir (right click open in explorer)
4) Enable Use development Version of PlatformIO (at the moment for PIO 3.0) in settings
~~ 5) Add PATH string variable in settings (Good explanation anyway)~~
~~6) Start cmd (Powershell in Windoze) from PlatformIO ~~
7) Execute the cmd >> platformio lib install 548 (For Mysensors 2.0 lib)
5 ) add 1 line to your platformio.ini config: lib_deps = MySensors (Dmnn that i try-ed already did not work then ?? to many modifs made i think)
6 ) Compile info: on my Laptop (slow one) compiles MySerialGw in 2sec!! (record for PIO)
7 ) Download to controllerAbout the other topics:
Refractoring is handy especialy when you use constants over severall files.
I am a chaotic person so i tend to forget one enum somewhere...
Goto declaration >> ok have to switch OS maybe not you/team to blame.
-Local history will try /need it (same problem as refractor point :-( )
-upload_port very good one... will test it .--Improvements ?? Don't know i already own you a couple of beers i think.
I believe it is maybe handy to have a write up with screenshots "Adventures migration from Arduino to PIO".Regards,Stefan.
-
Ok as i mentioned before:
At start nothing worked like i wanted in PIO then start reading....
Testing &implement all steps that seems to be needed (forums are top sometimes :-)
Then changed computer (Wife...) and re-install everything from scratch.
And so i came to this exhaustive (wrong) list
So now the corrected one:PlatformIO:
1) Choose Board (here tested with UNO)
2) Choose Dir (only existing dir no create possible) (First make MKDIR BatteryPoweredSensor )
2) Choose Dir ( existing dir or create "BatteryPoweredSensor" )
3) Copy code file from Mysensors example dir to PlatformIO \src dir (right click open in explorer)
4) Enable Use development Version of PlatformIO (at the moment for PIO 3.0) in settings
~~ 5) Add PATH string variable in settings (Good explanation anyway)~~
~~6) Start cmd (Powershell in Windoze) from PlatformIO ~~
7) Execute the cmd >> platformio lib install 548 (For Mysensors 2.0 lib)
5 ) add 1 line to your platformio.ini config: lib_deps = MySensors (Dmnn that i try-ed already did not work then ?? to many modifs made i think)
6 ) Compile info: on my Laptop (slow one) compiles MySerialGw in 2sec!! (record for PIO)
7 ) Download to controllerAbout the other topics:
Refractoring is handy especialy when you use constants over severall files.
I am a chaotic person so i tend to forget one enum somewhere...
Goto declaration >> ok have to switch OS maybe not you/team to blame.
-Local history will try /need it (same problem as refractor point :-( )
-upload_port very good one... will test it .--Improvements ?? Don't know i already own you a couple of beers i think.
I believe it is maybe handy to have a write up with screenshots "Adventures migration from Arduino to PIO".Regards,Stefan.
@stedew said:
6 ) Compile info: on my Laptop (slow one) compiles MySerialGw in 2sec!! (record for PIO)
How many seconds to you need for Arduino IDE builder?
I believe it is maybe handy to have a write up with screenshots "Adventures migration from Arduino to PIO".
Would be thankful for contribution. Our documentation is open source and everyone can edit it. For example, Documentation for PlatformIO IDE, click on
Edit on GitHub.--Improvements ?? Don't know i already own you a couple of beers i think.
Happy coding with PlatformIO! :blush:
-
I recently bumped into PlatformIO.
Seems like a very powerful build system for various hardware platforms.
Frees a user from having to install a build system and libraries by hand.
Does not include an editor, but I think this is a good thing as everyone has his own preferred editor, right?
Anyone have experience with it?@Yveaux said:
I recently bumped into PlatformIO.
..
Does not include an editor, but I think this is a good thing as everyone has his own preferred editor, right?
Anyone have experience with it?You should use Atom editor (IDE) with PlatformIO.
http://docs.platformio.org/en/stable/ide/atom.html
https://atom.io/packages/platformio-ide -
@Yveaux said:
I recently bumped into PlatformIO.
..
Does not include an editor, but I think this is a good thing as everyone has his own preferred editor, right?
Anyone have experience with it?You should use Atom editor (IDE) with PlatformIO.
http://docs.platformio.org/en/stable/ide/atom.html
https://atom.io/packages/platformio-ide