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() {;
    pinMode(D2, INPUT);
    Particle.variable("tempHotWater", &fahrenheit, DOUBLE);

void loop() {

if (millis() > DS18B20nextSampleTime){

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

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

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

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