fatal error: net/rime/broadcast.h: No such file or directory

I am trying to retrieve data from dht11 using esp8266 through CoAP but I receieved following error:
fatal error: net/rime/broadcast.h: No such file or directory
Details of error are:
Arduino: 1.8.5 (Windows 8.1), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, All Flash Contents, 115200"

In file included from sketch\stunicast.h:76:0,

from sketch\runicast.h:81,

from sketch\collect.h:63,

from sketch\rime.h:49,

from sketch\contiki-net.h:61,

from sketch\coap-common.h:11,

from sketch\coapserver.h:7,

from C:\Users\labpc 7\Documents\Arduino\coap-server\coap-server.ino:6:

sketch\unicast.h:65:32: fatal error: net/rime/broadcast.h: No such file or directory

#include "net/rime/broadcast.h"

^

compilation terminated.

Multiple libraries were found for "ESP8266WiFi.h"
Used: C:\Users\labpc 7\Documents\Arduino\libraries\ESP8266WiFi
Not used: C:\Users\labpc 7\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

If I solve the above error by removing net/rime/ from unicast.h file then another error of same type appears in the header file with name in which I made correction(in this case it will be broadcast.h). I go on doing this and solve one error but receive another error in another header file.
Can anyone help me to solve this dependency error of header file(I have named it)?
I am using below code in arduino:
/*
ESP-COAP Server
*/

#include <ESP8266WiFi.h>
#include "coapserver.h"

// CoAP server endpoint url callback
void callback_light(coapPacket &packet, IPAddress ip, int port, int obs);

coapServer coap;

//WiFi connection info
const char* ssid = "xxxxxxxxxxxx";
const char* password = "xxxxxxxxx";

// LED STATE
bool LEDSTATE;

// CoAP server endpoint URL
void callback_light(coapPacket *packet, IPAddress ip, int port, int obs) {
Serial.println("light");

// send response
char p[packet->payloadlen + 1];
memcpy(p, packet->payload, packet->payloadlen);
p[packet->payloadlen] = NULL;
Serial.println(p);

String message(p);

if (message.equals("0"))
{
digitalWrite(16, LOW);
Serial.println("if loop");
}
else if (message.equals("1"))
{
digitalWrite(16, HIGH);
Serial.println("else loop");
}
char *light = (digitalRead(16) > 0) ? ((char *) "1") : ((char *) "0");

//coap.sendResponse(packet, ip, port, light);
if (obs == 1)
coap.sendResponse(light);
else
coap.sendResponse(ip, port, light);

}

void callback_lightled(coapPacket *packet, IPAddress ip, int port, int obs) {
Serial.println("Lightled");

// send response
char p[packet->payloadlen + 1];
memcpy(p, packet->payload, packet->payloadlen);
p[packet->payloadlen] = NULL;

String message(p);

if (message.equals("0"))
LEDSTATE = false;
else if (message.equals("1"))
LEDSTATE = true;

if (LEDSTATE) {
digitalWrite(5, HIGH) ;
if (obs == 1)
coap.sendResponse("1");
else
coap.sendResponse(ip, port, "1");

//coap.sendResponse("1");
} else {
digitalWrite(5, LOW) ;
if (obs == 1)
coap.sendResponse("0");
else
coap.sendResponse(ip, port, "0");
//coap.sendResponse("0");
}
}

void setup() {
yield();
//serial begin
Serial.begin(115200);

WiFi.begin(ssid, password);
Serial.println(" ");

// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
//delay(500);
yield();
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
// Print the IP address
Serial.println(WiFi.localIP());

// LED State
pinMode(16, OUTPUT);
digitalWrite(16, HIGH);
LEDSTATE = true;

pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
//LEDSTATE = true;

// add server url endpoints.
// can add multiple endpoint urls.

coap.server(callback_light, "light");
coap.server(callback_lightled, "lightled");
// coap.server(callback_text,"text");

// start coap server/client
coap.start();
// coap.start(5683);
}

void loop() {
coap.loop();
delay(1000);

}

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

I already warned you in your other thread that smashing around making hacky workarounds is a bad idea. It will be much easier in the end to just use the code as the author intended. Please post a link to where you found this code. Use the chain links icon on the toolbar to make the link clickable.

Thanks for your suggestion pert.Quote from pert Jun 23, 2018, 12:12 pm
"Please use code tags (</> button on the toolbar) when you post code or warning/error messages. "

So I am using code tags for below mentioned code.

/*
  ESP-COAP Server
*/

#include <ESP8266WiFi.h>
#include "coapserver.h"


// CoAP server endpoint url callback
void callback_light(coapPacket &packet, IPAddress ip, int port, int obs);

coapServer coap;

//WiFi connection info
const char* ssid = "xxxxxxxxxxxx";
const char* password = "xxxxxxxxx";

// LED STATE
bool LEDSTATE;

// CoAP server endpoint URL
void callback_light(coapPacket *packet, IPAddress ip, int port, int obs) {
  Serial.println("light");

  // send response
  char p[packet->payloadlen + 1];
  memcpy(p, packet->payload, packet->payloadlen);
  p[packet->payloadlen] = NULL;
  Serial.println(p);

  String message(p);

  if (message.equals("0"))
  {
    digitalWrite(16, LOW);
    Serial.println("if loop");
  }
  else if (message.equals("1"))
  {
    digitalWrite(16, HIGH);
    Serial.println("else loop");
  }
  char *light = (digitalRead(16) > 0) ? ((char *) "1") : ((char *) "0");

  //coap.sendResponse(packet, ip, port, light);
  if (obs == 1)
    coap.sendResponse(light);
  else
    coap.sendResponse(ip, port, light);

}



void callback_lightled(coapPacket *packet, IPAddress ip, int port, int obs) {
  Serial.println("Lightled");

  // send response
  char p[packet->payloadlen + 1];
  memcpy(p, packet->payload, packet->payloadlen);
  p[packet->payloadlen] = NULL;

  String message(p);

  if (message.equals("0"))
    LEDSTATE = false;
  else if (message.equals("1"))
    LEDSTATE = true;

  if (LEDSTATE) {
    digitalWrite(5, HIGH) ;
    if (obs == 1)
      coap.sendResponse("1");
    else
      coap.sendResponse(ip, port, "1");

    //coap.sendResponse("1");
  } else {
    digitalWrite(5, LOW) ;
    if (obs == 1)
      coap.sendResponse("0");
    else
      coap.sendResponse(ip, port, "0");
    //coap.sendResponse("0");
  }
}


void setup() {
  yield();
  //serial begin
  Serial.begin(115200);

  WiFi.begin(ssid, password);
  Serial.println(" ");

  // Connect to WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    //delay(500);
    yield();
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  // Print the IP address
  Serial.println(WiFi.localIP());

  // LED State
  pinMode(16, OUTPUT);
  digitalWrite(16, HIGH);
  LEDSTATE = true;

  pinMode(5, OUTPUT);
  digitalWrite(5, HIGH);
  //LEDSTATE = true;


  // add server url endpoints.
  // can add multiple endpoint urls.

  coap.server(callback_light, "light");
  coap.server(callback_lightled, "lightled");
  // coap.server(callback_text,"text");

  // start coap server/client
  coap.start();
  // coap.start(5683);
}

void loop() {
  coap.loop();
  delay(1000);


}

Quote from:pert on Jun 23, 2018, 12:12 pm
"Please post a link to where you found this code."

So I am inserting the url for above code(raw format).
ESP-CoAP server code url

Finally,

Quote from:pert on Jun 23, 2018, 12:12 pm
"I already warned you in your other thread that smashing around making hacky workarounds is a bad idea."

I just want to say, I always try to find a solution by googling it and if I don't find a solution, I try to find a solution in my own way finally if I fail then I seek help of others. The reason is, If we try to seek help of others at first place then we can't learn anything on our own(This is what I think, I don't know about others).

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

The code you found is an example for a library but you didn't install the library. If you had read the library's readme found in the same repository as the example code you would have found instructions for installing the library. Those instructions will work, but I can provide you more detailed instructions that offer an easier and less problematic method of installing the library:

shivkadari:
I just want to say, I always try to find a solution by googling it and if I don't find a solution, I try to find a solution in my own way finally if I fail then I seek help of others. The reason is, If we try to seek help of others at first place then we can't learn anything on our own(This is what I think, I don't know about others).

That's great. It's exactly what I do. But when you do finally need to ask for help you should provide all the necessary information. With that link, I could have given you the correct solution from the start. The problem with just taking a shotgun approach of dropping random files in random locations is you can end up creating new problems for yourself. The upside is I think you learned something new about the #include directive syntax, which is definitely useful information.

Again, Thank you very much pert for your valuable suggestion. I did exactly what you suggested and added libraries using link sketch>include library> add .zip library but then I received this error mentioned below. Details of error are:

Arduino: 1.8.5 (Windows 10), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
In file included from C:\Users\KADARI SHIVRAJ\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src\ArduinoJson\test\Polyfills\parseInteger.cpp:6:0:

C:\Users\KADARI SHIVRAJ\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/parseInteger.hpp:9:32: fatal error: ../Configuration.hpp: No such file or directory

#include "../Configuration.hpp"

                              ^

compilation terminated.

Using library ESP8266WiFi at version 1.0 in folder: C:\Users\KADARI SHIVRAJ\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi 
exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

I know it is again related to some library not installed. I am not able to understand which library configuration file is missing. Please guide me. I am using the same code mentioned above.

This is exactly the sort of problem that occurs when you start dumping random files in random places. The ESP8266WiFi library doesn't have any of these files so clearly you have modified it. If you had made these changes methodically then you:

  • Would be able to easily undo them.
  • Would be able to describe to the people trying to help you exactly what changes you made.

Since you didn't do that I'm going to recommend that you just start over:

  • Delete C:\Users\KADARI SHIVRAJ\AppData\Local\Arduino15
  • Delete C:\Users\labpc 7\Documents\Arduino\libraries\ESP8266WiFi
  • Uninstall the Arduino IDE.
  • Install the Arduino IDE again.
  • Install the ESP8266 core for Arduino again.

Hopefully that will get rid of all the random changes you made. I've already verified that the code you're trying to use compiles fine with an unmodified version of the ESP8266 core and the ESP-CoAP library installed.

Thank you very much pert. I am able to compile the code successfully after following your instructions but after uploading the code to esp8266, I get continuous "r" in serial monitor without any ip address. Also I want to use firefox as client to access this server(esp8266) so I want to know how to do that and in that case what will be the use of client.ino file.