57
57
* - Connect GPIO2 via 10K resistor to VCC
58
58
* - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch')
59
59
*
60
- * Signing, RF69 radio, inclusion button and a separate SPI flash are not supported yet!
60
+ * Inclusion mode button:
61
+ * - Connect GPIO5 via switch to GND ('inclusion switch')
62
+ *
63
+ * * Signing, RF69 radio and a separate SPI flash are not supported yet!
61
64
*
62
65
* Make sure to fill in your ssid and WiFi password below for ssid & pass.
63
66
*/
78
81
const char *ssid = " MySSID" ; // cannot be longer than 32 characters!
79
82
const char *pass = " MyVerySecretPassword" ; //
80
83
81
- #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
82
- // #define INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button
84
+ #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
85
+ #define INCLUSION_MODE_PIN 5 // Digital pin used for inclusion mode button
83
86
84
87
#define RADIO_CE_PIN 4 // radio chip enable
85
88
#define RADIO_SPI_SS_PIN 15 // radio SPI serial select
@@ -127,9 +130,9 @@ void output(const char *fmt, ... ) {
127
130
void setup ()
128
131
{
129
132
// Setup console
130
- Serial. begin ( 115200 );
133
+ hw_init ( );
131
134
132
- Serial.println ();
135
+ Serial.println (); Serial. println ();
133
136
Serial.println (" ESP8266 MySensors Gateway" );
134
137
Serial.print (" Connecting to " ); Serial.println (ssid);
135
138
@@ -142,15 +145,8 @@ void setup()
142
145
Serial.print (" IP: " ); Serial.println (WiFi.localIP ());
143
146
Serial.flush ();
144
147
145
- #ifndef INCLUSION_MODE_PIN
146
- setupGateway (255 , INCLUSION_MODE_TIME, output);
147
- #else
148
148
setupGateway (INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output);
149
149
150
- // Add interrupt for inclusion button to pin
151
- PCintPort::attachInterrupt (pinInclusion, startInclusionInterrupt, RISING);
152
- #endif
153
-
154
150
// Initialize gateway at maximum PA level, channel 70 and callback for write operations
155
151
gw.begin (incomingMessage, 0 , true , 0 );
156
152
@@ -162,10 +158,8 @@ void setup()
162
158
void loop () {
163
159
gw.process ();
164
160
165
- #ifdef INCLUSION_MODE_PIN
166
161
checkButtonTriggeredInclusion ();
167
162
checkInclusionFinished ();
168
- #endif
169
163
170
164
// check if there are any new clients
171
165
if (server.hasClient ())
0 commit comments