Thanks for the notes.
Weird thing is, that we’ve not changed the function registration code for the past 2 years, the only thing that’s changed is the DeviceOS version.
I see that some other people are having intermittent issues with function registration, however on Xenons. We see it in Electrons running DeviceOS 1.4.3.
SYSTEM_MODE(SEMI_AUTOMATIC);
//***
Bunch of other non-relevant stuff...
***//
void setup() {
//***
BUNCH OF EEPROM SETUP
**//
//FRAM SETUP
loadProfileModuleStart();
atcab_init( &cfg_ateccx08a_i2c_default );
Wire.begin();
#if PLATFORM_ID == 10 // Electron
// We store connection events in retained memory. Do this early because things like batteryCheck will generate events.
connectionEvents.setup();
// Set up the other modules
sessionCheck.setup();
connectionCheck.setup();
#endif
//Initialize accumulated meter Reading from FRAM
_activeEnergyMeterValue = readActiveEnergyMeter();
//SETUP Functions
calSetupEnterFunction();
//Bypass FRAM for the time being
_framReportingState = FRAMReportingState::OFF;
// We use semi-automatic mode so we can disconnect if we want to, but basically we
// use it like automatic, as we always connect initially.
Particle.connect();
}
void calSetupEnterFunction(){
//loggingEventMessage("ENTER-calSetupEnterFunction",_debugMode);
delay(100);
#ifndef DUTCALIBRATIONRIG
// register the cloud function
Particle.function("setMaxPower", setMaxPowerHandler);
Particle.function("getMaxPower", getMaxPowerPercHandler);
// Particle.function("accMtrPsNg", getAccumulatePosNegHandler);
// Particle.function("toggleDebug", toggleDebugHandler);
// Particle.function("maxConfWP", maxConfigPowerPercHandler);
// Particle.function("getMaxConfWP", getMaxConfigPowerPercHandler);
#endif
//Particle.function("isTimeValid", isTimeValidHandler);
Particle.function("runVRMStest", runVoltageRMStestHandler);
Particle.function("runCRMStest", runCurrentRMStestHandler);
Particle.function("getVoltCalb", getVoltageCalibrationHandler);
Particle.function("setVoltCalb", setVoltageCalibrationHandler);
Particle.function("getCurrCalb", getCurrentCalibrationHandler);
Particle.function("setCurrCalb", setCurrentCalibrationHandler);
Particle.function("reset", resetHandler);
Particle.function("resetSTPM", resetSTPM32Handler);
Particle.function("setConfig", setConfigHandler);
Particle.function("wSerNum", setSerialNumberHandler);
//rSerNum rolled into cmd function
//Particle.function("rSerNum", getSerialNumberHandler);
Particle.function("rssi", rssiHandler);
Particle.function("runCommTest", postHandler);
//Particle.function("test", createStatus);
Particle.function("cmd", cmdHandler);
#ifdef DUTCALIBRATIONRIG
//Particle.subscribe("msgBus", msgBusHandler, MY_DEVICES);
Particle.subscribe("dutVoltMsg", runDeviceUnderTestVoltageHandler, MY_DEVICES);
Particle.subscribe("dutAmpMsg", runDeviceUnderTestCurrentHandler, MY_DEVICES);
//Particle.subscribe("dutCalRst", resetDeviceUnderTestCalOffsetHAndler, MY_DEVICES);
Particle.subscribe("dutSetVCal", setVCalibrationHandler, MY_DEVICES);
Particle.subscribe("dutSetICal", setCCalibrationHandler, MY_DEVICES);
#endif
delay(100);
}