Greebo
(Greebo)
11 August 2023 00:57
22
That sounds like a bug in the sketch on GitHub…
Looking at this:
static void list_calibration(void)
{
// Add effect of DIP switch positions to nodeID
// No change if (DIP1 == OFF) && (DIP2 == OFF)
nodeID = EEProm.nodeID & 0x3F;
if ((dip1 == ON) && (dip2 == OFF)) nodeID = (EEProm.nodeID & 0x3F) + 1;
if ((dip1 == OFF) && (dip2 == ON)) nodeID = (EEProm.nodeID & 0x3F) + 2;
if ((dip1 == ON) && (dip2 == ON)) nodeID = (EEProm.nodeID & 0x3F) + 3;
Serial.print(F("Group ")); Serial.print(EEProm.networkGroup);
Serial.print(F(", Node ")); Serial.print(nodeID);
Serial.print(F(", Band "));
Serial.print(EEProm.RF_freq == RF69_433MHZ ? 433 :
EEProm.RF_freq == RF69_868MHZ ? 868 :
EEProm.RF_freq == RF69_915MHZ ? 915 : 0);
Serial.println(F(" MHz"));
Serial.print(F("pulses enabled = ")); Serial.println(EEProm.pulse_enable);
Serial.print(F("pulse period = ")); Serial.print(EEProm.pulse_period); Serial.println(" ms");
Serial.print(F("DS18B20 enabled = ")); Serial.println(EEProm.temperatureEnabled);
printTemperatureSensorAddresses();
You can see where it prints out the “dip adjusted” Node ID, and sets the global “nodeID” variable (lines 59-62).
However back here:
#ifdef RFM69CW
#if RadioFormat == RFM69_LOW_POWER_LABS
Serial.println("RadioFormat: LowPowerLabs");
#elif RadioFormat == RFM69_JEELIB_CLASSIC
Serial.println("RadioFormat: JeeLib Classic");
#elif RadioFormat == RFM69_JEELIB_NATIVE
Serial.println("RadioFormat: JeeLib Native");
#endif
Serial.println("Init RFM...");
#if RadioFormat == RFM69_LOW_POWER_LABS
radio.initialize(EEProm.RF_freq,EEProm.nodeID,EEProm.networkGroup);
#ifndef RFM69_LPL_AES_ENCRYPTION_KEY
radio.encrypt("89txbe4p8aik5kt3"); // initialize RFM
#else
radio.encrypt(RFM69_LPL_AES_ENCRYPTION_KEY); // initialize RFM
#endif
radio.setPowerLevel(EEProm.rfPower);
#else
rfm_init(); // initialize RFM
#endif
You can see that if you are using LPL, the EEPROM.nodeID is used, not the global “dip adjusted” nodeID.
The “dip adjusted” nodeID is used if you are using the non-LPL methods:
Serial.println("RFM Started");
// Send RFM69CW test sequence (for factory testing)
for (int i = 10; i> -1; i--)
{
emonth.temp=i;
#if RadioFormat == RFM69_LOW_POWER_LABS
// radio.send(5, (const void*)(&emonth), sizeof(emonth));
// radio.sleep();
#else
rfm_send((byte *)&emonth, sizeof(emonth), FACTORYTESTGROUP, nodeID, EEProm.RF_freq, EEProm.rfPower, busyThreshold, busyTimeout);
#endif
delay(100);
}
emonth.temp = 0;
// end of factory test sequence
}
pinMode(DS18B20_PWR,OUTPUT);
pinMode(BATT_ADC, INPUT);
@glyn.hudson Should line 257 of emonth2.ino be changed from:
radio.initialize(EEProm.RF_freq,EEProm.nodeID,EEProm.networkGroup);
to
radio.initialize(EEProm.RF_freq, nodeID, EEProm.networkGroup);
???
1 Like
Greebo
(Greebo)
11 August 2023 01:04
23
I’ve just raised an issue for this in GitHub and referenced this post
Excellent, something about it smelt bad also, thanks
Greebo
(Greebo)
22 August 2023 11:13
26
Looks like the GitHub issue has been closed, so you should be able to upload a new version which honours the DIP switch setting
1 Like