Tagged: 

This topic has 2 replies, 2 voices, and was last updated 3 weeks, 6 days ago by norkek. This post has been viewed 95 times

  • Author
    Posts
  • #1047
     norkek
    Participant

    Hi all

    We’re using CoAP simple library on our Arduino MKR NB 1500. We’ve built our own CoAP server using node-coap but messages from the Arduino are never received. However, if we connect to Telenor MIC IoT platform everything works fine. This leads me to believe that the fault lies at our CoAP server, but when I manually send messages from Copper extension or coap.me, they are received at our server. All our server does is print out a message to the terminal when a request (of any kind, like GET, PUT and POST) is received (just to eliminate all possible errors).

    I tried to change port from default 5683 to others, but it makes no difference.

    Here’s the complete code with public IP addresses hidden (setup() function consists of sending commands to SIM card to connect to 4G network so I guess that could be omitted):

    And here’s the code of our node-coap server:

    The log below show main loop where our Arduino sends the message to our server, but nothing is received at our server.

    Any troubleshooting ideas?

    #1055
     Pontus
    Keymaster

    Hi!

    The reason why you cannot send to your own CoAP server is because of the APN. In the Arduino code this is specified in the “gprs_apn” variable (configured in arduino_secrets.h as “SECRET_GPRS_APN”). Right now you are most likely using the “telenor.iotgw” APN, which is a private APN that will only allow the device to send and receive data from the IP 172.16.32.1. Any other IP-adresses wont work. You can change the value of “SECRET_GPRS_APN” in arduino_secrets.h to “telenor.iot”, which is a public APN that will allow the device to send and receive data over the open internet (and your own CoAP server).

    However, while using the public APN “telenor.iot” and CoAP you data traffic will not be encrypted. This can only be achieved by using the private APN “telenor.iotgw”, where the traffic is not routed on the open internet. This is why we use TLS encryption when using the MQTT protocol. You can get an overview of the difference between MQTT and CoAP here: https://telenorstartiot.github.io/

    -Pontus

    #1057
     norkek
    Participant

    Hello Pontus and thanks for your detailed explanation and fast reply. That was indeed the issue 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

© 2020 Telenor Start IoT
 

Log in with your credentials

Forgot your details?