Skip to content

Commit 4b90e15

Browse files
committed
Merge pull request arduino#364 from fallberg/test-sketches
Implemented signing test sketches
2 parents 5a16cf0 + 15167d6 commit 4b90e15

File tree

8 files changed

+180
-7
lines changed

8 files changed

+180
-7
lines changed

libraries/MySensors/MyConfig.h

+1
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@
542542
#if DOXYGEN
543543
#define MY_SIGNING_ATSHA204
544544
#define MY_SIGNING_SOFT
545+
#define MY_SIGNING_REQUEST_SIGNATURES
545546
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
546547
#define MY_IS_RFM69HW
547548
#endif

libraries/MySensors/MySensor.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @def MY_NODE_TYPE
4141
* @brief Contain a string describing the class of sketch/node (gateway/repeater/sensor).
4242
*/
43-
#if defined(MY_GATEWAY_SERIAL) || defined(MY_GATEWAY_W5100) || defined(MY_GATEWAY_ENC28J60) || defined(ARDUINO_ARCH_ESP8266) || defined(MY_GATEWAY_MQTT_CLIENT)
43+
#if defined(MY_GATEWAY_SERIAL) || defined(MY_GATEWAY_W5100) || defined(MY_GATEWAY_ENC28J60) || defined(MY_GATEWAY_ESP8266) || defined(MY_GATEWAY_MQTT_CLIENT)
4444
#define MY_GATEWAY_FEATURE
4545
#define MY_IS_GATEWAY (true)
4646
#define MY_NODE_TYPE "gateway"
@@ -65,10 +65,6 @@
6565
//#undef F
6666
//#define F(x) (x)
6767
#include "core/MyHwESP8266.cpp"
68-
// Enable gateway feature
69-
#if !defined(MY_CORE_ONLY)
70-
#define MY_GATEWAY_ESP8266
71-
#endif
7268
#elif defined(ARDUINO_ARCH_AVR)
7369
#include "core/MyHwATMega328.cpp"
7470
#elif defined(ARDUINO_ARCH_SAMD)
@@ -296,7 +292,7 @@
296292
#include <Arduino.h>
297293

298294
#if !defined(MY_CORE_ONLY)
299-
#if defined(MY_GATEWAY_ESP8266)
295+
#if defined(ARDUINO_ARCH_ESP8266)
300296
#include "core/MyMainESP8266.cpp"
301297
#else
302298
#include "core/MyMainDefault.cpp"

libraries/MySensors/examples/GatewayESP8266/GatewayESP8266.ino

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
#define MY_RADIO_NRF24
7979
//#define MY_RADIO_RFM69
8080

81-
// Gateway mode always enabled for ESP8266. But we add this anyway ;)
8281
#define MY_GATEWAY_ESP8266
8382

8483
#define MY_ESP8266_SSID "MySSID"

libraries/MySensors/examples/GatewayESP8266MQTTClient/GatewayESP8266MQTTClient.ino

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
//#define MY_RADIO_RFM69
7272

7373
#define MY_GATEWAY_MQTT_CLIENT
74+
#define MY_GATEWAY_ESP8266
7475

7576
// Set this nodes subscripe and publish topic prefix
7677
#define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* The MySensors Arduino library handles the wireless radio link and protocol
3+
* between your home built sensors/actuators and HA controller of choice.
4+
* The sensors forms a self healing radio network with optional repeaters. Each
5+
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
6+
* network topology allowing messages to be routed to nodes.
7+
*
8+
* Created by Henrik Ekblad <[email protected]>
9+
* Copyright (C) 2013-2015 Sensnology AB
10+
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
11+
*
12+
* Documentation: http://www.mysensors.org
13+
* Support Forum: http://forum.mysensors.org
14+
*
15+
* This program is free software; you can redistribute it and/or
16+
* modify it under the terms of the GNU General Public License
17+
* version 2 as published by the Free Software Foundation.
18+
*
19+
*******************************
20+
*/
21+
#define MY_DEBUG
22+
#define MY_DEBUG_VERBOSE_SIGNING
23+
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
24+
//#define MY_SIGNING_SOFT //!< Software signing
25+
#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
26+
//#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
27+
#define MY_SIGNING_REQUEST_SIGNATURES
28+
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
29+
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
30+
31+
#include <SPI.h>
32+
#include <MySensor.h>
33+
34+
void setup() {
35+
}
36+
37+
void presentation() {
38+
// Present locally attached sensors here
39+
}
40+
41+
42+
void loop() {
43+
// Send locally attached sensors data here
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* The MySensors Arduino library handles the wireless radio link and protocol
3+
* between your home built sensors/actuators and HA controller of choice.
4+
* The sensors forms a self healing radio network with optional repeaters. Each
5+
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
6+
* network topology allowing messages to be routed to nodes.
7+
*
8+
* Created by Henrik Ekblad <[email protected]>
9+
* Copyright (C) 2013-2015 Sensnology AB
10+
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
11+
*
12+
* Documentation: http://www.mysensors.org
13+
* Support Forum: http://forum.mysensors.org
14+
*
15+
* This program is free software; you can redistribute it and/or
16+
* modify it under the terms of the GNU General Public License
17+
* version 2 as published by the Free Software Foundation.
18+
*
19+
*******************************
20+
*/
21+
#define MY_DEBUG
22+
#define MY_DEBUG_VERBOSE_SIGNING
23+
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
24+
//#define MY_SIGNING_SOFT //!< Software signing
25+
#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
26+
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
27+
#define MY_SIGNING_REQUEST_SIGNATURES
28+
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
29+
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
30+
31+
#include <SPI.h>
32+
#include <MySensor.h>
33+
34+
void setup() {
35+
}
36+
37+
void presentation() {
38+
// Present locally attached sensors here
39+
}
40+
41+
42+
void loop() {
43+
// Send locally attached sensors data here
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* The MySensors Arduino library handles the wireless radio link and protocol
3+
* between your home built sensors/actuators and HA controller of choice.
4+
* The sensors forms a self healing radio network with optional repeaters. Each
5+
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
6+
* network topology allowing messages to be routed to nodes.
7+
*
8+
* Created by Henrik Ekblad <[email protected]>
9+
* Copyright (C) 2013-2015 Sensnology AB
10+
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
11+
*
12+
* Documentation: http://www.mysensors.org
13+
* Support Forum: http://forum.mysensors.org
14+
*
15+
* This program is free software; you can redistribute it and/or
16+
* modify it under the terms of the GNU General Public License
17+
* version 2 as published by the Free Software Foundation.
18+
*
19+
*******************************
20+
*/
21+
#define MY_DEBUG
22+
#define MY_DEBUG_VERBOSE_SIGNING
23+
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
24+
#define MY_SIGNING_SOFT //!< Software signing
25+
//#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
26+
//#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
27+
#define MY_SIGNING_REQUEST_SIGNATURES
28+
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
29+
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
30+
31+
#include <SPI.h>
32+
#include <MySensor.h>
33+
34+
void setup() {
35+
}
36+
37+
void presentation() {
38+
// Present locally attached sensors here
39+
}
40+
41+
42+
void loop() {
43+
// Send locally attached sensors data here
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* The MySensors Arduino library handles the wireless radio link and protocol
3+
* between your home built sensors/actuators and HA controller of choice.
4+
* The sensors forms a self healing radio network with optional repeaters. Each
5+
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
6+
* network topology allowing messages to be routed to nodes.
7+
*
8+
* Created by Henrik Ekblad <[email protected]>
9+
* Copyright (C) 2013-2015 Sensnology AB
10+
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
11+
*
12+
* Documentation: http://www.mysensors.org
13+
* Support Forum: http://forum.mysensors.org
14+
*
15+
* This program is free software; you can redistribute it and/or
16+
* modify it under the terms of the GNU General Public License
17+
* version 2 as published by the Free Software Foundation.
18+
*
19+
*******************************
20+
*/
21+
#define MY_DEBUG
22+
#define MY_DEBUG_VERBOSE_SIGNING
23+
#define MY_RADIO_NRF24 //!< NRF24L01 radio driver
24+
#define MY_SIGNING_SOFT //!< Software signing
25+
//#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A
26+
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
27+
#define MY_SIGNING_REQUEST_SIGNATURES
28+
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //!< Unconnected analog pin for random seed
29+
#define MY_SIGNING_ATSHA204_PIN 17 //!< A3 - pin where ATSHA204 is attached
30+
31+
#include <SPI.h>
32+
#include <MySensor.h>
33+
34+
void setup() {
35+
}
36+
37+
void presentation() {
38+
// Present locally attached sensors here
39+
}
40+
41+
42+
void loop() {
43+
// Send locally attached sensors data here
44+
}

0 commit comments

Comments
 (0)