Description:
After calling CoAP::start() on my Arduino MKR NB 1500 board, the program hangs and does not continue executing. I'm really not sure what is happening.
I have included the relevant code snippet below:
#include <MKRNB.h>
#include <coap-simple.h>
NBClient nbClient;
NBUDP udp;
GPRS gprsAccess;
NB nbAccess;
Coap coap(udp);
void setup()
{
// 9600 Baudrate
Serial.begin(9600);
// Waiting for Serial port to Connect
while (!Serial)
;
Serial.println("Hello from setup!");
coap.start(); // Program hangs here
Serial.println("Coap Has Started");
}
void loop()
{
// Code for taking sensor readings and sending data
}
coap.start() can't work until after get an IP address(network connection), because of coap can't bind IP/port.
You might want to check your Arduino getting an IP address or not.
Description: After calling
CoAP::start()
on my Arduino MKR NB 1500 board, the program hangs and does not continue executing. I'm really not sure what is happening.I have included the relevant code snippet below: