4.2 Understanding the installer.sh

When the installer is launched:

$./installer.sh

It launches in interactive mode and shows a list of tasks it needs to process. They are all RED first as nothing is completed.

For proceeding one step at a time use [Y/n]: y/Y for next step, n/N for quitting the installer.

1. Locate Setting's File:

The first step being for it is to confirm if settings_installer.yaml is there or not. It's really a sanity check.

Once the file is located, it's going to show you all the info of parsed data like the:

What is happening here is being illustrated below.

Mechanism for locating settings file, then loading the custom parameters

2. Install arduino-cli:

As the next step, to install arduino-cli with necessary configuration, the script, after parsing the installer_settings.yaml , double confirms with the user, if they want to install in the location mentioned in the settings file. If YES, then it downloads and installed the cli in that location.

If NOT, then the user is asked to provide a path. Then the installer checks if there is already a cli binary there, if not then it installs it there, in the newly specified location and after that it updates/overwrites the new user given location of the cli binary in the settings file.

3. Configure arduino-cli:

The installer checks, in the default location of cli config file (that arduino-cli uses), if the config file exists. If not it creates one and edits a parameter to allow libraries installation from git links.

If it doesn't exist, then it creates the config file in the default location and sets the same parameter to allow additional external libraries installation from git links.

It also inserts, in the same cli's config file, the list of additional board's links (mentioned by user in the installer_settings file), from which additional boards and cores will be installed.

4. Install the cores and boards mentioned in the installer settings file:

5. Install the additional libraries mentioned in the installer settings file:

6. Clone the main firmware/s to the system (as mentioned in the installer settings):

TBD

NOTE:

The installer script writes necessary details, post installation and system configuration, to another file: programmer_settings.yaml which is used by our sample programming scripts/systems.

Note: As a side note: for my watch project, I'm using an ATTINY-1607 as the main uC.

Let's take a look in the programmer_settings.yaml

BINARY:
    LOCATION: /home/pi/bin/arduino-cli

MICROCONTROLLER:
    # Edit this parameters for your needs
    TARGET: 
        NAME: ATTINY1607 # just a nice name for usage in UI
        CORE: megaTinyCore:megaavr:atxy7
    FUSES:
        CHIP: 1607
        CLOCK: 5internal
        BOD: 1v8
        BODMODE: disabled
        EEPROM_SAVE: enable
        MILLIS: enabled
        RESET_PIN: UPDI
        STARTUP_TIME: 0
        UARTV: skip
        PROGRAMMER: pyupdi

FIRMWARE:
    SKETCHES:
        - /home/pi/Arduino/sketchbook/clock_firmware_production

Please keep in mind this is just a sample file that I'm using for my specific use case. So the programmer that uses this settings file is heavily customised for my specific use case. The main customisation happens in the FUSES tab as that is where you define the parameters top be passed to arduino-cli upload command (in my custom shell-script programmer.sh)

The installer.sh edits and appends/adds the following ( during system configuration from previous step. ) to theprogrammer_settings.yaml

BINARY:
    LOCATION: ...
.
.
.
FIRMWARE:
    SKETCHES:
        - ...

The other fields are meant to be updated by the end user.

Last updated

Was this helpful?