You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See NodeJsController/Readme.md for usage instructions...
1
+
See NodeJsController/Readme.md for usage instructions...
2
+
3
+
<h1>Technical details to write your own controller</h1>
4
+
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.
5
+
<h2>FirmwareConfig</h2>
6
+
<ul>
7
+
<li>the bootloader sends a FirmwareConfigRequest packet to the gateway to request information about the firmware it should execute:
8
+
<p>
9
+
typedef struct<br/>
10
+
{<br/>
11
+
uint16_t type;<br/>
12
+
uint16_t version;<br/>
13
+
} FirmwareConfigRequest;
14
+
</p>
15
+
<li>the gateway (the controller) responds with a FirmwareConfigResponse including details about the firmware the sensor should execute:
16
+
<p>
17
+
typedef struct<br/>
18
+
{<br/>
19
+
uint16_t type;<br/>
20
+
uint16_t version;<br/>
21
+
uint16_t blocks;<br/>
22
+
uint16_t crc;<br/>
23
+
} FirmwareConfigResponse;
24
+
</p>
25
+
</ul>
26
+
<h2>Firmware</h2>
27
+
<ul>
28
+
<li>the bootloader sends a FirmwareRequest packet to the gateway to request a specific subset (block) of the compiled firmware:
29
+
<p>
30
+
typedef struct<br/>
31
+
{<br/>
32
+
uint16_t type;<br/>
33
+
uint16_t version;<br/>
34
+
uint16_t block;<br/>
35
+
} FirmwareRequest;
36
+
</p>
37
+
<li>the gateway (the controller) responds with a FirmwareResponse including the specific block of the compiled firmware:
Copy file name to clipboardExpand all lines: NodeJsController/Readme.md
+1-3
Original file line number
Diff line number
Diff line change
@@ -290,10 +290,8 @@ ISP_MCU = m328p</p>
290
290
<h1>End-to-End Test</h1>
291
291
<h2>Add Firmware to Controller (here: DallasTemperatureSensor)</h2>
292
292
<ul>
293
-
<li>use Arduino IDE or codebender or whatever other way to compile your sketch
294
-
<li>copy the compiled DallasTemperatureSensor.cpp.hex file to the NodeJsController directory (if using the Arduino IDE, enable verbose logging in preferences and then watch the compilation process to find the temp directory where the output is stored)
<li>sudo service mysensors restart (at this point stop/restart doesn't work. use "sudo killall node" followed by "sudo service mysensors start" instead)
0 commit comments