Reliability?


  • Hero Member

    I have 2 temperature sensors, both build from store choices mini Pro and DS18B20, that will 'lock up' after 12-18hrs of operation.

    The only way I've been able to get them working is to clear the eeprom and reload the sketch. Power cycling and hitting the reset button does not work.

    Where do I start?

    This is after power cycling and resetting several time..

    2014-09-02_7-25-01.png

    This is a after a eeprom clear and sketch reload.

    2014-09-02_7-28-43.png


  • Hero Member

    I should add that I have another sensor built from the same batch of mini pro's, but uses the DHT22 for temp and humidity.

    So the problem may be related to the DS18B20's, but really don't know how to determine why they are locking up.


  • Hero Member

    Whats the controller you are using?

    Have you tried powercycling that to see if the sensor starts up again?


  • Hero Member

    @ServiceXp said:

    I should add that I have another sensor built from the same batch of mini pro's, but uses the DHT22 for temp and humidity.

    So the problem may be related to the DS18B20's, but really don't know how to determine why they are locking up.

    And does this sensor NOT lockup??

    Is so hows it all wired up? do you have the resistor installed for the ds18b20's? - what happens if you disconnect the temp sensor?


  • Hero Member

    @gregl
    Vera with the serial gateway, and no I did not restart either of them. I think because after I saw the serial monitor error's I assumed it was related to the sensor.


  • Hero Member

    Try pulling power from Vera and see if the sensors come back to life....
    I think those fails will occur if the g/w doesnt respond also.

    i didnt have the best reliability with my Veralite and USB ( was using a hub + usb memory stick for datamine ) - much happier now with ethernet g/w.


  • Admin

    It could be the radio entering some weird state due to power issues (spikes etc). Have to tried some other power source on the sensor and adding a capacitor?


  • Hero Member

    @gregl said:> @ServiceXp said:

    I should add that I have another sensor built from the same batch of mini pro's, but uses the DHT22 for temp and humidity.

    So the problem may be related to the DS18B20's, but really don't know how to determine why they are locking up.

    And does this sensor NOT lockup??

    Is so hows it all wired up? do you have the resistor installed for the ds18b20's? - what happens if you disconnect the temp sensor?

    Ooops. That is correct the sensor using the DHT22 has not locked up after running for 48+ hours, and I can't remember it locking up in the past either.

    The 2 DS18B20's have a 4K7 resister installed. The sensor on one is soldered to the prototype pcb, and the other uses a screw type connector

    I have not tested to see what happens with the sensor disconnected.


  • Hero Member

    @gregl said:> Try pulling power from Vera and see if the sensors come back to life....

    I think those fails will occur if the g/w doesnt respond also.

    i didnt have the best reliability with my Veralite and USB ( was using a hub + usb memory stick for datamine ) - much happier now with ethernet g/w.

    Will try, and report back


  • Hero Member

    @hek said:> It could be the radio entering some weird state due to power issues (spikes etc). Have to tried some other power source on the sensor and adding a capacitor?

    Wouldn't a power cycle or reset (button on the mini pro) correct that? It's almost like the eeprom is getting scrambled.


  • Hero Member

    last night I upped the cap on the radio to 47uf on one of the sensors, and left the other one alone. This morning the one with the cap was still running, but the other was locked up.

    I power cycled the serial gateway, and it **appears **that the sensor came back up. So I decided to install the 47uf on the locked up sensor.

    Until next time.


  • Code Contributor

    @ServiceXp One major stability change I did was using shorter wire bewteen radio and arduino.


  • Hero Member

    @Damme
    Thanks.

    Unfortunately, I can't get any closer in my environment without going to a custom designed pcb. All my wires are soldered and are only 2" max in length. 🙂


  • Hero Member

    Well locked up again. I have confirmed that rebooting the gateway and or the Vera has NO effect. The only fix is to clear the eeprom and start over with the sensor.

    At this point I dont think its the gateway but I am not sure where to go at this point?


  • Hero Member

    This is very weird...but the wierdest bit to me is that you need to clear the eeprom to get it going again!

    Are you using the example sketches un-modified for these sensors?

    Few ideas:

    1. What about adding some code to void setup to print out all values in the eeprom - to test your idea in them being corrupt?

    2. What about swapping the mini pro's from your working DHT22 sensor and using it for the temp sensor...see if the problem follows....

    3. Change the resistor/add capacitor to the temp sensor in case the output is not ideal from the pro-mini http://www.picaxeforum.co.uk/archive/index.php/t-11268.html
      ( i have some ds18b20's on long cables using parasite power and i needed to drop the resistor value for stability)

    4. Change the powersupply AND cable !. Are you using a USB port on your computer??
      Hows it all connected up? ( post a photo )


  • Hero Member

    @gregl said:> This is very weird...but the wierdest bit to me is that you need to clear the eeprom to get it going again!

    Are you using the example sketches un-modified for these sensors?

    Few ideas:

    1. What about adding some code to void setup to print out all values in the eeprom - to test your idea in them being corrupt?

    2. What about swapping the mini pro's from your working DHT22 sensor and using it for the temp sensor...see if the problem follows....

    3. Change the resistor/add capacitor to the temp sensor in case the output is not ideal from the pro-mini http://www.picaxeforum.co.uk/archive/index.php/t-11268.html
      ( i have some ds18b20's on long cables using parasite power and i needed to drop the resistor value for stability)

    4. Change the powersupply AND cable !. Are you using a USB port on your computer??
      Hows it all connected up? ( post a photo )

    Yes, using the default sketch, with only a hard coded C to F conversion change.

    1. Not sure how to do that??
    2. I should be able to do that.
    3. How do I determine the appropriate size resistor and or cap? The wire length on one sensor is the standard DS18B20 length, The other sensor has been lengthened slightly to pass under a freezer door gasket. (Pic Below)
    4. These are battery powered sensors, and until the MySensors step up regulator is release I think it's my only option.

    The flat section is a SATA cable, very well spiced in.

    20140904_072228_Android.jpg

    20140904_072241_Android.jpg

    The only difference in this sensor build compared to the other is I started using screw in connector blocks for the sensor connection. (and of course the SATA cable splice.)
    20140904_072324_Android.jpg


  • Hero Member

    Thinking out loud.... In both area's I have z-wave extenders in close proximity of the sensors. Hmmmmm


  • Code Contributor

    @ServiceXp Now when you sayit... I had a wireless mouse that lowerd my reception. A cheap brand, I did't like it and everytime a sensor transmitted the mouse got laggy.


  • Hero Member

    @gregl said:> This is very weird...but the wierdest bit to me is that you need to clear the eeprom to get it going again!

    Are you using the example sketches un-modified for these sensors?

    Few ideas:

    1. What about adding some code to void setup to print out all values in the eeprom - to test your idea in them being corrupt?

    2. What about swapping the mini pro's from your working DHT22 sensor and using it for the temp sensor...see if the problem follows....

    3. Change the resistor/add capacitor to the temp sensor in case the output is not ideal from the pro-mini http://www.picaxeforum.co.uk/archive/index.php/t-11268.html
      ( i have some ds18b20's on long cables using parasite power and i needed to drop the resistor value for stability)

    4. Change the powersupply AND cable !. Are you using a USB port on your computer??
      Hows it all connected up? ( post a photo )

    Still dealing with this...

    1. Built up a completely new freezer sensor, connected it, and it locked up 8hrs later. My EH40 project with the DS18B20 is also locking up. This is driving me crazy..

    2. I added a cap (.22uF) to my EH40, but it still locked up.

    I've removed all near by z-wave devices, so I now know that is not causing it..


  • Hero Member

    Let me ask you guys this.. Is it 'OK' to power the mini pro via the VCC terminal on the side? This is how I've been powering all my sensors...
    Should I be using the RAW pin?

    I've been powering the DS18B20 directly from the stepped up 3.3v output of the module (not the mini pro)


  • Hero Member

    @ServiceXp
    If you are feeding 3.3v to the VCC pin it should be ok but if you are in fact feeding 3.3v to the RAW pin it might not be enough (Input Voltage 3.35 -12 V (3.3V model))

    http://arduino.cc/en/Main/ArduinoBoardProMini


  • Hero Member

    Locked up again this morning @ 7:37am with a temp of -0.1. So a .47uF cap isn't the answer.... I think my last option before giving up on this is to remove the stepup regulator.

    Any other idea's?


  • Hero Member

    @ServiceXp
    Could you try running a sketch which just uses the dallas temp lib eg: there is is an example called "Single" with the DallasTemperature lib. RUn it for 24hrs and see if it survives.

    Likewise... in your existing sketch...stop reading the temps ( but leave everything connected) and just send a value every say 30sec to Vera .... and leave for 24hrs or so...see if that survives.

    Also have you tried a different PIN for the onewire sensor?


  • Hero Member

    @gregl said:> @ServiceXp

    Could you try running a sketch which just uses the dallas temp lib eg: there is is an example called "Single" with the DallasTemperature lib. RUn it for 24hrs and see if it survives.

    Likewise... in your existing sketch...stop reading the temps ( but leave everything connected) and just send a value every say 30sec to Vera .... and leave for 24hrs or so...see if that survives.

    Also have you tried a different PIN for the onewire sensor?

    1. and 2) ---- will do and report back.

    Do you think the wire it self could be a/the problem. Since much of the sensor line is also subject to low temps, maybe it's breaking down some how... (Although I'm using 3 different DS18B20 sensors) just talking out loud..... 😉 ....

    1. I have not, but I can add that to the 'things to try' list..

    Thanks for you help @gregl



  • @ServiceXp

    My PCBs are winging their way to you (sorry, got forgot to send them for a week or two). They may solve your problem. Let me know when you get them.


  • Hero Member

    @Bandra Thank you Sir. I'll report back.


  • Hero Member

    @gregl
    Only sending this, every 30 sec

    gw.send(msgTEMP.setSensor(i).set(777, 1));
    

    and this is what I'm getting in return.. Not sure what the fails are about?

    2014-09-11_7-23-39.png


  • Hero Member

    The section of code

    	void sendTemperatureToController(){
    		//Start time for Temperature readings
    		TemperatureTimeing = millis ();
    		
    		// Fetch temperatures from Dallas sensors
    		//sensors.requestTemperatures();
    		
    		// Read temperatures and send them to controller
    		for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
    			// Fetch and round temperature to one decimal
    			//float temperature = static_cast<float>(static_cast<int>((sensors.getTempFByIndex(i)) * 10.)) / 10.;
    			//float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
    			// Only send data if temperature has changed and no error
    			
    			//if (lastTemperature[i] != temperature && temperature != -127.00) {
    				//// Send in the new temperature
    				//gw.send(msgTEMP.setSensor(i).set(temperature,1));
    				//lastTemperature[i]=temperature;
    			//}
    			gw.send(msgTEMP.setSensor(i).set(777, 1));
    		}
    
    	}

  • Hero Member

    Ok,
    The sensor has has been running for ~24 hrs and has not locked up. So the problem is either in the code (which I doubt because I think others would be seeing this problem) or the actual DS18B20's. Maybe a bad run of them?

    I think I'm going to let it run a while longer like this, just to make sure.


  • Hero Member

    Oh and the strangest thing.. those fails stopped.. So I still don't know what those where about..

    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0
    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=ok:777.0


  • Mod

    @ServiceXp Your previous logging showed the failing messages being routed from node 2 via 1 to 0 (gateway).
    This log shows messages from node 1 directly to 0 (gateway).
    This is a different situation, so message routing seems to fail.
    Any idea what could cause this?

    Furthermore, which DS18B20 library do you use?


  • Hero Member

    @Yveaux

    1. I'm thinking maybe that's because this node is a relaying node?? Other than that I have no ideal.

    2. Whatever comes with MySensors.

    I did try using another Dallas library (the latest version) but there was a gazillion compile errors so I quickly replace it with existing... 🙂
    I just don't know enough yet, to work out all those compile errors.


  • Mod

    @ServiceXp said:

    1. I'm thinking maybe that's because this node is a relaying node?? Other than that I have no ideal.

    What do you pass for the 'repeaterMode' flag when calling 'begin' on the sensor object?
    This determines whether the node behaves as a sensor or a repeater.
    What does your setup look like exactly?

    How do you power the DS18B20?

    Btw. I'll review the DS18B20 code shipped with MySensors. Maybe I can find what causes the hangup.


  • Mod

    @ServiceXp Seems that you're not alone when Arduino hangs up with DS18B20 connected, see http://tushev.org/articles/arduino/item/46-arduino-and-watchdog-timer.
    This guy suffered from condensation causing a 'shortcut' between the sensor wires...

    IMO a library should never hang on communication errors, but return an error value after a timeout or so...


  • Hero Member

    @Yveaux said:> @ServiceXp said:

    1. I'm thinking maybe that's because this node is a relaying node?? Other than that I have no ideal.

    What do you pass for the 'repeaterMode' flag when calling 'begin' on the sensor object?
    This determines whether the node behaves as a sensor or a repeater.
    What does your setup look like exactly?

    How do you power the DS18B20?

    Btw. I'll review the DS18B20 code shipped with MySensors. Maybe I can find what causes the hangup.

    1. Here is the link to one project that uses the DS18B20 sensor, The 2nd sketch is pretty much how it's running now (Locks up when there is a call to read the DS18B20, but doesn't when the code is commented out).

    2. In all cases, the sensors VCC and GND are connected in common to the power source. Here is the pcb prototype of the EH40 project.

    upload-bf75281f-3d01-41a8-bdfb-1d08973fd1da.jpg

    Thanks for the help!


  • Hero Member

    @Yveaux said:> @ServiceXp Seems that you're not alone when Arduino hangs up with DS18B20 connected, see http://tushev.org/articles/arduino/item/46-arduino-and-watchdog-timer.

    This guy suffered from condensation causing a 'shortcut' between the sensor wires...

    IMO a library should never hang on communication errors, but return an error value after a timeout or so...

    I think if this problem winds up being directly related to the DS18B20, its going to have to be a manufacturing issue, because I have 3, (brand new) of these things and they all lock up the Arduino's (3 different mini pros, with 3 different DS18B20's of the same batch)

    I'm not even sure the watchdog timer would help in my case, because in most cases, once the sensor is locked up, the only fix is to clear eeprom and re-install sketch.


  • Hero Member

    Oh and power is introduced on the upper left side of the board in the pictures.


  • Plugin Developer

    Maybe already checked, but i'm remembering that a while ago i created a library for light intensity and other LED based stuff, after a while my device also locked up, after searching for merely a week i found a little memory leak in one of my libraries which was just related to a incorrect fixed size char array. It also used the eeprom for storing particular LED settings.

    It happened every time after storing a particular setting after a coupe of hours, if stored after 5 minutes there was no problem but the device then just locked up after a couple of hours.

    I also had to reset eeprom values before i could continue....

    I also remember with a tmp36 receiving 500 degrees celcius values, which was related to a bug code which had nothing to do with it.

    If there would be a leak somewhere in the code it can completely #%$#% up. It's the only thing i can come up with now.


  • Mod

    @ServiceXp said:

    I think if this problem winds up being directly related to the DS18B20, its going to have to be a manufacturing issue,

    Could be the case of course, but I would also setup an endurance test with a completely different ds1820 library and see how this behaves over time. In the onewire library there is an example sketch for ds1820 that only uses the onewire library.
    Maybe you could try this one.
    Just to rule things out, and please run it without mysensors.

    Good luck!


  • Hero Member

    Was excited last night, a new batch of DS18B20 arrived, so I connected it, uploaded the original sketch and........ This morning @ 4:48 with a temp of 74.6F it locked up.

    Well, I guess it's not the DS18B20 hardware... This is just ridiculous, I've got to be doing something wrong here....


  • Hero Member

    As suggested by @gregl, I loaded the 'single' sketch found in the MySensors download on one of the other sensors that was locking up and put it in the freezer for ~2 days. Removed it this morning, and connected it to the serial monitor. (there was a power cycle when moving from the batteries to the serial connector) and it was humming along just fine.


  • Hero Member

    @ServiceXp said:

    As suggested by @gregl, I loaded the 'single' sketch found in the MySensors download on one of the other sensors that was locking up and put it in the freezer for ~2 days. Removed it this morning, and connected it to the serial monitor. (there was a power cycle when moving from the batteries to the serial connector) and it was humming along just fine.

    • Wouldnt that power cycle have also reset any evidence of if the sketch was hanging? try connecting just a wire from gnd to gnd and the TX from the mini pro to the RX on your programmer.
    • Can you post ( codebender) your sketch as you have it? I can run it up and see if i can replicate.

  • Hero Member

    @gregl

    1. 'most' of the time, when this 'event' takes place the Arduino's eeprom has to be cleared and new sketch uploaded. I would say 7 out of 10 times this is necessary. One time disconnecting the DS18B20 allowed the Arduino to restart, and a few times connecting the Arduino to the programmer allowed it to restart.

    I updated the DallasTemperature and OneWire libraries to the most recent version I could find yesterday, and so far (it's been about 13 hrs so more time is needed) this Arduino is still functioning. I also changed power source (so I could monitor the communications) using the programmer. It has locked up in the past using the programmer, which led me to think it's NOT a power issue, but really at this point I'm running out of hair to pull out.

    CodeBender doesn't seem to be working ATM.. When it comes back I'll post the sketch..


  • Hero Member


  • Mod

    @ServiceXp short question; how does the sketch behave when started without a ds1820 connected? Does it hang?


  • Plugin Developer

    Wouldn't it be the problem when putting the sensor in the freezer which could affect the chip timings/wire resistance (rise/fall timings) over time where it is possible that the one wire library hangs because it maybe reads malformed data because of this?

    I haven't read all the posts but does it also lock up outside the freezer?

    I'm no expert but it just came into mind


  • Hero Member

    @Yveaux
    It still locks up. When the code that gets the temp is commented out, then it does not lock up.

    By the way, the EH40 project sensor is still running. I'm getting optimistic about the new library's. If I get another 12 hours, I will be VERY happy.


  • Hero Member

    @John
    These lock ups are taking place on every project I have code for the DS18B20 running.


  • Admin

    How id division by zero handled on ATMega?
    Long shot but if "scratchPad" gets garbled in DallasTemperature library this could happen.
    https://github.com/mysensors/Arduino/blob/master/libraries/DallasTemperature/DallasTemperature.cpp#L339


  • Hero Member

    Well, all the sensors as still running YEAH YEAH YEAH...

    I think this problem is finally behind me. We have not locked up since moving to the latest versions of the DallasTemperature and OneWire libraries.

    Not sure what the differences are between the MySensor download versions and the latest, but it appears that was indeed the cause.

    Is there any way the MySensor project download can be updated to include the latest version of these libraries?

    Thanks to all who gave suggestions and time in helping me sort this out. I was very close to throwing in the towel..


  • Banned

    This post is deleted!

 

393
Online

7.5k
Users

8.4k
Topics

90.3k
Posts