Dallas Temperature Sensor - compiling error



  • Hi All
    I am trying out the sketch for the Dallas Temperature sensor as per the MySensors tutorial.
    When I verify the sketch I get the error:

    In file included from C:\Users\WALLIS~1.MET\AppData\Local\Temp\arduino_770bd48bc56f53e10c3afe135558f414\DallasTemperatureSensor.ino:29:0:
    
    \\metro-file\User-Folders\walliss0019\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h: In function 'void loop()':
    
    DallasTemperature.h:249: error: 'int16_t DallasTemperature::millisToWaitForConversion(uint8_t)' is private
    
         int16_t millisToWaitForConversion(uint8_t);
    
                 ^
    
    DallasTemperatureSensor:79: error: within this context
    
       int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
    
    

    I see from another user he had the same problem from the "Comments"section (see user KRAX at http://www.mysensors.org/build/temp)

    MySensors came back saying that the error was due to a missing library "Sorry, had a missing DallasTemperature library. This has been fixed now. Please clone sketch again (with libraries)."

    My question is how do I do this?

    I have the Arduino 1.6.6 IDE. I have downloaded the latest sketch from the link provided etc but the same error persists.
    Can anyone help me resolve this?
    Cheers


  • Admin

    @ciscokid said:

    My question is how do I do this?

    That applied to the online codebender builder.

    When compiling locally on your computer you have to install the dallas library. It's included in the zip you downloaded.



  • Thanks hek - downloaded the zip and did the install via zip libraries, however the problem persists. Can you let me know if there is a newer library i could download and point me in the right direction?
    Many thanks !



  • not sure what the forum etiquette is but +1 or "me too" - same error on 1.6.6 ide - I have moved all the libraries etc from the latest mysensors download to the libraries area - other samples build ok - like binaryswitch.



  • @malarcy LIkely bad form replying to my own message - but I found I can work around it by removing the "offending" couple of lines - the temp sensor works - but I suspect that if I chain more together then I might get timing errors and problems.

    I removed these lines

    // query conversion time and sleep until conversion completed
      int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
      // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
      gw.sleep(conversionTime);```
    

    This got me working for testing and playing - but would like some help on the proper solution.



  • Just bumping this thread - would really like to have a definitive answer. There must be some clever guys out there that can shed some light 🙂 ?


  • Hardware Contributor

    @ciscokid Just to let you know, I'm currently using the 1.5 and the development directory/branch and mine compiles perfectly fine. Try downloading the libraries again and clean install them.



  • I've been using the Dallas libraries on Arduino 1.6.5 with no issues. Try redownloading Arduino and mysensors api and install into a different directory.



  • +1 for me too, same compiling error.
    Went from IDE 1.6.6 to 1.6.5 as suggested, but have the same error.
    Can someone help?
    Thanks


  • Admin

    You're probably using and old/different Dallas library. Sure you use the one provided in the MySensors bundle?



  • That did the trick, Thanx!!
    Copied Dallas directory from "mysensors master" to Arduino library location.
    Works with 1.6.6


  • Hardware Contributor

    One of the first steps in the troubleshooting process, that i have learnt recently, is exactly this. Making sure the libs are up to date, or even better, not conflicting/co-operating. Hek is the master at pointing out this to us all here 😉



  • This post is deleted!

  • Mod

    @oded00 Follow the instructions at http://www.mysensors.org/about/arduino#installing-the-sensor-libraries
    Make sure you delete everything in the libraries folder before extracting the content of the MySensors library zip archive to delete any old versions.



  • Sorry guys - is this error fixed? Have the same problem after installing fresh dev branch 2.0

    The message on compiling is: is private ... within this context

    I have declard the section in DallasTemperature.h line 249 in public: and now it works?!?

    Pleasy try it - for me it works 👍


  • Hardware Contributor

    @markush - A few comments above is this one:

    That did the trick, Thanx!!
    Copied Dallas directory from "mysensors master" to Arduino library location.
    Works with 1.6.6

    That is in reply to Hek's response of:

    You're probably using and old/different Dallas library. Sure you use the one provided in the MySensors bundle?

    So firstly, I would double check that you have the correct Dallas Lib, the one that is in the MySensors bundle. Also, as mfalkvidd says above your comment, make sure you have extracted the Libs from MySensors correctly.



  • Yes i have read the comments. Make two fresh installs - with the same error on both.

    Using Arduino 1.6.7 and the dev branch 2.0

    I'm using a network, means my Arduino Sketchbook directory is on a server. Perhaps this is the problem....?



  • I had the same error and it turned out that for some reason it was finding the library in a folder in My Documents and also in the Arduino install folder. I renamed the copy in My Documents (I don't remember putting it there so maybe it was older version?) and all was well.


Log in to reply
 

Suggested Topics

58
Online

11.4k
Users

11.1k
Topics

112.6k
Posts