Skip to content

Building firmware on THiNX CI

Matej Sychra edited this page Nov 28, 2017 · 1 revision

Dockerized Builders

In THiNX CI, Dockerized builders provide build support for various languages and platforms, and allow for extending THiNX server with support for any other platform.

How it works

  • Pre-builder performs a git repository pre-fetch, infers platform and performs basic code style check (lint)
  • Builder enters the git repository (and respective platform project folder if needed)
  • Builder starts Docker builder for given platform and fetches artefacts from ./build directory in the git repository.
  • Builder calls to Notifier in order to let users and devices know of new firmware update available.

Each platform can be configured by its set of parameters in thinx.yml file:

Arduino

Place the thinx.yml next to your .ino file. Example contents:

arduino:
  platform: esp8266com
  arch: esp8266
  board: d1_mini
  flash_ld: eagle.flash.4m1m.ld
  f_cpu: 80
  flash_size: 4M
  libs:
    - THiNX
    - PubSubClient
    - WiFiManager
    - ArduinoJSON

This example configuration will build using Arduino CLI (1.8.x) extended with support for ESP8266.

The platform attribute is a directory name inside the Arduino/hardware folder.

The arch attribute is a directory name inside the platform folder.

The board attribute is a board name from respective boards.txt file for given platform:arch combination.

The flash_ld attribute attaches board.flash_ld parameter to the end boards.txt in order to fix internal Arduino UI dependency. Allows for adjusting required SPIFFS size/memory partitioning using standard LD files.

The libs attribute is a list of dependencies - libraries, that should be fetched by Arduino Library Manager prior to build. THiNX is a default library as expected.

Microphython

Place the thinx.yml into your project root. Example contents:

micropython:
  platform: esp8266
  modules:
    - _boot.py
    - apa102.py
    - boot.py
    - dht.py
    - ds18x20.py
    - flashbdev.py
    - inisetup.py
    - neopixel.py
    - ntptime.py
    - onewire.py
    - port_diag.py
    - upip.py
    - upip_utarfile.py
    - webrepl.py
    - webrepl_setup.py
    - websocket_helper.py

The micropython currently following attributes:

The platform is a name of the variant folder inside Micropython Firmware. Currently allows teensy, pic16bit cc3200 and esp8266 where only the ESP8266 is currently tested and developed for.

The modules is an array list of modules in micropython/[:platform:]/modules folder to be kept. Anything unlisted except for _boot.py will be deleted.

NodeMCU

Place the thinx.yml into your project root. Example contents:

nodemcu:
  modules:
    c:
      - coap
      - crypto
      - driver
      - esp-gdbstub
      - fatfs
      - http
      - include
      - libc
      - lua
      - lwip
      - mapfile
      - misc
      - modules
      - mqtt
      - net
      - platform
      - pm
      - sjson
      - spiffs
      - swTimer
      - task
      - websocket
    lua:
      - thinx

The modules attribute has two sections: c and lua which by default lists all firmware modules available in the NodeMCU Firmware. Builder takes this list and deletes everything that is not included in the list before building the firmware.

PlatformIO

The thinx.yml file is not supported, because it's not required so far (all the functionality is provided by platformio.ini).

MongooseOS

The thinx.yml file is not supported, because it's not required so far.

Clone this wiki locally