Hi,
I have problem with correct transfer of message (12 bytes) from Arduino to Sigfox LPWAN node + CALLBACK to webpage.
I would like to send 12 different values from 12 sensors. Each value is a byte type in Arduino. Then I create a message for Sigfox LPWAN module which can be up to 12 bytes. According to documentation the message has to be in HEX format. Then I have a CALLBACK created in Sigfox back end.
I tested many options already but still not doing what I am expecting
I think there is problem with correct representation of the message in HEX format. My last try is as following in Arduino code:
byte dataArray[12];
Sigfox.print("AT$SF=");
Sigfox.print(dataArray[0], HEX);
Sigfox.print(dataArray[1], HEX);
Sigfox.print(dataArray[2], HEX);
Sigfox.print(dataArray[3], HEX);
Sigfox.print(dataArray[4], HEX);
Sigfox.print(dataArray[5], HEX);
Sigfox.print(dataArray[6], HEX);
Sigfox.print(dataArray[7], HEX);
Sigfox.print(dataArray[8], HEX);
Sigfox.print(dataArray[9], HEX);
Sigfox.print(dataArray[10], HEX);
Sigfox.print(dataArray[11], HEX);
Sigfox.print('\r');
Custom payload definition in Sigfox backend:
var1::uint:8 var2::uint:8 var3::uint:8 var4::uint:8 var5::uint:8 var6::uint:8 var7::uint:8 var8::uint:8 var9::uint:8 var10::uint:8 var11::uint:8 var12::uint:8
For now I think the problem is that the numbers are sent in HEX but in case that the number is not starting with 1 in the bit form, then there are missing the spaces in the final message. So I think there is required some kind of bitshifting or something like this. When I tested to send mumber 255 on all positions then I get correct CALLBACK response on the Sigfox backend. But when there are smaller numbers which do not start with 1 in bit representation of the number, then the CALLBACK do not correctly read the numbers and display "null" in the custom payloads variables. I think it must be caused by the representaton of the HEX numbers. But I do not know how to solve it. Maybe there is more simple way how to send the Sigfox message in HEX and I am going wrong direction So any advice will be appreciated.
Thank you in advance.