New web ide lib manager will not compile Onewire library

Hi All,

I have been using the OneWire library and Spark-Dallas-Temp to compile with no problems. This am when I tried to include Blynk the IDE made me move to the new library manager.

Now the IDE cannot find the Onewire and won’t compile.

Here what the error message is:

In file included from /src/onewireds18b20.cpp:5:0:
lib/spark-dallas-temperature/src/spark-dallas-temperature.h:27:36: fatal error: ../OneWire/OneWire.h: No such file or directory
     #include "../OneWire/OneWire.h"
                                    ^

***compilation terminated.***strong text
***make[1]: *** [../build/target/user/platform-6src/onewireds18b20.o] Error 1***
***make: *** [user] Error 2***

My messy code follows:

// This #include statement was automatically added by the Particle IDE.
#include <OneWire.h>

// This #include statement was automatically added by the Particle IDE.
#include <spark-dallas-temperature.h>

// This #include statement was automatically added by the Particle IDE.
//#include <blynk.h>

// This #include statement was automatically added by the Particle IDE.
#include "lib1.h"

#define ONE_WIRE_BUS D2  //data on pin d2
#define BLUE_LED     D7
//#define TEMP_PWR     D5

//#pragma SPARK_NO_PREPROCESSOR

double tempc = 0.0;
double tempf = 10.0;
double maxf  = 0.0;
double minf  = 125.0;
double temp_minf_floor = -10.0;
double tempf_work = 0.0;
//double tempMinNotify = 63.0;
char  TempZone1[64];
int rssi =0;
double LowAlarmTemp= 45.00;
double LowAlarmSentClearTemp = 53.0 ;
int    LowAlarmSent = 0;
const char version[ ]    = "TempFreeze V1.4 Blynk 2-3-17";

double loop_counter = 0;
double sample_count = 10;

const char webhookTemp[]   = "TempAlarm"; // This is integrated with PushOver

OneWire oneWire(ONE_WIRE_BUS);  // Setup a oneWire instance to communicate with any OneWire devices 
DallasTemperature sensors(&oneWire);  // Pass our oneWire reference to Dallas Temperature.


void setup(void)

{

Serial.begin(9600);    


sensors.begin();    // IC defaults to 9 bit. If you have trouble consider changing to 12. 
//Particle.variable("tempc", &tempc, DOUBLE);   //expose vars to web interface  
//Particle.variable("MaxF",  &maxf, DOUBLE); 
//Particle.variable("MinF",  &minf, DOUBLE); 
Particle.variable("tempf", &tempf, DOUBLE); 
Particle.variable("rssi",  &rssi, INT);
//Particle.variable("LoopCnt", &loop_counter, DOUBLE);
Particle.variable("AlarmSent", &LowAlarmSent, INT);
Particle.variable("Version", version, STRING);
Particle.variable("LowAlarmTemp", &LowAlarmTemp, DOUBLE);

pinMode(BLUE_LED, OUTPUT);
//pinMode(TEMP_PWR, OUTPUT);

}                                           
void loop(void)
{
rssi=WiFi.RSSI();
//digitalWrite (TEMP_PWR, HIGH);     // GPIO 3.3 V Power to Temperature Sensor
  if ( loop_counter > sample_count )    {
    sensors.requestTemperatures();        // Send the command to get temperatures from all sensors on the one wire bus
    tempc = sensors.getTempCByIndex(0);     //  0 refers to the first IC on the wire 
    loop_counter  = 0;
    Serial.print(" C ");
    Serial.print(tempc);
    Serial.println(" ");
    tempf_work = (tempc * 9.0 / 5.0) + 32.0;
    if ( tempf_work >=  temp_minf_floor ){
      if ( tempf_work > maxf )
             maxf = tempf_work;
       if ( tempf_work < minf )
             minf = tempf_work;
       tempf = tempf_work; // make it offical
        //sprintf(TempZone1, "Low Temp Alarm!  Temp: %d F", int(tempf) );
       //Particle.publish(webhookTemp, TempZone1, 60, PRIVATE)  ;
       if (( tempf <= LowAlarmTemp) && LowAlarmSent == 0){
         sprintf(TempZone1, "Low Temp Alarm!  Temp: %d F", int(tempf) );
         Particle.publish(webhookTemp, TempZone1, 60, PRIVATE)  ;
         LowAlarmSent = 1;
         }
       if ( tempf >= LowAlarmSentClearTemp  &&  LowAlarmSent == 1){
            
            sprintf(TempZone1, "Temperature is normal  Temp:  %d F", int(tempf) );
            Particle.publish(webhookTemp, TempZone1, 60, PRIVATE)  ;
           LowAlarmSent = 0;
          }
      }
    else { Serial.print("Temp below Floor Value");}
  }
  else {
      Serial.print("Counter ");
      Serial.println(loop_counter);
  }

The problem is the double dot ../ in the spark-dallas-temperature lib.
The library needs updating that way or the build environment has to me tweaked to accept these.

Alternatively you can use the Particle OneWire library and the DS18 example that comes with it.

Okay,

Can I hack in this change? Where would I find this library file ?

Chipmonk

You should find a GitHub icon next to the library name in Web IDE.

Okay

I will poke into GitHub. How do I get the IDE to reference the change do I have to fork the lib?

Also I did try the Particle OneWire lib before but would not compile in the previous IDE

ChipMonk

ScurffR,

I spoke wrote wrong. I could get the Particle OneWire to compile but could not read any data from the DS18B20 sensors.

I just recompiled it. maybe it’s time to put a logic analyze on the wire and see what the photon is doing with this build. The same hardware works in the other spark-dallas-temperature library so this gets rid of the missing pullup and other stupid gotchas

Chipmonk

You’d need to for the and upload as private lib.
But since it’s only two files, I’d just remove the lib and instead add two file tabs to your project, call them the same as in the lib and copy paste the content, correct the mistake and you’ll be fine.