Best IDE to use for MySensors projects


  • Mod

    The idea of this topic is to have a discussion on a best way of doing MS projects
    Sure the basic one is to use "native" arduino IDE
    This is very common, very simple and cross platform solution

    Major disadvantage is poor editor - missing suggestions, missing substitutions, error highlighting, online error checking etc. most of modern helpful things you will find in other IDE
    If you will try atmel development studio v6 (based on microsoft visual studio) for example you will find arduino IDE very ugly and less efficient while programming and debugging

    so, atmel studio is the next one, Both arduino and atmel studio are using AVR-GCC toolchain. The toolchain is a set of files and tools for you to compile your C/C++ and to create HEX binary ready to be uploaded to MCU.
    But there is a significant difference. The difference between atmel studio and arduino is on how things are running during project build.
    Mostly this related to a special arduino hardware configuration, there all required arduino board attributes are defined.
    this makes use of atmel studio directly for arduino builds very complicated.
    The most easiest way is to integrate arduino build subsystem using a plugin visualmicro (can be downloaded from visulmicro.com)
    You can apply visualmicro to Microsoft VS or to atmel DS. I'm also used to develop plain AVR projects, so for me there is a reason to apply visual micro to atmel studio. Plugin itself is free of charge. You can pay a fee for so called USB debugger. It is some kind of software debugger. I've tried and actually did not find it useful, but may be you will.
    The benefit of visual micro is compatibility with "native" IDE. You can switch between this two at any time without braking your project.
    Comparing to arduino IDE you are getting the following advantages:

    • modern C++ editor with online error checking, substitutions and suggestions
    • more convenient serial monitor (it is not disappeared while uploading)
    • native support of original atmel AVR ISP
    • USB debugger (free for a limited period)
    • simple way to change arduino project home folder
    • limited support of version control (not tested by me)
      the biggest disadvantage is a single platform, only windows is supported

    With visualmicro your sketch will be still not compatible with plain AVR but you will get a single IDE for both.
    I'm using visual micro for a while and finding it very useful
    I'm running it on native windows and on my macbook pro through parallels

    I also have a sufficient experience to run native atmel debugger with arduino sketch
    but this way is not that convenient

    the next one I see is eclipse. there is a new arduino plugin http://playground.arduino.cc/Code/Eclipse
    not tried yet, but looking for this
    eclipse is more advanced for C++ development than visual studio
    and also it supports much more platforms (hosting and target)
    if you have an experience please share


  • Admin

    The Sublime text editor with Stino plugin is also an option.

    http://www.sublimetext.com/
    https://github.com/Robot-Will/Stino


  • Contest Winner

    @axillent
    do you know anything how debugging in Eclipse with Arduino is supported?
    I find major disadvantage of Visual Studio with Arduino/Visualmicro is that "real" HW-debugging through JTAG/1Wire is not possible easily. I'm not sure if this is really that complicated or if visulmicro just wants to sell their SW debugging tool.


  • Mod

    @Dirk_H the problem came not from visualmicro, it came from arduino
    atmel studio need proper ELF file for the debugging
    to debug arduino you will need to create a separate atmel studio DEBUG project
    I use a second instance of studio for this

    the only none convenient thing here is that on each build you will have to choose right locations of the source files before launching debugging


  • Mod

    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?


  • Hardware Contributor

    I normally use xemacs at work so I've been using that at home. I just tried Sublime and it looks really nice... right up until I read that they want $70 for a license. I'm not sure I want to invest in switching editors to something that probably won't be free in the future. Eclipse almost seems ideal but the learning curve is really steep. And it seems to want to "own" the project and I'd rather just have something that sits on top of the file/build structure I choose.

    I'm at the point now where I'm ditching the Arduino IDE for building code. There doesn't seem to be any way to handle external libraries, my personal libraries, etc. well in that at all so I'm going to start looking at alternate build systems.

    This also ties into what is a good, general source code directory structure for Arduino projects. I'd like to hear what other people are using as a good way to handle dependencies which include:

    1. Arduino libaries
    2. 3rd party libraries
    3. MySensors libraries (which is really just an example of 2)
    4. My personal libraries
    5. Sketches (main programs)

    I'm trying to figure out the best structure for these such that a build system can find them and they can each be kept up to date individually using git/github. Things like should each of my personal libraries be a separate git repository? What if they have intra-dependencies, or dependencies on other libraries? Same with sketches - separate repositories? One giant repository? I've started reading about git submodules which might be a solution.



  • @axillent the best ide is vim + Arduino-Makefile


  • Hardware Contributor

    I spent part of this afternoon trying sublime text + platformio. What a pain in the a$$. The problem with all these "auto" systems is that when they break, they don't tell you enough to figure out how to fix it. I can't get platformio to include a custom include path and it's not obvious how it's managing build directories so I can't even get it to find include files that seem like they should be visible.

    I guess I'm going to try stino, Arduino-Makefile, or Arduino-cmake with sublimetext next.


  • Mod

    @TD22057 said:

    I can't get platformio to include a custom include path and it's not obvious how it's managing build directories so I can't even get it to find include files that seem like they should be visible.

    Seems like I got stuck at the same problems as you and also decided to ditch it.
    I experimented in the past with Arduino-Makefile, which worked fine at that time, but was not working on Windows (which is my main dev platform)


  • Hardware Contributor

    My "normal" job is large scale C++ development so I'm thinking more long term in how I want my code structured - especially when I come back to this in 5 years and can't remember what I was doing.. I tend to think of "library" as something I can build once and put somewhere. It took me a little while to realize that that doesn't work well when you're changing boads, etc so in Arduino land, "library" means directory with some source code. Even so, I feel like the IDE's/build systems I've tried assume that I'll either put the source code for something all in one directory or that I'll only ever have one library with a given name.

    I've got my own versions of Switch, Led, Timer, etc libraries now and I'm sure there are 1000's of Arduino libraries with those same names available. So I want something where I can use directories to identify which library I actually mean (#include "TD/Timer.h") and tags/labels in my CM system to identify which version of that library I actually deployed. If anyone has a better suggestion for handling this, feel free to chime in. I think my problem is that the Arduino build systems I've tried assume a very flat library directory structure which I don't want. I want a nested directory structure where I can keep all the libraries I've found useful and then select which one I want via include path.

    I'll probably try Arduino-makefile and Arduino-cmake next. FYI @Yveaux, I think Arduino-makefile will work on windows, buy you need cygwin. I'll probably try that first since I'm used to Makefile's and already have cygwin installed.

    FYI I've temporarily given up on SublimeText because it was taking forever to get the indentation style I want in my code defined. That's one thing that is incredibly easy in Eclipse. And it doesn't parse gcc output so you can't jump to errors after a compile step. So back to emacs for me...



  • Interesting discussion!

    Has just started to try to create some nodes, but find it difficult to put up a decent environment.
    When I test platformio who want to have the following structure:

    MyNode
    ├── lib
    │ ├── DHT -> /my_arduino_libs/DHT
    │ └── MySensor -> /my_arduino_libs/MySensor
    ├── platformio.ini (config file That specifies the platform and settings)
    └── src
        └── MyNode.ino
    
    

    Platformio makes it very easy to build on different platforms, but from version 1.6 of mysensors works platformio bad. It can be solved with a lot of #ifdef but is not easy.

    Also tested with (Have steal it from the jenkins-server 🙂 )

    Arduino --verify -v --board Arduino: AVR pro --pref build.f_cpu = 8000000 --pref build.mcu = ATMEGA328P --pref compiler.warning_level = all --pref sketchbook.path = libraries/mysensors MyNode/MyNode.ino
    

    but then it becomes very inflexible. (Has built a small bashscript for this)

    How do you others to keep track of your code and to build in a smooth way with a nice IDE?



  • @TD22057 thanks a lot for your feedback. If you have any problems with software (including open-source), don't forget to report them to developers.

    I'm a founder of PlatformIO and will try to answer on the all questions.

    I can't get platformio to include a custom include path and it's not obvious how it's managing build directories

    See documentation for it http://docs.platformio.org/en/latest/projectconf.html#build-flags

    The problem with all these "auto" systems is that when they break, they don't tell you enough to figure out how to fix it.

    The default behaviour of PlatformIO's builder is to build all *.c, *.cpp, *.S files. If this behaviour isn't good for your project, then you can control it via http://docs.platformio.org/en/latest/projectconf.html#src-filter

    I understand that developers like to "adopt" own source code (libraries) for the specified builder and then claim other builders that they What a pain in the a$. If someone like car which works using petrol, then it doesn't mean that people who use diesel cars are What a pain in the a$.


    I've just added to PlatformIO FAQ the answer for question Can not compile a library that compiles without issue with Arduino IDE.

    P.S: Friends, we spent our spare time to improve this embedded world. Our users don't understand that we do it totally FOR FREE and share all efforts via OPEN-SOURCE. Let's respect each other.


    Regards, Ivan Kravets

    • Ph.D, Researcher and Software Architect
    • "Creativity comes from talent and never from knowledge" (c)

    http://www.ikravets.com



  • @ivankravets Thanks a lot!! 🙂

    Now I think that it works with the latest commit on github->dev-branch.
    I will try it to night and if I got time I will publish my node code/building structure as well.

    Here was my platformio.ini file that I tested with:

    [env:pro8MHzatmega328]
    platform = atmelavr
    framework = arduino
    board = pro8MHzatmega328
    build_flags = -I/(PATH_TO_MYSENSORS_GITHUB)/libraries/MySensors
    lib_ignore = MySensors
    
    

  • Mod

    @smilvert I'd be very interested in a short howto, once you succeed!



  • @Yveaux I just uploaded the first version on github but currently I lacks sensors so I haven't verify the build_script but it seams to work in the console.

    (I should also add a howto when I get time 🙂 )



  • @smilvert we have an issue Handle specific extra build flags from library.json which should resolve your problems. In this case, you will need to skip *.cpp/*.c files from building process using library.json.



  • Related issue https://github.com/platformio/platformio/issues/331

    @smilvert I've just re--tested without lib_ignore option and it works! Please don't place MySensors library to the lib directory.

    platformio.ini

    [env:uno]
    platform = atmelavr
    framework = arduino
    board = uno
    src_build_flags = -I/Users/ikravets/Downloads/Arduino-development/libraries/MySensors
    

    Project

    ➜  /  tree /tmp/111
    /tmp/111
    ├── lib
    │   └── readme.txt
    ├── platformio.ini
    └── src
        └── GatewaySerial.ino
    
    2 directories, 3 files
    

    Terminal

    (develop)➜  origin git:(develop) ✗ platformio run -d /tmp/111
    [Fri Nov 27 19:38:03 2015] Processing uno (src_build_flags: -I/Users/ikravets/Downloads/Arduino-development/libraries/MySensors, platform: atmelavr, board: uno, framework: arduino)
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------
    avr-g++ -o .pioenvs/uno/src/tmp_ino_to.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -DPLATFORMIO=020306 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant -I.pioenvs/uno/SPI -I/Users/ikravets/Downloads/Arduino-development/libraries/MySensors src/tmp_ino_to.cpp
    avr-ar rcs .pioenvs/uno/libFrameworkArduinoVariant.a
    avr-ranlib .pioenvs/uno/libFrameworkArduinoVariant.a
    avr-g++ -o .pioenvs/uno/FrameworkArduino/CDC.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/CDC.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/HardwareSerial.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/HardwareSerial.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/HardwareSerial0.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/HardwareSerial0.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/HardwareSerial1.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/HardwareSerial1.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/HardwareSerial2.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/HardwareSerial2.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/HardwareSerial3.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/HardwareSerial3.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/IPAddress.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/IPAddress.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/PluggableUSB.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/PluggableUSB.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/Print.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/Print.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/Stream.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/Stream.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/Tone.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/Tone.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/USBCore.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/USBCore.cpp
    avr-gcc -o .pioenvs/uno/FrameworkArduino/WInterrupts.o -c -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/WInterrupts.c
    avr-g++ -o .pioenvs/uno/FrameworkArduino/WMath.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/WMath.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/WString.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/WString.cpp
    avr-gcc -x assembler-with-cpp -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant -c -o .pioenvs/uno/FrameworkArduino/_wiring_pulse.o .pioenvs/uno/FrameworkArduino/_wiring_pulse.S
    avr-g++ -o .pioenvs/uno/FrameworkArduino/abi.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/abi.cpp
    avr-gcc -o .pioenvs/uno/FrameworkArduino/hooks.o -c -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/hooks.c
    avr-g++ -o .pioenvs/uno/FrameworkArduino/main.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/main.cpp
    avr-g++ -o .pioenvs/uno/FrameworkArduino/new.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/new.cpp
    avr-gcc -o .pioenvs/uno/FrameworkArduino/wiring.o -c -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/wiring.c
    avr-gcc -o .pioenvs/uno/FrameworkArduino/wiring_analog.o -c -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/wiring_analog.c
    avr-gcc -o .pioenvs/uno/FrameworkArduino/wiring_digital.o -c -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/wiring_digital.c
    avr-gcc -o .pioenvs/uno/FrameworkArduino/wiring_pulse.o -c -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/wiring_pulse.c
    avr-gcc -o .pioenvs/uno/FrameworkArduino/wiring_shift.o -c -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/wiring_shift.c
    avr-ar rcs .pioenvs/uno/libFrameworkArduino.a .pioenvs/uno/FrameworkArduino/CDC.o .pioenvs/uno/FrameworkArduino/HardwareSerial.o .pioenvs/uno/FrameworkArduino/HardwareSerial0.o .pioenvs/uno/FrameworkArduino/HardwareSerial1.o .pioenvs/uno/FrameworkArduino/HardwareSerial2.o .pioenvs/uno/FrameworkArduino/HardwareSerial3.o .pioenvs/uno/FrameworkArduino/IPAddress.o .pioenvs/uno/FrameworkArduino/PluggableUSB.o .pioenvs/uno/FrameworkArduino/Print.o .pioenvs/uno/FrameworkArduino/Stream.o .pioenvs/uno/FrameworkArduino/Tone.o .pioenvs/uno/FrameworkArduino/USBCore.o .pioenvs/uno/FrameworkArduino/WInterrupts.o .pioenvs/uno/FrameworkArduino/WMath.o .pioenvs/uno/FrameworkArduino/WString.o .pioenvs/uno/FrameworkArduino/_wiring_pulse.o .pioenvs/uno/FrameworkArduino/abi.o .pioenvs/uno/FrameworkArduino/hooks.o .pioenvs/uno/FrameworkArduino/main.o .pioenvs/uno/FrameworkArduino/new.o .pioenvs/uno/FrameworkArduino/wiring.o .pioenvs/uno/FrameworkArduino/wiring_analog.o .pioenvs/uno/FrameworkArduino/wiring_digital.o .pioenvs/uno/FrameworkArduino/wiring_pulse.o .pioenvs/uno/FrameworkArduino/wiring_shift.o
    avr-ranlib .pioenvs/uno/libFrameworkArduino.a
    avr-g++ -o .pioenvs/uno/SPI/SPI.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -Wall -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10606 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant -I.pioenvs/uno/SPI .pioenvs/uno/SPI/SPI.cpp
    avr-ar rcs .pioenvs/uno/libSPI.a .pioenvs/uno/SPI/SPI.o
    avr-ranlib .pioenvs/uno/libSPI.a
    avr-g++ -o .pioenvs/uno/firmware.elf -Os -mmcu=atmega328p -Wl,--gc-sections,--relax .pioenvs/uno/src/tmp_ino_to.o -L.pioenvs/uno -Wl,--start-group -lm .pioenvs/uno/libFrameworkArduinoVariant.a .pioenvs/uno/libFrameworkArduino.a .pioenvs/uno/libSPI.a -Wl,--end-group
    avr-objcopy -O ihex -R .eeprom .pioenvs/uno/firmware.elf .pioenvs/uno/firmware.hex
    "avr-size" --mcu=atmega328p -C -d .pioenvs/uno/firmware.elf
    AVR Memory Usage
    ----------------
    Device: atmega328p
    
    Program:   13988 bytes (42.7% Full)
    (.text + .data + .bootloader)
    
    Data:        697 bytes (34.0% Full)
    (.data + .bss + .noinit)
    


  • Hi,

    I use Source Insight. Sure it's not free but it's a full featured tools never equaled (like Visual Assist plug in for Visual Studio).



  • HI

    I've been trying vs code

    It has GIT integration, Arduino file format and some auto complete.

    vs_code_A.png

    It is also capable of verifying and uploading the sketch

    vs_code_b.png

    Cheers


  • Mod

    atmel added arduino support to their latest atmel studio v7
    not tested yet, but it should be also an option


  • Mod

    I've (very) recently moved from Eclipse to IntelliJ for my Java and PyCharm for my Python development.
    I am really happy and have a subscription for the whole IDE ecosystem from JetBrains.

    With that comes CLion which also has an Arduino Plugin.
    I have not tried using it yet but it looks good.
    And CLion also works with PlatformIO (http://docs.platformio.org/en/latest/ide/clion.html)



  • Hello,

    @smilvert I would like to know if you succeed using PlatformIO.

    Thank you


  • Admin

    MySensors is on plaformio, so I guess it should work.

    http://platformio.org/lib/show/548/MySensors



  • @Daniel-Oliveira We have some problems with previous PlatformIO 2.0 Build System and MySensor Library structure. All these issues are resolved in PlatformIO 3.0 where are introduced new build system and library manager with support for 3-rd party manifests (Arduino's library.properties, ARM mbed module.json).

    PlatformIO 3.0 has not been finally released. We released the first public alpha version. How to use it?

    1. Install PlatformIO IDE or PlatformIO CLI and switch it to development version.
    2. Menu: PlatformIO > Initialize new project
    3. Open platformio.ini project configuration files (will be created in the project)
    4. Specify project dependencies. See docs for lib_deps option.
    5. Press build/upload button.

    For example, the final project configuration file for the Arduino Uno will look like:

    [env:uno]
    platform = atmelavr
    framework = arduino
    board = uno
    lib_deps = MySensors
    

    You can also specify Semantic Versioning rules and depend on the specific version or range of versions. For example, lib_deps = MySensors@~2.0.1-beta means that any version of 2.0.x (including beta and higher) is allowed for your project.


  • Admin

    @ivankravets

    You've done a great job on plaformio 👍 , finally a decent library manager with dependency handling.


  • Admin

    @ivankravets

    Great work.. One question, is it possible to install your own hardware profiles? For example for the Sensebender Micro, or the new Gateway device I'm working on?



  • @hek thanks a lot for the feedback 👍



  • @tbowmo Sure, it is possible in PlatformIO 2.0 too. However, we don't recommend to make integration with it. PlatformIO 2.0 has not been changed since 2014 year. It was as hobby/experimental project.

    PlatformIO 3.0 is a new PlatformIO where all hardware related parts were moved to separated repositories. PlatformIO 3.0 is closer to open source. You don't need to contact with The PlatformIO Team (as you need to do it with PlatformIO 2.0) because you can create own development platform, clone existing or just add an own board to the existing development platform. Feel free to make PR and we will merge it.

    We will create "Development Platforms Registry" later. It will 3-rd party developers to register own development platforms and hardware in the public registry.

    The core idea of PlatformIO 3.0 is to provide professional cross-platform build system without dependencies with powerful library manager. It will allow others developers/companies to create awesome software basing on PlatformIO Tools.

    P.S: Here is docs (beta) how to create development platform or integrate custom embedded board: http://docs.platformio.org/en/latest/platforms/custom_platform_and_board.html



  • Hello Mr Kravets,
    Can you give a hint/short explanation why Mysensors 2.0 Compiles ok in the upgraded version (the development branch). I can understand its maybe one off your internal secrets but i think that it can be benificial for others. I love a lot one off the "concurrent" IDE (Arduino Eclipse) and the (for my case) Problem is that it doesn't compile Mysensors 2.0. I assume with my limited knowledge and observations off the compiler errors the problems there are related..
    -I Also tested the build and it took severall attempt to get it compiling. Unfotunatly i cannot reproduce it (Windows usr 😉 ) I had to fiddle severall times in the PATH var and settings and restart the IDE ....

    Anyway I hope that Arduino ide sees one day the Light and gets some inspiration on a project like this or even better start co-operating....
    Good work !!!



  • @stedew said:

    Can you give a hint/short explanation why Mysensors 2.0 Compiles ok in the upgraded version (the development branch). I can understand its maybe one off your internal secrets but i think that it can be benificial for others.

    This is not a secret. PlatformIO 2.0 doesn't support 3-rd party library manifests. These different manifests are suitable for the own builders. For example, Arduino IDE builder has own behaviour. If library doesn't contain src folder, then it will build only source files from the root of library (other folders are ignored). If src directory exists, then only the source code from src should be built. The another story is with ARM mbed compiler.

    PlatformIO 3.0 is an unique cross-platform ecosystem that replaces all builders above and allows you to build different project in the same manner. We wrote different extensions for PlatformIO 3.0 Build System that allow handling 3-rd party manifests and "configure" build system on-the-fly. What is more, we don't depend on Arduino IDE, Java or ARM mbed yotta. PlatformIO is written in pure Python and doesn't depend on OS software. The only 1 requirement is Python interpreter (that is installed everywhere except Windows).

    -I Also tested the build and it took severall attempt to get it compiling. Unfotunatly i cannot reproduce it (Windows usr 😉 ) I had to fiddle severall times in the PATH var and settings and restart the IDE ....

    Could you explain in details? Thanks.



  • Hmm tnx for the clarification
    I have a small party here (Wife birthday) so I will try to reproduce it later.
    Otherwise the automatic script Divorse now will start...
    regards,
    Stefan.



  • @stedew my congrats for your wife 😊 💐 🎂


  • Admin

    @ivankravets

    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/boards

    In PlatformIO you have to specify platform type for the build environment in platformio.ini. board and framework options are optional. You don't need to keep framework/SDK code within library. Development platform depends on it. See

    See 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.


  • Admin

    @ivankravets

    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 🙂



  • @tbowmo

    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.yml for you.


  • Admin

    @ivankravets said:

    I can prepare .travis.yml for you.

    That would be great!



  • 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...



  • @dpressle

    1. Do you use the latest http://docs.platformio.org/en/stable/installation.html#development-version ?
    2. Do you have #include <Arduino.h> in one of your project file?


  • @ivankravets said:

    @dpressle

    1. Do you use the latest http://docs.platformio.org/en/stable/installation.html#development-version ?
    2. 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.



  • @hek

    .travis.yml config (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; fi
    

    Here 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 for examples/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



  • @ivankravets
    Hello Mr Ivankravets

    Ok 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 controller

    PlatformIO:
    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.



  • @stedew

    1. 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?

    1. 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.

    1. Start cmd (Powershell in Windoze) from PlatformIO
    2. 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.ini config: 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-history

    Specify 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?



  • @ivankravets

    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 controller

    About 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! 😊



  • @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


  • Mod

    @rb3rg I know. It's even bundled with the installer now.
    My post you're referring to is 12 months old...


 

389
Online

7.5k
Users

8.4k
Topics

90.3k
Posts