Skip to content
A mysensors bootloader to mqtt bridge process
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test_files Fix tests; correct expected output Jul 12, 2016
.gitignore Go Modules; Minor Refactoring Nov 8, 2018
.travis.yml Golang 1.12 Feb 27, 2019
Dockerfile.template Golang 1.12 Feb 27, 2019
LICENSE.md Switching to Go Jun 26, 2016
Makefile Docker version should use git tag as well May 17, 2019
README.md
bootloaderCommands.go Cobra/Viper -> YAML/ENV Nov 12, 2018
config.go Consistency between golang projects Dec 12, 2018
consts.go Cobra/Viper -> YAML/ENV Nov 12, 2018
firmware.go Cobra/Viper -> YAML/ENV Nov 12, 2018
firmwareConfiguration.go Cobra/Viper -> YAML/ENV Nov 12, 2018
firmwareInformation.go Cobra/Viper -> YAML/ENV Nov 12, 2018
firmwareRequest.go Cobra/Viper -> YAML/ENV Nov 12, 2018
go.mod Upgrade mqtt lib May 17, 2019
go.sum Upgrade mqtt lib May 17, 2019
main.go Compile-time DI Nov 22, 2018
mysb.go Consistency between golang projects Dec 12, 2018
mysb_test.go
nodeSettings.go Cobra/Viper -> YAML/ENV Nov 12, 2018
util.go Cobra/Viper -> YAML/ENV Nov 12, 2018
wire.go Consistency between golang projects Dec 12, 2018
wire_gen.go Consistency between golang projects Dec 12, 2018

README.md

Mysb

Software License Travis CI Coverage Status Go Report Card

A Firmware Uploading Tool for the MYSBootloader via MQTT

Installation

Via Docker

docker run -d --name="mysb" -v /etc/localtime:/etc/localtime:ro mannkind/mysb

Via Make

git clone https://github.com/mannkind/mysb
cd mysb
make
./mysb

Configuration

Configuration happens via environmental variables

MYSB_SUBTOPIC           - [OPTIONAL] The MQTT topic on which to subscribe, defaults to "mysensors_rx"
MYSB_PUBTOPIC           - [OPTIONAL] The MQTT topic on which to publish, defaults to "mysensors_tx"
MYSB_AUTOID             - [OPTIONAL] The flag that indicates Mysb should handle ID requests, defaults to false
MYSB_NEXTID             - [OPTIONAL] The number on which to base the next id, defaults to 1
MYSB_FIRMWAREBASEPATH   - [OPTIONAL] The path to the firmware files, defaults to "/config/firmware"
MYSB_NODES              - [OPTIONAL] The nodes configuration (see below)
MQTT_CLIENTID           - [OPTIONAL] The clientId, defaults to "DefaultMysbClientID"
MQTT_BROKER             - [OPTIONAL] The MQTT broker, defaults to "tcp://mosquitto.org:1883"
MQTT_USERNAME           - [OPTIONAL] The MQTT username, default to ""
MQTT_PASSWORD           - [OPTIONAL] The MQTT password, default to ""

The file referenced by MYSB_NODES might look something like the following

default: {
    type: 1,
    version: 1
}
1: { type: 1, version: 1 }
2: { type: 3, version: 1 }
3: { type: 1, version: 2 }
4: { type: 1, version: 1 }
5: { type: 2, version: 3 }

The firmware a node is using is a combination of a type and a version. The priority of the firmware used is based on the following:

  1. A type/version assigned to the node in the config.yaml file
  2. The requested type/version sent in the configuration request
  3. The default firmware setup in the config.yaml file

The location of the firmware picked is relative to the control['firmwarebasepath'] setting in config.yaml.

E.g. /path/to/config_folder/firmware/type/version/firmware.hex

$ find /path/to/config_folder/firmware
/path/to/config_folder/firmware/3
/path/to/config_folder/firmware/3/1
/path/to/config_folder/firmware/3/1/firmware.hex
/path/to/config_folder/firmware/2
/path/to/config_folder/firmware/2/1
/path/to/config_folder/firmware/2/1/firmware.hex
/path/to/config_folder/firmware/2/2
/path/to/config_folder/firmware/2/2/firmware.hex
/path/to/config_folder/firmware/2/3
/path/to/config_folder/firmware/2/3/firmware.hex
/path/to/config_folder/firmware/1
/path/to/config_folder/firmware/1/1
/path/to/config_folder/firmware/1/1/firmware.hex
/path/to/config_folder/firmware/1/2
/path/to/config_folder/firmware/1/2/firmware.hex
You can’t perform that action at this time.