Project package

Status
Not open for further replies.

DenS

Member
Is there a way to bundle a Teensy 3.1 sketch (.ino) with all of the required libraries so it can easily be distributed to others?
My sketch uses libraries that are stored in multiple folders. Any way to put them all in one folder and bundle them with the sketch?

So far this is the one issue I have with the Arduino IDE.... libraries can be accessed from many locations and no way to bundle a them into a project.

Thanks for reading this...

Den
 
If you want to just have it easy for "installation" purposes (for example, upgrading the firmware for your project on your clients) you can send the hex file generated by arduino compiler, and have the users upload the new firmware.
 
Thank you for the reply... This is new to me, I am not sure how to generate the hex nor how to have it imported into the Teensy.

When I try to 'Export the compiled library' I get the message: 'core does not support exporting sketches. Please consider upgrading it...'

I assume that this is what i need to do but obviously there is a problem. Running Arduino 1.6.5 with Teensyduino 1.24

Any suggestions?
 
First understand this, the hex file is a compiled code. not intended to be human readable. I think arduino IDE stores it by default on a temporary folder. If you put arduino preferences on the verbose mode it will tell you where the hex file is (check the last line).

Code:
C:\Program Files (x86)\Arduino/hardware/tools/arm/bin/arm-none-eabi-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 

C:\Users\henri00v\AppData\Local\Temp\build6623520745524610830.tmp/teensyController_v2.cpp.elf 

C:\Users\henri00v\AppData\Local\Temp\build6623520745524610830.tmp/teensyController_v2.cpp.eep 

C:\Program Files (x86)\Arduino/hardware/tools/arm/bin/arm-none-eabi-objcopy -O ihex -R .eeprom 

C:\Users\henri00v\AppData\Local\Temp\build6623520745524610830.tmp/teensyController_v2.cpp.elf 

[B]C:\Users\henri00v\AppData\Local\Temp\build6623520745524610830.tmp/teensyController_v2.cpp.hex[/B]

You can upload hex firmwares to teensy using the teensy loader, under file, open and select the hex.

Vitor Henrique
 
Thanks... useful information.
Still think a 'project' with all the required libraries would be useful.
Two separate functions: upgrading the app or sharing the source code (Project).
Perhaps some day.
 
I don't know how to go about this without at least installing Arduino / teensyduino, however when I was experimenting with creating a library I found I could 'clone' a library into a tab and make local modifications without affecting the 'central installed library. Have you read through / tried to use tabs in Arduino to organize your projects? Here's a link to the library info.

https://www.arduino.cc/en/Hacking/LibraryTutorial

I have not done this in quite some time so I don't think I have any good examples for you. Lately I've been keeping things in one file as I have not mastered the knowledge of whats really going on with Tabs in Arduino.

Cheers -Kb
 
This idea & request has come up before, and at least a few times been seriously proposed as a feature for Arduino.

Publishing a single project meant to be used on a specific piece of hardware, you'd probably like to insulate yourself from unexpected changes in any of the libraries you're using. This could make it easier for people to compile your program, even if they don't already have the libraries you're using?

Or maybe you have other goals you'd like to achieve by this?

The really difficult part is the Arduino Team and creators of other boards like Teensy, and the authors of libraries have slightly different goals.

One major goal, which isn't achieved perfectly, is an API that's hardware independent. Functions like digitalWrite() and Wire.beginTransmission() are supposed to do the same thing on all boards, even though they have radically different GPIO register and I2C ports.

While I might like the idea of people publishing code tightly tied to only Teensy 3.1, the flip side of that coin is widespread use of such a feature would almost certainly result in lots of programs published, tightly tied to only specific hardware. Many would only work on STM32, or AVR based Arduino (and perhaps only specific boards), or only on Arduino Due.

Today many programs work or mostly work across different boards, and the cross-board compatibility situation is gradually improving. If hardware-specific libraries were packaged with programs, at least in terms of sharing of code between people with different hardware, it could be a huge step backwards.

Worse yet, what happens when PJRC makes some new version of Teensy, using a very similar chip. Often similar chips require only minor changes in the libraries. But if old copies of libraries are bundled up with programs, it could cause tremendous future compatibility troubles. With the current scheme, each hardware vendor has quite a lot of ability to solve compatibility issues.

Another huge concern is support. If you look over the last few days of threads in this forum, you'll see cases old versions of libraries had trouble with new versions of Arduino. Usually this is because something in the core library changed, and perhaps that would not be an issue if packaging also copied the core library (causing the above issues to be *much* worse), but sometimes troubles are also related to newer versions of the compiler or how Arduino does things. It's simply not always going to be practical for even a fully packaged set of code to always work the same on all future versions of the dev tools. Keeping libraries with the tools gives the me, the Arduino Team, and the authors of libraries the ability to resolve such issues. Packing old copies takes that ability away and makes supporting users who with to use incompatible programs much, much more work.

Perhaps there could be some way to achieve both set of goals, at least if not fully, much better than is done today. But simply packaging up all the source files is an idea that seems compelling in the context of more easily distributing a program to others, but could come with some really terrible long-term consequences to the entire platform. Very careful, forward looking design needs to be done, and that's quite challenging.
 
Paul,
Thanks for the input. As a long time user of NetBeans the project bundling is something I feel is a worthwhile feature. Currently a new Arduino install could (would) use the latest libraries whereas a sketch may be specific for a prior version. The ILI9341_t3 library is a good example with at least two versions available and not 100% interchangeable. I see this as a possible dilemma for a developer trying to chase issues due to libraries that have changed. A bundled project would assure the correct libraries are distributed with a sketch. If I release a sketch today and in the future someone tries to run it with a new, incompatible, version of a library then what? ... the opposite of what you mention you are seeing on the forum. I do not look forward to supporting that scenario.
I think projects would help with new hardware releases as well. The project definition should include the hardware it was developed for. A developer, be it the original or someone else, could then upgrade the project as needed for the new hardware and release a new version of the project.
One solution may be to offer projects, or maybe call them bundles as it seems microcomputer developers like new terms, as an option.
Part of my confusion may be that I am rather new to this world. It seems like an unorganized free for all. Would be nice to have more control over libraries.
Enjoy!
Den (W2DEN)
PS really enjoying the Teesny. Researching my next project or should I say sketch!
 
These are definitely Arduino platform-level issues.

Until very recently, the Arduino developer took a complete hand-off approach to libraries, so yeah, historically is has been something of a haphazard free-for-all.

Perhaps in time the entire Arduino world will move in this sort of direction. Maybe? But it will need to be done very carefully.
 
Status
Not open for further replies.
Back
Top