NEWS
Sending messages to iobroker instance
-
Hello community
I have my NodeMCU sketch up and running. In the serial monitor it looks ok, but the controller (iobroker with mysensors instance)
does not receive any messages. I can read the temperature, but then the sketch runs into an exception and does a stack trace.
?? Best regards and any help is appreciated.
connected with ho….., channel 1
dhcp client start...
chg_B1:-40
.ip:192.168.1.103,mask:255.255.0.0,gw:192.168.1.1
.IP: 192.168.1.103
–------------------------------------------>Temperature for the device 1 (index 0) is: 24.00
Fatal exception 9(LoadStoreAlignmentCause):
epc1=0x402026c0, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0000002f, depc=0x00000000
Exception (9):
epc1=0x402026c0 epc2=0x00000000 epc3=0x00000000 excvaddr=0x0000002f depc=0x00000000
ctx: cont
sp: 3ffef410 end: 3ffef680 offset: 01a0
stack>>>
3ffef5b0: 3ffef600 3ffee638 00000008 40205ca0
3ffef5c0: 3ffe8750 00000000 000000ff 40207270
3ffef5d0: ffffffff 00000080 3ffee638 00000004
3ffef5e0: 000000e7 3ffef990 3ffef6f8 3ffee650
3ffef5f0: 3fffdad0 3ffef70f 3ffef6f8 402039c8
3ffef600: 3ffef710 00000000 3ffef6cc 40204095
3ffef610: 3fffdad0 00000000 00000006 40202336
3ffef620: 3ffe892c 3ffee61c 3fff0d6c 3ffee650
3ffef630: 3fffdad0 00000000 00000005 40204365
3ffef640: 3fffdad0 00000000 3ffee5f0 402044f5
3ffef650: 00000000 00000000 3ffee5f0 40204720
3ffef660: 3fffdad0 00000000 3ffee5f0 4020474c
3ffef670: feefeffe feefeffe 3ffee660 40100114
<<<stack<<<< r=""></stack<<<<>
-
! ````
unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature.
float lastTemperature[MAX_ATTACHED_DS18B20];
int numSensors=0;
bool receivedConfig = false;
bool metric = true;
// Initialize temperature message
MyMessage msg(0,V_TEMP);
! void setup()
{
// Startup up the OneWire library
sensors.begin();
// requestTemperatures() will not block current thread
sensors.setWaitForConversion(false);
}
! void presentation() {
// Send the sketch version information to the gateway and Controller
// sendSketchInfo("Temperature Sensor", "1.1");
// Fetch the number of attached temperature sensors
numSensors = sensors.getDeviceCount();
// Present all sensors to controller
present(0, S_TEMP);
}
! void loop()
{
// Fetch temperatures from Dallas sensors
sensors.requestTemperatures();
Serial.print("-------------------------------------------->Temperature for the device 1 (index 0) is: ");
Serial.println(sensors.getTempCByIndex(0));
}