TTV mit Cayenne LPP klappt nicht

Hallo zusammen,

ich betreibe schon erfolgreich 2 SenseBoxen mit verschiedenen Sensoren die LoRa-Wan (TTN) mit Cayenne LPP als Payload-Formatter. Diese dienen mir vor allen Dingen zum Testen und ausprobieren.

Jetzt möchte ich eine dritte Box auf die gleiche Art und Weise mit der OpenSenseMap verbinden. Die Einstellungen sind sowohl bei TTN als auch bei OpenSenseMap die gleichen, wie bei den funktionierenden Boxen, ich habe den ProgrammCode mit Blockly erstellt, er ist ebenfalls der gleiche (mit angepassten ID, die ich schon mehrmals überprüft habe).

Der einzige große Unterschied ist, dass ich jetzt auch einen Feinstaubsenor SDS011 angeschlossen habe.

#include <senseBoxIO.h>
#include <SPI.h>
#include <lmic.h> // http://librarymanager/All#IBM_LMIC_framework
#include <hal/hal.h>
#include <Adafruit_DPS310.h> // http://librarymanager/All#Adafruit_DPS310
#include <CayenneLPP.h> // http://librarymanager/All#CayenneLPP
#include <Adafruit_HDC1000.h> // http://librarymanager/All#Adafruit_HDC1000_Library
#include <SdsDustSensor.h> // http://librarymanager/All#Nova_Fitness_Sds_dust_sensors_library

float Luftdruck;

CayenneLPP lpp(51);


    static const u1_t PROGMEM APPEUI[8]= {????????????????};
    void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI , 8);}

    static const u1_t PROGMEM DEVEUI[8]= {??????????????????????????};
    void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI , 8);}

    // This key should be in big endian format (or, since it is not really a
    // number but a block of memory, endianness does not really apply). In
    // practice, a key taken from ttnctl can be copied as-is.
    // The key shown here is the semtech default key.
    static const u1_t PROGMEM APPKEY[16] = {???????????????????????????????};
    void os_getDevKey (u1_t* buf) {  memcpy_P(buf, APPKEY , 16);}

    static osjob_t sendjob;

    // Schedule TX every this many seconds (might become longer due to duty
    // cycle limitations).
    const unsigned TX_INTERVAL = 180;

    // Pin mapping
    const lmic_pinmap lmic_pins = {
        .nss = PIN_XB1_CS,
        .rxtx = LMIC_UNUSED_PIN,
        .rst = LMIC_UNUSED_PIN,
        .dio = {PIN_XB1_INT, PIN_XB1_INT, LMIC_UNUSED_PIN},
    };
Adafruit_DPS310 dps;
Adafruit_HDC1000 hdc = Adafruit_HDC1000();
SdsDustSensor sds(Serial1);


    void initLora() {
      delay(2000);
      // LMIC init
      os_init();
      // Reset the MAC state. Session and pending data transfers will be discarded.
      LMIC_reset();

      // Start job (sending automatically starts OTAA too)
      do_send(&sendjob);
    }

    void onEvent (ev_t ev) {
      Serial.print(os_getTime());
      Serial.print(": ");
      switch(ev) {
          case EV_SCAN_TIMEOUT:
              Serial.println(F("EV_SCAN_TIMEOUT"));
              break;
          case EV_BEACON_FOUND:
              Serial.println(F("EV_BEACON_FOUND"));
              break;
          case EV_BEACON_MISSED:
              Serial.println(F("EV_BEACON_MISSED"));
              break;
          case EV_BEACON_TRACKED:
              Serial.println(F("EV_BEACON_TRACKED"));
              break;
          case EV_JOINING:
              Serial.println(F("EV_JOINING"));
              break;
          case EV_JOINED:
              Serial.println(F("EV_JOINED"));

              // Disable link check validation (automatically enabled
              // during join, but not supported by TTN at this time).
              LMIC_setLinkCheckMode(0);
              break;
          case EV_RFU1:
              Serial.println(F("EV_RFU1"));
              break;
          case EV_JOIN_FAILED:
              Serial.println(F("EV_JOIN_FAILED"));
              break;
          case EV_REJOIN_FAILED:
              Serial.println(F("EV_REJOIN_FAILED"));
              break;
              break;
          case EV_TXCOMPLETE:
              Serial.println(F("EV_TXCOMPLETE (includes waiting for RX windows)"));
              if (LMIC.txrxFlags & TXRX_ACK)
                Serial.println(F("Received ack"));
              if (LMIC.dataLen) {
                Serial.println(F("Received "));
                Serial.println(LMIC.dataLen);
                Serial.println(F(" bytes of payload"));
              }
              // Schedule next transmission
              os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
              break;
          case EV_LOST_TSYNC:
              Serial.println(F("EV_LOST_TSYNC"));
              break;
          case EV_RESET:
              Serial.println(F("EV_RESET"));
              break;
          case EV_RXCOMPLETE:
              // data received in ping slot
              Serial.println(F("EV_RXCOMPLETE"));
              break;
          case EV_LINK_DEAD:
              Serial.println(F("EV_LINK_DEAD"));
              break;
          case EV_LINK_ALIVE:
              Serial.println(F("EV_LINK_ALIVE"));
              break;
           default:
              Serial.println(F("Unknown event"));
              break;
      }
  }



float getPmData(int type) {
  PmResult pm = sds.queryPm();
  if (pm.isOk()) {
    if (type == 25){
      return pm.pm25;
    } else if (type == 10) {
      return pm.pm10;
    }
  else return 0;
  }
}


  void do_send(osjob_t* j){
      // Check if there is not a current TX/RX job running
      if (LMIC.opmode & OP_TXRXPEND) {
          Serial.println(F("OP_TXRXPEND, not sending"));
      } else {
          lpp.reset();
            lpp.addTemperature(1, hdc.readTemperature());
  delay(2000);
  lpp.addRelativeHumidity(2, hdc.readHumidity());
  delay(2000);
  lpp.addBarometricPressure(3, Luftdruck);
  delay(2000);
  lpp.addAnalogInput(4, getPmData(25));
  delay(2000);
  lpp.addAnalogInput(5, getPmData(10));
  delay(2000);


          // Prepare upstream data transmission at the next possible time.
          LMIC_setTxData2(1, lpp.getBuffer(), lpp.getSize(), 0);
          Serial.println(F("Packet queued"));
      }
      // Next TX is scheduled after TX_COMPLETE event.
  }


void setup() {
Serial.begin(9600);
delay(1000);

dps.begin_I2C(0x76);

  dps.configurePressure(DPS310_64HZ, DPS310_64SAMPLES);
  dps.configureTemperature(DPS310_64HZ, DPS310_64SAMPLES);

hdc.begin();
sds.begin();
sds.setQueryReportingMode();


initLora();


}


void loop() {
sensors_event_t temp_event, pressure_event;
dps.getEvents(&temp_event, &pressure_event);
os_runloop_once();
Luftdruck = pressure_event.pressure;

}

Die Box verbindet sich erfolgreich mit dem TTN, allerdings erhalte ich immer folgende Fehlermeldungen:

Decke uplink data message failure Invalid Output

{
  "name": "as.up.data.decode.fail",
  "time": "2024-10-02T16:47:32.352155649Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "******************",
        "application_ids": {
          "application_id": "*******************"
        },
        "dev_eui": "??????????????????",
        "join_eui": "0000000000000000",
        "dev_addr": "????????????"
      }
    }
  ],
  "data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
    "namespace": "pkg/messageprocessors/cayennelpp",
    "name": "output",
    "message_format": "invalid output",
    "correlation_id": "a4d2094cd1ce41df8f97da78aada3ad9",
    "code": 3
  },
  "correlation_ids": [
    "gs:uplink:01J9722D9BJ7YWJZE5RRYJJPB2"
  ],
  "origin": "ip-10-100-4-51.eu-west-1.compute.internal",
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "01J9722DG03J23AH84GZQZBBFP"
}

und

Fail to send Webhook mit

{
  "name": "as.webhook.fail",
  "time": "2024-10-02T16:54:10.178620854Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "*****************",
        "application_ids": {
          "application_id": "*******************"
        },
        "dev_eui": "70B3D57ED006AB12",
        "join_eui": "0000000000000000",
        "dev_addr": "260B02FD"
      }
    }
  ],
  "data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
    "namespace": "pkg/applicationserver/io/web/sink",
    "name": "request",
    "message_format": "request",
    "attributes": {
      "status_code": 422,
      "url": "https://ttn.opensensemap.org/v3",
      "webhook_id": "opensensemap-webhook"
    },
    "correlation_id": "77c972417f6e405e99420c701d017e2d",
    "code": 14,
    "details": [
      {
        "@type": "type.googleapis.com/google.protobuf.Struct",
        "value": {
          "body": "{\"code\":422,\"msg\":\"no payload for profile `cayenne-lpp` provided\"}"
        }
      }
    ]
  },
  "correlation_ids": [
    "gs:uplink:01J972EHJ5DP0R4K5TMR6ZJG7D"
  ],
  "origin": "ip-10-100-4-122.eu-west-1.compute.internal",
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "01J972EJ02JHCW690B9G48YBDJ"
}

Soweit ich das richtig verstanden habe, ist das Cayenne LPP-Formati nicht richtig, in der die SenseBox sendet.

Kann mir da jemand weiterhelfen?

Vielen Dank schon einmal.

Volker