Chat freely about anything...

User avatar
By crbxy
#91663 hello, i am a newb to arduino ide and these codes, trying to use my nodemcu esp-12e as a coap client but i keep getting an exception 28 error which i dont know what is causing, this is a school project and i cant seem to make any progress, it would be appreciated if i could get any help, thanks in advance.

Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
PC: 0x4000bf80
EXCVADDR: 0x0000008c

Decoding stack results
0x402019e0: coapClient::send(IPAddress, int, char*, COAP_TYPE, COAP_METHOD, unsigned char*, unsigned char, unsigned char*, unsigned int, unsigned char, unsigned char) at C:\Users\ugur_\OneDrive\Belgeler\Arduino\libraries\ESP-CoAP-master\coap_client.cpp line 81

0x40100100: ets_intr_lock() at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\core_esp8266_main.cpp line 159

0x402035e6: uart_tx_fifo_available(int) at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\uart.cpp line 499

0x40203670: uart_do_write_char(int, char) at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\uart.cpp line 512

0x40201ea8: HardwareSerial::write(unsigned char) at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266/HardwareSerial.h line 189

0x40201a70: coapClient::loop() at C:\Users\ugur_\OneDrive\Belgeler\Arduino\libraries\ESP-CoAP-master\coap_client.cpp line 191

0x4020825b: rand at /workdir/repo/newlib/newlib/libc/stdlib/rand.c line 79

0x40201a3c: coapClient::get(IPAddress, int, char*) at C:\Users\ugur_\OneDrive\Belgeler\Arduino\libraries\ESP-CoAP-master\coap_client.cpp line 29

0x401008cc: malloc(size_t) at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\umm_malloc\umm_malloc.cpp line 821

0x40100274: pvPortMalloc(size_t, char const*, int) at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\umm_malloc/umm_heap_select.h line 85

0x40201a70: coapClient::loop() at C:\Users\ugur_\OneDrive\Belgeler\Arduino\libraries\ESP-CoAP-master\coap_client.cpp line 191

0x402021f8: Print::println() at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266/Print.h line 57

0x402017c7: coapClient::start() at C:\Users\ugur_\OneDrive\Belgeler\Arduino\libraries\ESP-CoAP-master\coap_client.cpp line 24

0x4020118a: setup() at C:\Users\ugur_\AppData\Local\Temp\arduino_modified_sketch_968430/coapclient.ino line 66

0x40202934: loop_wrapper() at C:\Users\ugur_\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\core_esp8266_main.cpp line 198

Code: Select all/*
ESP-COAP Client
*/
#include <ESP8266WiFi.h>
#include "coap_client.h"

//instance for coapclient
coapClient coap;

//WiFi connection info
const char* ssid = "tt12";
const char* password = "12345";

//ip address and default port of coap server in which your interested in
IPAddress ip(127,0,0,1);//take ETH Zurich or coap.me server to run and check client
int port =5683;

// coap client response callback
void callback_response(coapPacket &packet, IPAddress ip, int port);

// coap client response callback
void callback_response(coapPacket &packet, IPAddress ip, int port) {
    char p[packet.payloadlen + 1];
    memcpy(p, packet.payload, packet.payloadlen);
    p[packet.payloadlen] = NULL;

    //response from coap server
 if(packet.type==3 && packet.code==0){
      Serial.println("ping ok");
    }

    Serial.println(p);
}

void setup() {
   
    Serial.begin(115200);

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

    // Connection info 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 of client
    Serial.println(WiFi.localIP());

    // client response callback.
    // this endpoint is single callback.
    coap.response(callback_response);

    // start coap client
    coap.start();

    //get request to server (arguments ip adrress of server,default port,resource(uri))
    int msgid = coap.get(ip,port,"light");

    //observe request (arguments ip adrress of server,deafult port,resource name,interger(0) )
    //int msgid= coap.observe(ip,port,"light",0);

    //reset observe cancel
    //int msgid=coap.observecancel(ip,port,"resoucename");
   
}
//int i=0;

void loop() {
    bool state;
 
    // Requests

    //get request
    //int msgid = coap.get(ip,port,"hello");

    //put request
    //arguments server ip address,default port,resource name, payload,payloadlength
    //int msgid =coap.put(ip,port,"resourcename","0",strlen("0"));

    //post request
    //arguments server ip address,default port,resource name, payload,payloadlength
    //int msgid =coap.post(ip,port,"resourcename","0",strlen("0"));

    //delete request
    //int msgid = coap.delet(ip,port,"resourcename");

    //ping
    //int msgid=coap.ping(ip,port);
   
    // int msgid=coap.observe(ip,port,"obs",0);
 
    state= coap.loop();
    // Serial.print("state=");
    //Serial.println(state);
    //if(state==true)
          //i=i+1;
 
    //Serial.print("i=");
    //Serial.println(i);
      //if(i==3)
    //{
        //Serial.println("cancel observe");
        //coap.observeCancel(ip,port,"resourcename");
    //}
 
    //Serial.println(msgid);
    delay(1000);
}


I'm using NodeMCU ESP-12E on Windows and Arduino IDE 1.8.15
https://github.com/automote/ESP-CoAP - This is the library i used
I'm sorry if this is the wrong section, please remove if so.
User avatar
By crbxy
#91703
schufti wrote:do yourself a favor and downgrade to 2.x core.
Version 3 is broken in so many places, it is a waste of time ...


sorry, downgrade what, IDE ?

eriksl wrote:You may want to post this in the arduino section. It's not generic to ESP8266.


I've reported the first post and asked for it to be moved, thank you