@@ -67,7 +67,7 @@ bool Config::loadConfig() {
67
67
digitalWrite (default_rfm_cs, LOW);
68
68
digitalWrite (alt_rfm_cs, LOW);
69
69
network_id = (uint32_t )(atoi (getConfig (" NETWORK_ID" )));
70
- node_id = (uint8_t )(atoi (getConfig (" NODE_ID" )));
70
+ node_id = (uint8_t )(atoi (getConfig (" NODE_ID" )), 0 );
71
71
collector_id = (uint8_t )(atoi (getConfig (" COLLECTOR_ID" )));
72
72
rf95_freq = static_cast <float >(atof (getConfig (" RF95_FREQ" )));
73
73
tx_power = (uint8_t )(atoi (getConfig (" TX_POWER" )));
@@ -87,12 +87,19 @@ bool Config::loadConfig() {
87
87
logln (F (" ERROR: No config file found" ));
88
88
return false ;
89
89
}
90
- WifiConfig::loadConfig ();
90
+ // Serial.print("Loading WiFi config .."); // TODO: collector only?
91
+ // WifiConfig::loadConfig();
92
+ // Serial.println(".. done");
93
+ Serial.print (" Loading LoRa config .." );
91
94
RadioConfig::loadConfig ();
92
- logln ( F ( " Config loaded " ) );
95
+ Serial. println ( " .. done " );
93
96
if (!node_id) {
94
- logln (F (" ERROR: Missing required config parameter NODE_ID" ));
95
- fail (FAIL_CODE_BAD_CONFIG);
97
+ Serial.println (" Node ID not configured. Using Lower byte of Si7021 serial number A." );
98
+ Adafruit_Si7021 _sensor = Adafruit_Si7021 ();
99
+ _sensor.begin ();
100
+ node_id = (byte)_sensor.sernum_a ;
101
+ Serial.print (" NODE ID: " );
102
+ Serial.println (node_id);
96
103
}
97
104
return true ;
98
105
}
0 commit comments