Change order of ethernet/radio intialization to avoid troubles.
This commit is contained in:
@@ -101,8 +101,6 @@ void output(const char *fmt, ... ) {
|
|||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
// Initialize gateway at maximum PA level, channel 70 and callback for write operations
|
|
||||||
gw.begin(incomingMessage, 0, true, 0);
|
|
||||||
|
|
||||||
Ethernet.begin(mac, myIp);
|
Ethernet.begin(mac, myIp);
|
||||||
setupGateway(RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN, INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output);
|
setupGateway(RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN, INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output);
|
||||||
@@ -117,6 +115,10 @@ void setup()
|
|||||||
// give the Ethernet interface a second to initialize
|
// give the Ethernet interface a second to initialize
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
|
// Initialize gateway at maximum PA level, channel 70 and callback for write operations
|
||||||
|
gw.begin(incomingMessage, 0, true, 0);
|
||||||
|
|
||||||
|
|
||||||
// start listening for clients
|
// start listening for clients
|
||||||
server.begin();
|
server.begin();
|
||||||
|
|
||||||
|
|||||||
@@ -145,8 +145,6 @@ void incomingMessage(const MyMessage &message) {
|
|||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
// Initialize gateway at maximum PA level, channel 70 and callback for write operations
|
|
||||||
gw.begin(incomingMessage, 0, true, 0);
|
|
||||||
Ethernet.begin(TCP_MAC, TCP_IP);
|
Ethernet.begin(TCP_MAC, TCP_IP);
|
||||||
|
|
||||||
|
|
||||||
@@ -177,6 +175,10 @@ void setup()
|
|||||||
// give the Ethernet interface a second to initialize
|
// give the Ethernet interface a second to initialize
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
|
|
||||||
|
// Initialize gateway at maximum PA level, channel 70 and callback for write operations
|
||||||
|
gw.begin(incomingMessage, 0, true, 0);
|
||||||
|
|
||||||
// start listening for clients
|
// start listening for clients
|
||||||
server.begin();
|
server.begin();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user