TheThingsArchive / ttn

The Things Network Stack V2
https://www.thethingsnetwork.org
MIT License
460 stars 279 forks source link

TTN MQTT broker appears to be broken. #732

Closed whmountains closed 3 years ago

whmountains commented 6 years ago

This is a bug report for the backend.

Tl;Dr: I'm unable to view uplink or send downlink packets from the web console, ttnctl, or the Node.js SDK. The last-seen counter is working, but only updates when I refresh the page, leading me to believe that there is a problem with the part of the TTN stack that sends out live data. My best guess is the MQTT broker.

What do you want to do?

I want to send downlink and receive uplink data from the console and Node.js SDK.

What steps did you take?

I also tried viewing packets via

What went wrong or what is missing?

No packets are visible, though the logs from my LoRa gateway show that it's successfully forwarding packets. The last-seen field only updates when I refresh the page. (e.g. right now it's at 6 minutes, but when I reload it will jump back to 2 seconds and count down from there.)

I also tried the ttn cli but nothing shows there either. I can even manually schedule a downlink from the TTN console but still nothing shows up on the data view.

It was working fine earlier, then suddenly stopped. What I did just before it stopped:

Do you have Screenshots?

Sure do!

Status & Frame Counters

After leaving the page open for 8 minutes: screen shot 2018-07-26 at 8 32 41 am

After a reload: screen shot 2018-07-26 at 8 33 48 am

Data view

For a specific device: screen shot 2018-07-26 at 8 34 42 am

For the entire application: screen shot 2018-07-26 at 8 35 38 am

For the gateway: screen shot 2018-07-26 at 8 36 22 am

What my gateway shows:

screen shot 2018-07-26 at 8 38 03 am screen shot 2018-07-26 at 8 37 41 am screen shot 2018-07-26 at 8 38 57 am

Serial output from my device:

screen shot 2018-07-26 at 8 44 25 am

What kind of OS/Browser/Gateway are you using? Which version?

LoRa Module: Murata CMWX1ZZABZ-078 Dev Board: Tlera Grasshopper Gateway: Laird Sentrius RG191 My computer: MacOS 10.13.5 Browser: Firefox 63, but I also tried Chromium 61, the ttn cli, and the Node.js SDK with identical results.

What are the IDs and EUIs of your Device/Gateway? (if applicable)

Gateway ID: au-test-1 Device ID: au-aio-valves-revc-1 Device EUI: 000964CE3AE1AF8E

What do your configuration files look like?

Gateway Configuration screen shot 2018-07-26 at 8 48 03 am screen shot 2018-07-26 at 8 48 24 am

The keys are blanked out, of course, but I double-checked them.

Device Configuration

This is the exact code I'm using: (with the appKey removed, of course)

#include "LoRaWAN.h"

const char *appEui  = "70B3D57ED0010D89";
const char *appKey  = "REDACTED";
const char *devEui  = "000964CE3AE1AF8E";

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

    LoRaWAN.begin(US915);

    LoRaWAN.setSubBand(2);
    LoRaWAN.joinOTAA(appEui, appKey, devEui);

    Serial.println("JOIN( )");
}

void loop( void )
{
    if (LoRaWAN.joined() && !LoRaWAN.busy())
    {
        Serial.print("TRANSMIT( ");
        Serial.print("TimeOnAir: ");
        Serial.print(LoRaWAN.getTimeOnAir());
        Serial.print(", NextTxTime: ");
        Serial.print(LoRaWAN.getNextTxTime());
        Serial.print(", MaxPayloadSize: ");
        Serial.print(LoRaWAN.getMaxPayloadSize());
        Serial.print(", DR: ");
        Serial.print(LoRaWAN.getDataRate());
        Serial.print(", TxPower: ");
        Serial.print(LoRaWAN.getTxPower(), 1);
        Serial.print("dbm, UpLinkCounter: ");
        Serial.print(LoRaWAN.getUpLinkCounter());
        Serial.print(", DownLinkCounter: ");
        Serial.print(LoRaWAN.getDownLinkCounter());
        Serial.println(" )");

        LoRaWAN.beginPacket();
        LoRaWAN.write(0xef);
        LoRaWAN.write(0xbe);
        LoRaWAN.write(0xad);
        LoRaWAN.write(0xde);
        LoRaWAN.endPacket();
    }

    delay(1000);
}

What do your log files look like?

See the screenshots.

Can you fix this yourself and submit a pull request?

Probably not.

htdvisser commented 3 years ago

This is not going to get fixed in V2. The Things Stack (V3) should not have this problem.