This particular one is running on an Arduino Duemilanove, but the sensor and gateway are both using the same library version (1.5.1) so that should be all good, no?
Posts made by velkrosmaak
-
RE: New MS node creates lots of random sensors, as well as actual sensors [Domoticz]
-
RE: New MS node creates lots of random sensors, as well as actual sensors [Domoticz]
Because it would require updating my Gateway which is in a somewhat inaccessible place right now. That's running 1.5.1 which is when I started playing with MySensors.
There's no way I can update it over the air, or somesuch, is there?
-
RE: New MS node creates lots of random sensors, as well as actual sensors [Domoticz]
These do look like spurious sensors created by my most recent node, for some reason. Rather than nodes from my neighbours being picked up, or similar.
Incidentally, the actual sensors on this node have stopped updating in Domoticz since the random sensors have appeared.
This is what my USB Serial MySensors gateway sees. Using library 1.5.1.
-
New MS node creates lots of random sensors, as well as actual sensors [Domoticz]
A load of components I ordered have arrived, and I'm busying myself building new MySensors nodes for my Domoticz setup.
I'm using DHT11, PIR, and LDR on one board, using the 3in1 sketch from here: https://forum.mysensors.org/topic/404/3-in-1-humidity-temp-and-motion with the MySensors Light Sensor example sketch from the library.
This is my version:
//this is as per the forum 3 in 1, but with ldr //node id set msnuslly to 10 #include <SPI.h> #include <MySensor.h> #include <DHT.h> #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 #define CHILD_ID_MOT 2 // Id of the sensor child #define HUMIDITY_SENSOR_DIGITAL_PIN 4 //ldr stuff #define CHILD_ID_LIGHT 3 #define LIGHT_SENSOR_ANALOG_PIN A1 // #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway) unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) MySensor gw; //ldr stuff MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL); int lastLightLevel; // DHT dht; float lastTemp; float lastHum; boolean metric = true; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); MyMessage msgMot(CHILD_ID_MOT, V_TRIPPED); void setup() { gw.begin(NULL,10,false); dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); // Send the Sketch Version Information to the Gateway gw.sendSketchInfo("Humidity/Motion", "1.0"); pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input // Register all sensors to gw (they will be created as child devices) gw.present(CHILD_ID_HUM, S_HUM); gw.present(CHILD_ID_TEMP, S_TEMP); gw.present(CHILD_ID_MOT, S_MOTION); //ldr stuff gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL); // metric = gw.getConfig().isMetric; } void loop() { // Read digital motion value boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; Serial.println(tripped); gw.send(msgMot.set(tripped?"1":"0")); // Send tripped value to gw delay(dht.getMinimumSamplingPeriod()); float temperature = dht.getTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT"); } else if (temperature != lastTemp) { lastTemp = temperature; if (!metric) { temperature = dht.toFahrenheit(temperature); } gw.send(msgTemp.set(temperature, 1)); Serial.print("T: "); Serial.println(temperature); } float humidity = dht.getHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum) { lastHum = humidity; gw.send(msgHum.set(humidity, 1)); Serial.print("H: "); Serial.println(humidity); } //ldr stuff int lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; Serial.print("Light Level: "); Serial.println(lightLevel); if (lightLevel != lastLightLevel) { gw.send(msg.set(lightLevel)); lastLightLevel = lightLevel; } // end light measurement // // Sleep until interrupt comes in on motion sensor. Send update every two minute. gw.sleep(INTERRUPT,CHANGE, SLEEP_TIME); }
The sensors appear in Domoticz, and work fine. The next day, a load of additional, random sensors appear:
Has anybody experienced this before? Does my code look OK? Thanks so much for any help!
-
RE: 💬 Easy/Newbie PCB for MySensors
@sundberg84 I hit this post again today with the intention of finally biting the bullet and buying some boards - but then I saw your notes about the next revision of the board. Could you tell me when you're expecting to release that? Is it worth me waiting a while?
Thanks!
-
RE: [SOLVED] New MySensors appearing with random values
For my own sake of closure, I wanted to share that it does appear to have been my bodged together PIR/BMP180 sketch that was causing the issue - but only when in combination of an additional sensor node. Missing closing bracket somewhere or something.
Thanks for the help!
-
RE: [SOLVED] New MySensors appearing with random values
You mean the output on the serial monitor? I'm not at home at the moment so can't provide you with the output, but I don't recall seeing any values outside of the expected range (for temperature, light, and movement). I can provide this when I'm back.
Starting to think that it might actually be my first node that's causing this. One of the 'random' values does match the pressure value of the first sensor on occasion - I wonder if there's actually a transmission issue. I did hack that sketch together myself, so it could well be that. Couldn't find an example sketch for PIR and BMP180.
-
RE: [SOLVED] New MySensors appearing with random values
Hi hek - thanks for the reply!
I'm using the serial gateway, with an arduino nano as per this example: https://www.mysensors.org/build/serial_gateway
The sketch is straight from the MySensors library - version 1.5 from the site.
-
[SOLVED] New MySensors appearing with random values
I'm using the standard Serial Gateway setup, going into Domotiga running as a VM. I have one sensor running this sketch I mashed together from two of the examples (PIR and the BMP180 sketch). This works fine, the PIR, temperature, and pressure appear as 3 sensors. I've built another MySensor, running the sketch in this thread: http://forum.mysensors.org/topic/1006/my-motion-dallas-light-sensor
After a seemingly random interval, additional MySensor devices begin appearing in Domotiga. Here's an extract of the log - this is when a new sensor appeared in Domotiga.
2016/02/01 23:49:29 [MySensors] < 0;0;3;0;9;read: 254-254-0 s=0,c=1,t=4,pt=7,l=5,sg=0:1089 2016/02/01 23:49:29 [MySensors] Node:0; sensor-id:0; message-type:3; ack:0; sub-type:9; payload:read: 254-254-0 s=0,c=1,t=4,pt=7,l=5,sg=0:1089 2016/02/01 23:49:29 [MySensors] Gateway log message: read: 254-254-0 s=0,c=1,t=4,pt=7,l=5,sg=0:1089 2016/02/01 23:49:29 [MySensors] < 254;0;1;0;4;1089 2016/02/01 23:49:29 [MySensors] Node:254; sensor-id:0; message-type:1; ack:0; sub-type:4; payload:1089 2016/02/01 23:49:29 [MySensors] Set value '1089' for node 254 2016/02/01 23:49:29 [Devices] Device with address '254' is 'Bedroom pressure' 2016/02/01 23:49:29 [Devices] ValueUpdate called for device with id '116' valuenum '1' and value '1089' 2016/02/01 23:49:29 [MySensors] < 0;0;3;0;9;read: 254-254-0 s=2,c=1,t=16,pt=0,l=1,sg=0:0 2016/02/01 23:49:29 [MySensors] Node:0; sensor-id:0; message-type:3; ack:0; sub-type:9; payload:read: 254-254-0 s=2,c=1,t=16,pt=0,l=1,sg=0:0 2016/02/01 23:49:29 [MySensors] Gateway log message: read: 254-254-0 s=2,c=1,t=16,pt=0,l=1,sg=0:0 2016/02/01 23:49:29 [MySensors] < 254;2;1;0;16;0 2016/02/01 23:49:29 [MySensors] Node:254; sensor-id:2; message-type:1; ack:0; sub-type:16; payload:0 2016/02/01 23:49:29 [MySensors] Set value '0' for node 254.2 2016/02/01 23:49:29 [Devices] Device with address '254.2' is 'Bedroom PIR' 2016/02/01 23:49:29 [Devices] ValueUpdate called for device with id '115' valuenum '1' and value '0' 2016/02/01 23:49:29 [MySensors] < 0;0;3;0;9;read: 142-254-0 s=2,c=1,t=16,pt=0,l=1,sg=0:0 2016/02/01 23:49:29 [MySensors] Node:0; sensor-id:0; message-type:3; ack:0; sub-type:9; payload:read: 142-254-0 s=2,c=1,t=16,pt=0,l=1,sg=0:0 2016/02/01 23:49:29 [MySensors] Gateway log message: read: 142-254-0 s=2,c=1,t=16,pt=0,l=1,sg=0:0 2016/02/01 23:49:29 [MySensors] < 142;2;1;0;16;0 2016/02/01 23:49:29 [MySensors] Node:142; sensor-id:2; message-type:1; ack:0; sub-type:16; payload:0 2016/02/01 23:49:29 [MySensors] Set value '0' for node 142.2 2016/02/01 23:49:29 [Devices] Device with type 'MySensors', address '142.2', instance 1' and interface 'MySensors Interface' not found! 2016/02/01 23:49:29 [Devices] Auto created device 'MySensors device #1' with address '142.2' of type 'MySensors Node' with interface 'MySensors Interface' and instance '1' 2016/02/01 23:49:29 [Devices] ValueUpdate called for device with id '341' valuenum '1' and value '0' 2016/02/01 23:49:29 [Devices] Device change triggered for device 'MySensors device #1' with 'value1' = '0'``````
I don't understand why it's creating these additional devices. I've checked the serial output of both of the arduinos, and I can't see anything relating to this in the output.
Any help would really be appreciated! Thanks!
-
RE: My motion / dallas / light sensor
Actually - it gets weirder.
Does the DS18b20 contain a barometer? Not according to the datasheet. But this node, using the sketch above, seems to create additional sensors, some with garbage data, and some with what appear to be barometric pressure readings. I have some other (BMP180) mysensors which report the same value for pressure as the sketch above.
I can't understand what's causing the garbage data though. For example, MySensorsDevice#33 has a reading of 1149829168. Some are null, and there are a few other random integers there too. Each with their own MySensorsDevice#.
Can anyone point me in the right direction as to what's going on? It's getting annoying having to remove all these fake sensors daily!
-
RE: My motion / dallas / light sensor
I just gave this a try and it works great! I can't believe nobody else has commented yet.
The only issue I have is that there doesn't appear to be a Celsius reading, despite the fact that metric is set to true at the top of the code.
This is what I see over the console:
Temperature 0 65.30 Lightlevel: 290 Temperature 0 65.30 Lightlevel: 324 send: 0-0-0-0 s=10,c=1,t=23,pt=2,l=2,sg=0,st=fail:69 Temperature 0 65.30
I'm guessing the 0 before the 65.30 is where the Celsius reading is supposed to be, but I can't see in the code where the temperature is being calculated.
Excuse a noob! Thanks for any help!
-
RE: Multiple sensor nodes - only one appears to be recognised
Thanks for the quick reply!
My sensor code is straight from the Examples>Mysensors>Serialgateway sketch, from the mysensors library.
I don't remember setting an ID in the original, working node (Arduino Uno), but I guess because that was the first one, it's ID was unique.
Where can I source the logs you need? Or you mean the ones straight from domotiga?
Thanks again
-
Multiple sensor nodes - only one appears to be recognised
I have one Arduino Nano with a high gain NRF24L01 as a serial gateway, going into Domotiga. This works great.
I have an Arduino Uno (for development at the moment) with a PIR and BMP180, with a normal NRF24L01, which is picked up by the gateway and the sensors appear in Domotiga.
I'm now working on a third node, using the standard MotionSensor sketch and another NRF24L01, on an Arduino Nano and the sensor does not show up in the logs of the serial gateway, nor in Domotiga.
Do I need to somehow supply some kind of UID for each node? The CHILD_ID looks like it might be relevant, but I've had no success when changing that value.
Thanks for any help!