Readings Coming Back As Random Numbers

I’m trying to send a time packet to the things network. I’m doing this by using a NEO-6M GPS, with the Adafruit_GPS library. However, say the time was 19:39:40, it will come back as this:
image
Not entirely sure why it’s doing this, as the serial monitor outputs the correct time.

I have combined the GPS.hour, GPS.minutes and GPS.seconds together like this:

timePacket = packetHour + packetMinute + packetSeconds;
uint32_t timeSend = stringToUint(timePacket);
uint32_t timePayload = timeSend;

I use a function to turn the data type from String to Long or uint32_t:

uint32_t stringToUint(String s) {
  char arr[7];
  s.toCharArray(arr, sizeof(arr));
  return atol(arr);
}

Here is the payload formatter:

function decodeUplink(input) {
  var data = {};
  var sensorDistance = (input.bytes[0] << 8) + input.bytes[1];
  data.distance = sensorDistance;
  return {
    data: data,
  };
}

I’m not entirely sure why it’s doing this, as all other data reads correct. Any help would be appreciated.

https://www.thethingsnetwork.org/docs/devices/bytes/

I’ve just stumbled across this, turns out the value I’m trying to send is higher than 255. I think it would be better splitting it up which is what I was trying to avoid.

Did you read the other materials suggested to you?

Why would that be useful? The network already knows what time it is, and LoRaWAN networks require a strong focus on optimizing airtime, including by not sending unnecessary information.

The real solution to this is to focus on why there is a need for time information, and then figure out the most efficient way to accomplish that.

Why can’t the packet time metadata added on receipt by the network be used?