Data transfer from the CRa LoRaWAN network to TagoIO

Data transfer from the CRa LoRaWAN network to TagoIO

Hello,

I would like to ask you for help with setting up data transfer from CRa LoRaWAN network to TagoIO.
I use Moko GPS tracker https://www.mokosmart.com/lw001-bg-lorawan-tm-gps-tracker/
I have a payload parser for this tracker that works fine in The Things Network:
  1. //LW001-BG Payload Decoder rule
    //Creation time:2021-01-27
    //Suitable firmware versions:LW001-BG V1.2.5 & V1.2.4 &V1.2.3
    //Programming languages:Javascript
    //Suitable platforms:TTN
    /* Decoder MOKO LW001-BG GPS tracker with The Things Network
     * by Emanuele Goldoni, Sitip.net, 2020. <emanuele.goldoni@gmail.com>*/

    function Decoder(bytes, port) {
        var decoded = {};

        if (bytes[0] !== 0x02) { return decoded; }

        decoded.sensor = "MOKO LW001-BG";
        decoded.current_pkt = bytes[1];

        if (decoded.current_pkt == 1) {

            var f_lat = Bytes2Float(bytes.slice(2,6))
            var deg_lat = Math.floor(f_lat/100);
            decoded.latitude = deg_lat + (f_lat - deg_lat*100)/60;

            var f_lon = Bytes2Float(bytes.slice(6, 10))
            var deg_lon = Math.floor(f_lon/100);
            decoded.longitude = deg_lon + (f_lon - deg_lon*100)/60;

        } else if (decoded.current_pkt == 2) {

            decoded.battery = (bytes[2] === 0x00) ? "ok" : "warning";
            var f_speed = Bytes2Float(bytes.slice(3, 7))
            decoded.speed = f_speed * 1.852;  // from knots to km/h

            raw_xdir = ((bytes[8] << 8) | bytes[7])
            decoded.xdir = raw_xdir / 100

            raw_ydir = ((bytes[10] << 8) | bytes[9])
            decoded.ydir = raw_ydir / 100

        }

        return decoded;
    }


    /*
       Convert to float a value represented in the 4-byte IEEE 754 standard.
       Byte order is low byte first.
       Implementation based on https://stackoverflow.com/a/37471538 by Ilya Bursov
    */

    function Bytes2Float(bytes) {
        var bits = ((bytes[3] << 24) | (bytes[2] << 16) | (bytes[1] << 8) | (bytes[0]));
        var sign = ((bits >>> 31) === 0) ? 1.0 : -1.0;
        var e = ((bits >>> 23) & 0xff);
        var m = (e === 0) ? (bits & 0x7fffff) << 1 : (bits & 0x7fffff) | 0x800000;
        var f = sign * m * Math.pow(2, e - 150);
        return f
    }
If the tracker is connected via the CRa LoRaWAN network, the connection works up to TagoIO, but in the TagoIO live inspector for the GPS tracker it is written:
  1. 2022-10-26 21:27:16: [POST] HTTP Request: From: 82.99.180.180 [Apache-HttpClient/4.5.2 (Java/1.8.0_292)] - Content-Type: application/json - Token Ending: 0af75
    2022-10-26 21:27:16: Raw payload: {"type":"D","data":"{\"cmd\":\"gw\",\"seqno\":793027102,\"EUI\":\"003E54A26542EEF2\",\"ts\":1666812435447,\"fcnt\":1,\"port\":8,\"freq\":868300000,\"toa\":1482,\"dr\":\"SF12 BW125 4/5\",\"ack\":false,\"gws\":[{\"rssi\":-95,\"snr\":-6.2,\"ts\":1666812435451,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411763000Z\",\"gweui\":\"647FDAFFFF0069C4\",\"ant\":0,\"lat\":49.187359,\"lon\":16.534279},{\"rssi\":-105,\"snr\":-9,\"ts\":1666812435461,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411732000Z\",\"gweui\":\"647FDAFFFF0069E8\",\"ant\":0,\"lat\":49.223438,\"lon\":16.626137},{\"rssi\":-107,\"snr\":-5.8,\"ts\":1666812435453,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411743000Z\",\"gweui\":\"647FDAFFFF006A1C\",\"ant\":0,\"lat\":49.232315,\"lon\":16.581175},{\"rssi\":-107,\"snr\":-8.2,\"ts\":1666812435447,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411762000Z\",\"gweui\":\"647FDAFFFF006A70\",\"ant\":0,\"lat\":49.215981,\"lon\":16.501905},{\"rssi\":-108,\"snr\":-12.2,\"ts\":1666812435522,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411747000Z\",\"gweui\":\"647FDAFFFF009592\",\"ant\":0,\"lat\":49.2033,\"lon\":16.593462},{\"rssi\":-115,\"snr\":-2,\"ts\":1666812435460,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411735000Z\",\"gweui\":\"647FDAFFFF00AE05\",\"ant\":0,\"lat\":49.223373,\"lon\":16.674891}],\"bat\":255,\"data\":\"020200ae47e13dfb45a000\",\"_id\":\"63598a13ed1f97e990ef1025\"}","tech":"L","tags":[]}
    2022-10-26 21:27:16: Result of [device] payload parser: [{"type":"D","data":"{\"cmd\":\"gw\",\"seqno\":793027102,\"EUI\":\"003E54A26542EEF2\",\"ts\":1666812435447,\"fcnt\":1,\"port\":8,\"freq\":868300000,\"toa\":1482,\"dr\":\"SF12 BW125 4/5\",\"ack\":false,\"gws\":[{\"rssi\":-95,\"snr\":-6.2,\"ts\":1666812435451,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411763000Z\",\"gweui\":\"647FDAFFFF0069C4\",\"ant\":0,\"lat\":49.187359,\"lon\":16.534279},{\"rssi\":-105,\"snr\":-9,\"ts\":1666812435461,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411732000Z\",\"gweui\":\"647FDAFFFF0069E8\",\"ant\":0,\"lat\":49.223438,\"lon\":16.626137},{\"rssi\":-107,\"snr\":-5.8,\"ts\":1666812435453,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411743000Z\",\"gweui\":\"647FDAFFFF006A1C\",\"ant\":0,\"lat\":49.232315,\"lon\":16.581175},{\"rssi\":-107,\"snr\":-8.2,\"ts\":1666812435447,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411762000Z\",\"gweui\":\"647FDAFFFF006A70\",\"ant\":0,\"lat\":49.215981,\"lon\":16.501905},{\"rssi\":-108,\"snr\":-12.2,\"ts\":1666812435522,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411747000Z\",\"gweui\":\"647FDAFFFF009592\",\"ant\":0,\"lat\":49.2033,\"lon\":16.593462},{\"rssi\":-115,\"snr\":-2,\"ts\":1666812435460,\"tmms\":0,\"time\":\"2022-10-26T19:27:15.411735000Z\",\"gweui\":\"647FDAFFFF00AE05\",\"ant\":0,\"lat\":49.223373,\"lon\":16.674891}],\"bat\":255,\"data\":\"020200ae47e13dfb45a000\",\"_id\":\"63598a13ed1f97e990ef1025\"}","tech":"L","tags":[]}]
    2022-10-26 21:27:16: Connection refused, invalid payload: {"zodError":{"variable":[{"message":"Required","path":["variable"]}]}}
    ------
    2022-10-26 21:27:11: [POST] HTTP Request: From: 82.99.180.180 [Apache-HttpClient/4.5.2 (Java/1.8.0_292)] - Content-Type: application/json - Token Ending: 0af75
    2022-10-26 21:27:11: Raw payload: {"type":"D","data":"{\"cmd\":\"gw\",\"seqno\":793027058,\"EUI\":\"003E54A26542EEF2\",\"ts\":1666812430995,\"fcnt\":0,\"port\":8,\"freq\":868300000,\"toa\":1482,\"dr\":\"SF12 BW125 4/5\",\"ack\":false,\"gws\":[{\"rssi\":-96,\"snr\":-11.8,\"ts\":1666812431003,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.959980000Z\",\"gweui\":\"647FDAFFFF0069E8\",\"ant\":0,\"lat\":49.223438,\"lon\":16.626137},{\"rssi\":-107,\"snr\":-7.2,\"ts\":1666812431010,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.960011000Z\",\"gweui\":\"647FDAFFFF0069C4\",\"ant\":0,\"lat\":49.187359,\"lon\":16.534279},{\"rssi\":-107,\"snr\":-10.8,\"ts\":1666812431009,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.959991000Z\",\"gweui\":\"647FDAFFFF006A1C\",\"ant\":0,\"lat\":49.232315,\"lon\":16.581175},{\"rssi\":-113,\"snr\":-6.5,\"ts\":1666812431008,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.960010000Z\",\"gweui\":\"647FDAFFFF006A70\",\"ant\":0,\"lat\":49.215981,\"lon\":16.501905},{\"rssi\":-115,\"snr\":-4.5,\"ts\":1666812430995,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.959983000Z\",\"gweui\":\"647FDAFFFF00AE05\",\"ant\":0,\"lat\":49.223373,\"lon\":16.674891}],\"bat\":255,\"data\":\"0201589c99457443cd44\",\"_id\":\"63598a0fddcef96fd3288703\"}","tech":"L","tags":[]}
    2022-10-26 21:27:11: Result of [device] payload parser: [{"type":"D","data":"{\"cmd\":\"gw\",\"seqno\":793027058,\"EUI\":\"003E54A26542EEF2\",\"ts\":1666812430995,\"fcnt\":0,\"port\":8,\"freq\":868300000,\"toa\":1482,\"dr\":\"SF12 BW125 4/5\",\"ack\":false,\"gws\":[{\"rssi\":-96,\"snr\":-11.8,\"ts\":1666812431003,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.959980000Z\",\"gweui\":\"647FDAFFFF0069E8\",\"ant\":0,\"lat\":49.223438,\"lon\":16.626137},{\"rssi\":-107,\"snr\":-7.2,\"ts\":1666812431010,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.960011000Z\",\"gweui\":\"647FDAFFFF0069C4\",\"ant\":0,\"lat\":49.187359,\"lon\":16.534279},{\"rssi\":-107,\"snr\":-10.8,\"ts\":1666812431009,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.959991000Z\",\"gweui\":\"647FDAFFFF006A1C\",\"ant\":0,\"lat\":49.232315,\"lon\":16.581175},{\"rssi\":-113,\"snr\":-6.5,\"ts\":1666812431008,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.960010000Z\",\"gweui\":\"647FDAFFFF006A70\",\"ant\":0,\"lat\":49.215981,\"lon\":16.501905},{\"rssi\":-115,\"snr\":-4.5,\"ts\":1666812430995,\"tmms\":0,\"time\":\"2022-10-26T19:27:10.959983000Z\",\"gweui\":\"647FDAFFFF00AE05\",\"ant\":0,\"lat\":49.223373,\"lon\":16.674891}],\"bat\":255,\"data\":\"0201589c99457443cd44\",\"_id\":\"63598a0fddcef96fd3288703\"}","tech":"L","tags":[]}]
    2022-10-26 21:27:11: Connection refused, invalid payload: {"zodError":{"variable":[{"message":"Required","path":["variable"]}]}}
    ------
The data bucket is empty.
I think the problem is that the data from the CRa network comes in a different format than the basic payload parser can handle.
I'm just an ordinary user who plays with IoT in my free time, so unfortunately I'm not capable of solving this problem myself.
Can someone with experience help me please?