Empty payload when sending data with Arduino MKR WAN 1310

Hi!

I’m trying to send a message from my device (MKR WAN 1310) using the LoraSendAndReceive.ino from MKRWAN repository. First, I executed FirstConfiguration.ino and it worked just fine, as I could see “HeLoRa World!” message as payload in my AppServer.

But then, when executing LoraSendAndReceive.ino, although I can see uplink messages in Data Device tab, object JSON data is “”. I’ve tried with and without JavaScript codec functions but it’s always empty.

Test for FirstConfiguration.ino:

Test for LoraSendAndReceive.ino

Any help appreciated, as this is my first LoRaWAN application.

1 Like

Found the solution. When using LoraSendAndReceive.ino Port 0 is mandatory. But this port is used by LoRaWAN for MAC. Inserted module.setPort(3) and it’s properly working now.

2 Likes

Hey @agmunoz, what payload decoder (JSON) are you using?

Hi! I’m using Arduino’s JavaScript function, available in its oficial site for MKR WAN 1310

Thanks! Saludos desde México!