<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Error compiling sketch on PlatformIO while compiling ok on Arduino IDE]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1711</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1711&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Error compiling sketch on PlatformIO while compiling ok on Arduino IDE.]]></description>
		<lastBuildDate>Wed, 01 Nov 2023 13:27:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Error compiling sketch on PlatformIO while compiling ok on Arduino IDE]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=5240#p5240</link>
			<description><![CDATA[<p>Hi,</p><p>I&#039;m learning PlatformIO which help with bigger sketches.<br />I have a small sketch working on Arduino IDE, but I got this error compiling the same sketch on PlatformIO. Error is related with RemoteXY library. Ant idea how to fix that ?</p><p>Errors message :<br /></p><div class="codebox"><pre><code>In file included from .pio\libdeps\d1_mini\RemoteXY\src/RemoteXY.h:156,
                 from src\main.cpp:38:
.pio\libdeps\d1_mini\RemoteXY\src/RemoteXYComm_WiFi.h: In member function &#039;virtual uint8_t CRemoteXYServer_WiFi::available(CRemoteXYClient*)&#039;:
.pio\libdeps\d1_mini\RemoteXY\src/RemoteXYComm_WiFi.h:95:29: error: &#039;class WiFiServer&#039; has no member named &#039;available&#039;
   95 |     WiFiClient cl = server-&gt;available ();</code></pre></div><p>The sketch is :<br /></p><div class="codebox"><pre><code>#include &lt;Arduino.h&gt;

// DS18B20 sensor definitions and helpers
#include &lt;OneWire.h&gt;
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS D3
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
#include &lt;DallasTemperature.h&gt;
DallasTemperature sensors(&amp;oneWire);
// Define temp variable
double insideTemp = DEVICE_DISCONNECTED_C;

const unsigned long DS18B20_READING_DELAY = 1000;
const unsigned long DS18B20prevReading = 0;

// Heating relay output definitions and helpers
#include &lt;PID_v1.h&gt;
#define HEATINGPIN D5
#define BUILTIN_LED D4
// bool heatingPermission = false;
double heatingSetpoint = 5;                // °C
double insideTempHL = 7; // °C,  high temperature cutoff
double heatingOutput = 0;                  // PWM signal to the relay
double Kp = 2, Ki = 5, Kd = 1;
PID heatingPID(&amp;insideTemp, &amp;heatingOutput, &amp;heatingSetpoint, Kp, Ki, Kd, DIRECT);

// GUI definitions and helpers
//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266WIFI_LIB_CLOUD
#include &lt;ESP8266WiFi.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID &quot;SSID&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;PASSWORD&quot;
#define REMOTEXY_CLOUD_SERVER &quot;cloud.remotexy.com&quot;
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN &quot;TOKEN&quot;

// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] = // 246 bytes
    {255, 9, 0, 12, 0, 239, 0, 16, 24, 1, 3, 130, 37, 48, 18, 10, 2, 26, 67, 4,
     34, 13, 20, 5, 2, 26, 11, 129, 0, 38, 60, 16, 3, 17, 79, 70, 70, 32, 47, 32,
     65, 85, 84, 79, 0, 66, 129, 34, 34, 20, 7, 1, 26, 129, 0, 3, 35, 25, 5, 17,
     80, 73, 68, 32, 79, 117, 116, 112, 117, 116, 0, 129, 0, 55, 13, 5, 5, 17, 194, 176,
     67, 0, 129, 0, 3, 13, 29, 5, 17, 73, 110, 105, 115, 105, 100, 101, 32, 84, 101, 109,
     112, 0, 129, 0, 3, 3, 56, 5, 17, 67, 104, 105, 99, 107, 101, 110, 32, 67, 111, 111,
     112, 32, 67, 111, 110, 116, 114, 111, 108, 101, 114, 0, 129, 0, 55, 20, 5, 5, 17, 194,
     176, 67, 0, 129, 0, 3, 20, 21, 5, 17, 83, 101, 116, 32, 80, 111, 105, 110, 116, 0,
     129, 0, 3, 27, 22, 5, 17, 72, 84, 32, 67, 117, 116, 111, 102, 102, 0, 7, 44, 34,
     20, 20, 5, 2, 26, 2, 2, 7, 44, 34, 27, 20, 5, 2, 26, 2, 2, 129, 0, 55,
     27, 5, 5, 17, 194, 176, 67, 0, 129, 0, 55, 35, 4, 5, 17, 37, 0, 130, 1, 2,
     10, 59, 1, 17, 130, 1, 2, 44, 59, 1, 17, 129, 0, 3, 51, 26, 6, 17, 72, 69,
     65, 84, 73, 78, 71, 0};

// this structure defines all the variables and events of your control interface
struct
{

  // input variables
  uint8_t heatingSelect; // =0 if select position A, =1 if position B, =2 if position C, ...
  float heatingSetpoint;
  float insideTempHL;

  // output variables
  char insideTemp[11]; // string UTF8 end zero
  int8_t PIDoutput;    // =0..100 level position

  // other variable
  uint8_t connect_flag; // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

void setup()
{
  Serial.begin(9600);
  // Heating relay setup
  pinMode(HEATINGPIN, OUTPUT);
  digitalWrite(HEATINGPIN, LOW); // put relay off at start
  pinMode(BUILTIN_LED, OUTPUT);
  heatingPID.SetMode(AUTOMATIC); // turn the PID on

  // GUI setup
  RemoteXY_Init();
  RemoteXY.heatingSetpoint = 5; // °C
  RemoteXY.insideTempHL = 7;    // °C
  RemoteXY.heatingSelect = 1;   // AUTO

  // Inside temperature setup
  sensors.begin();               // DS18B20 sensor
  sensors.requestTemperatures(); // Send the request for a new value
}

void loop()
{

  // GUI handler
  RemoteXY_Handler();

  if (millis() - DS18B20prevReading &gt; DS18B20_READING_DELAY) // DS18B20 needs a delay between request and getting value
  {
    insideTemp = sensors.getTempCByIndex(0); // Get DS18B20 temperature
    dtostrf(insideTemp, 0, 1, RemoteXY.insideTemp);
    sensors.requestTemperatures(); // Send the request for the next new value
    // Check if inside temperature reading was successful, or hight temp cutoff, or heating&#039;s off
    if ((insideTemp == DEVICE_DISCONNECTED_C) || (insideTemp &gt; insideTempHL) || (RemoteXY.heatingSelect == 0))
    {
      digitalWrite(HEATINGPIN, LOW);
      RemoteXY.PIDoutput = 0;
      digitalWrite(BUILTIN_LED, HIGH); // HIGH is off
      if (insideTemp == DEVICE_DISCONNECTED_C)
      {
        Serial.println(&quot;Device not connected...&quot;);
      }
      else if (insideTemp &gt; insideTempHL)
      {
        Serial.print(&quot;High Temp cut off : &quot;);
        Serial.print(insideTemp);
        Serial.print(&quot; / &quot;);
        Serial.println(insideTempHL);
      }
      else
      {
        Serial.print(&quot;Heating is OFF !&quot;);
      }
    }
    else
    {
      heatingPID.Compute();
      analogWrite(HEATINGPIN, heatingOutput);
      RemoteXY.PIDoutput = heatingOutput / 255;
      analogWrite(BUILTIN_LED, 255 - heatingOutput);
      Serial.print(insideTemp);
      Serial.print(&quot; / &quot;);
      Serial.print(insideTempHL);
      Serial.println(&quot; °C&quot;);
      Serial.println(heatingOutput);
    }
  }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (sbarabe)]]></author>
			<pubDate>Wed, 01 Nov 2023 13:27:04 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=5240#p5240</guid>
		</item>
	</channel>
</rss>
