Installing the firmware is usually done using over-the-air updates from our official releases. Here are the steps to install custom firmware:
- Prepare a FAT32-formatted SD card with a folder called
update. - Copy the
firmware.hexandchecksumsfiles to theupdatefolder. - Place the SD card in the gateway and power cycle the gateway.
SDCARD
└── update
├── checksums
└── firmware.hex
| Branch | Downloads | Notes |
|---|---|---|
stable |
firmware.hex checksums |
Default over-the-air update channel |
beta |
firmware.hex checksums |
Over-the-air update channel when "Beta Updates" enabled |
master |
firmware.hex checksums |
Release candidate for stable |
develop |
firmware.hex checksums |
Release candidate for beta |
You probably already have the following "essential" development tools, but just to be sure:
build-essentialor XCode (includesgitandmake)sha256sum(from GNU coreutils)
Get the source code and initialize the submodules to get the dependencies.
git clone https://github.com/TheThingsProducts/gateway.git
git submodule update --initDownload the following tools from the Microchip download pages:
| Tool | Windows | Mac | Linux |
|---|---|---|---|
| MPLAB IDE X v3.45 | link | link | link |
| MPLAB XC32 v1.42 | link | link | link |
| Harmony v1.08.01 | link | link | link |
After building the project using the MPLabX GUI, the paths in the configurations.xml are made platform dependent. In order to fix this, run the ./fix_mplab.sh script.
- Make sure you have downloaded and installed the IDE and compilers stated at Development Setup above.
- Run
./compile.sh. - After successful build, create the
firmware.hexandchecksumsfiles with./generate_hex_with_checksum.sh. - Use those two files in the Installation procedure above.
- Make sure you have downloaded and installed the IDE and compilers stated at Development Setup above.
- Install Jenkins Server
- Create Multi branch Pipline project
- Link this repository
- Hit Scan Multibranch Pipeline Now
- Install Docker
- To build the Docker image, run
docker build -t firmware-builder -f Dockerfile.build .(uou only need to do this once). - To compile the firmware, run
docker run --rm -it -v $(pwd):/build -w /build firmware-builder ./compile.sh && ./generate_hex_with_checksum.sh
| Task | Priority | Size |
|---|---|---|
| LORA_READ | 7 | 4096 |
| TCPIP_TASKS | 6 | 4096 |
| WIFI_DRV | 5 | 2048 |
| SYS_TASKS | 4 | 4096 |
| LORA_TASKS | 3 | 4096 |
| APP_TASKS | 2 | 4096 |
| MQTTTASK | 1 | 4096 |
| Sector | Address | Content | Length (Bytes) |
|---|---|---|---|
| 0 | 0 | SHA256 Hash of current FW | 32 |
| 1 | 4096 | Magic Bytes | 4 |
| 4100 | Network Type | 1 | |
| 4101 | Security Mode | 1 | |
| 4102 | WiFi SSID | 32 + 1 | |
| 4135 | WiFi Security Key | 64 + 1 | |
| 2 | 8192 | Magic Bytes | 4 |
| 8196 | Gateway ID | 100 | |
| 8296 | Gateway Key | 200 | |
| 8496 | Account Server URL | 255 | |
| 8751 | Locked flag | 1 | |
| 3 | 12288 | Magic Bytes | 4 |
| 12292 | FW Image Length | 4 | |
| 12296 | SHA256 Hash of new FW | 32 | |
| 4 | 16384 | FW Image | FW Image Length |