From 1dbe7497bdfb47e043402ae77036f9df26de5732 Mon Sep 17 00:00:00 2001 From: ToSa27 Date: Mon, 25 Aug 2014 18:34:51 +0200 Subject: [PATCH] Added technical details for controller developers regarding OTA bootloader --- Bootloader/Readme.md | 48 +++++++++++++++++++++++++++- NodeJsController/NodeJsController.js | 4 +-- NodeJsController/Readme.md | 4 +-- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/Bootloader/Readme.md b/Bootloader/Readme.md index 810b16a..b6d7e33 100644 --- a/Bootloader/Readme.md +++ b/Bootloader/Readme.md @@ -1 +1,47 @@ -See NodeJsController/Readme.md for usage instructions... \ No newline at end of file +See NodeJsController/Readme.md for usage instructions... + +

Technical details to write your own controller

+All initialization the bootloader does (finding parent / requesting nodeId on first start) uses the same packets as a normal MySensors sketch. There is no need for the controller to distinguish between packets from the bootloader and packets from normal sketch execution. The controller only needs to care about two additional request/response communications. All communication is binary. +

FirmwareConfig

+ +

Firmware

+ +

+typedef struct
+{
+ uint16_t type;
+ uint16_t version;
+ uint16_t block;
+ uint8_t data[FIRMWARE_BLOCK_SIZE];
+} FirmwareResponse; +

diff --git a/NodeJsController/NodeJsController.js b/NodeJsController/NodeJsController.js index fbe1470..8bb67da 100644 --- a/NodeJsController/NodeJsController.js +++ b/NodeJsController/NodeJsController.js @@ -11,8 +11,8 @@ const dbAddress = '127.0.0.1'; const dbPort = 27017; const dbName = 'MySensorsDb'; -const fwSketches = [ '../libraries/MySensors/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino' ]; -const fwDefaultType = 0; // index of hex file from array above +const fwSketches = [ ]; +const fwDefaultType = 0xFFFF; // index of hex file from array above (0xFFFF const FIRMWARE_BLOCK_SIZE = 16; const BROADCAST_ADDRESS = 255; diff --git a/NodeJsController/Readme.md b/NodeJsController/Readme.md index 98dee49..d8b364b 100644 --- a/NodeJsController/Readme.md +++ b/NodeJsController/Readme.md @@ -290,10 +290,8 @@ ISP_MCU = m328p

End-to-End Test

Add Firmware to Controller (here: DallasTemperatureSensor)