PLATFORM_ID not supported by this library

I am getting the following error compiling after the holidays. It was working fine before. Must have been an update by Particle. Do we have to add the Platoform_ID to IDE Application now? Please let me know how to solve this issue. Thanks.

DS18B20/Particle-OneWire.h:125:6: error: #error “*** PLATFORM_ID not supported by this library. PLATFORM should be Core, Photon, or Electron "
#error "
PLATFORM_ID not supported by this library. PLATFORM should be Core, Photon, or Electron ***”

Without seeing some code, and preferably the full error output, it’s very hard to debug. If you could get us those, I’m sure we can figure something out.

1 Like

@Moors7, I am just running Use This Example from DS18B20 library.
After that I do Verify on WebIDE. You will see that compile error on Particle-Onewire.

@Moors7, please see the code below:

#include "DS18B20/Particle-OneWire.h"
#include "DS18B20/DS18B20.h"

DS18B20 ds18b20 = DS18B20(D2); //Sets Pin D2 for Water Temp Sensor
int led = D7;
char szInfo[64];
float pubTemp;
double celsius;
double fahrenheit;
unsigned int Metric_Publish_Rate = 30000;
unsigned int MetricnextPublishTime;
int DS18B20nextSampleTime;
int DS18B20_SAMPLE_INTERVAL = 2500;
int dsAttempts = 0;

void setup() {
    Time.zone(-5);
    Particle.syncTime();
    pinMode(D2, INPUT);
    Particle.variable("tempHotWater", &fahrenheit, DOUBLE);
    Serial.begin(115200);
}

void loop() {

if (millis() > DS18B20nextSampleTime){
  getTemp();
  }

  if (millis() > MetricnextPublishTime){
    Serial.println("Publishing now.");
    publishData();
  }
}


void publishData(){
  if(!ds18b20.crcCheck()){
    return;
  }
  sprintf(szInfo, "%2.2f", fahrenheit);
  Particle.publish("dsTmp", szInfo, PRIVATE);
  MetricnextPublishTime = millis() + Metric_Publish_Rate;
}

void getTemp(){
    if(!ds18b20.search()){
      ds18b20.resetsearch();
      celsius = ds18b20.getTemperature();
      Serial.println(celsius);
      while (!ds18b20.crcCheck() && dsAttempts < 4){
        Serial.println("Caught bad value.");
        dsAttempts++;
        Serial.print("Attempts to Read: ");
        Serial.println(dsAttempts);
        if (dsAttempts == 3){
          delay(1000);
        }
        ds18b20.resetsearch();
        celsius = ds18b20.getTemperature();
        continue;
      }
      dsAttempts = 0;
      fahrenheit = ds18b20.convertToFahrenheit(celsius);
      DS18B20nextSampleTime = millis() + DS18B20_SAMPLE_INTERVAL;
      Serial.println(fahrenheit);
    }
}

Not quite sure what’s going on. Work for me when compiling for a Photon with 0.5.3 as well as 0.6.0

What device do you have selected? Open the Devices icon (circle with the 4 lines, the target icon) and see which one has the gold star next to it. The library only supports Core, Photon, P1, Electron, and RedBear Duo. If you have something else selected, say Bluz or Raspberry Pi, it will fail with that error.

@rickkas7, great catch. Thank you so much. I was working on Bluz device over the weekend.

1 Like

Hence the very “obscure” message

#error "*** PLATFORM_ID not supported by this library. PLATFORM should be Core, Photon, or Electron ***"

When reading this I’d have had a look at my selected target :wink:

1 Like