Hello World

Hi,

i have a problem with my first Hello World application. Cant see anything in traffic.

I have already created my own ESP-1ch-Gateway-v5.0
Gate status says connected. I can see it as blue on ttn map.

image

Now i am trying with the node but i get this in my serial monitor:
image

It says Status “never seen”.
I rechecked multiple times all keys and i recreated new application.
image

Any suggestion?

what node ?

can you show the console and application where that node is (trying) to join the network ?

nano rfm95
using nano-lmic-v1.51-F.ino example

it is empty app data …
image

not sure what exactly u wanna see?

  • reset frame counters
  • leave application data window permanent open
  • restart node
  • take screenshot

if the node is OTAA you should see it in the application window trying to join

I believe he’s using ABP from one of the earlier photos, which at least removes the possibility of copying in DevEUI as MSBF instead of LSBF. With that said without knowing if the Dev Address and Nwk and App Keys are in fact actually correct and in the correct format for the code he’s using it’s a little bit of a hit or miss.

@mojnetwork What channel is your Single Channel gateway listening on? Just because the node says it’s successfully sent the packet on Channel 0, 1, and 2 doesn’t actually mean it was received by your gateway.

i need to check it … it will take some time

My Gate Settings.

image

I used Isb format.

image

I have also:
“reset frame counters
leave application data window permanent open
restart node”

If you are using ABP the Device and App EUI does not matter (also helpful to just comment it out) in your code which is why I referred to the LSB vs MSB issue before. Also If you are using LSB for your Device address and your Network and Session keys there is a problem as the LMIC code you are using as far I know and most implementations are MSB for those instances. If you want to use OTAA and are testing that you need to set your device as such and then you can worry about the LSB vs MSB issue with the EUI’s.

@mojnetwork

Just a note, the code you are using for the node the Nano LMIC library is set to use SF7 by default and your gateway is looking at SF9.

1 Like

image

:slight_smile: i got my first msg

  1. i changed sf9 to sf7,
  2. Device:
    ABP
    Device EUI Isb
    Application EUI Isb
    Device Address msb
    Network Session Key msb
    App Session Key msb

I would like to test also OTTA version not sure if i just comment somestuff(NwkSkey, AppSkey, DevAddr) in the code?
OTTA Device overview has 3 keys Device EUI, Application EUI and App Key(this one is missing in code)… is there any example of the code for OTTA?

Good to hear, if you want to use OTAA you will have to use a different code which there are plenty of examples around the internet (like this one: arduino-lmic/examples/ttn-otaa/ttn-otaa.ino at master · matthijskooijman/arduino-lmic · GitHub).

So i am trying with this OTA code(link u provided): matthijskooijman/arduino-lmic

Gateway
image

Device Data
image
image

Arduino Serial Monitor:
image

Is this ok? I mean Device App Data status is orange “activation”?
And here it hangs …i am not getting any data.
I suppose code should be sending “hello world” msg in intervals(it is not doing that).

It could be that your node is not getting the downlink so it’s just sitting there waiting for a response.

I see that Gateway gets some DL packages…
image

i also added this line after LMIC_reset();

LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);

Problem is that i get compile error with this new line: ‘MAX_CLOCK_ERROR’ was not declared in this scope

Can you add LMIC_setLinkCheckMode(1); after LMIC_reset();?

As for your compiler error, are you sure everything is typed and indented properly as well? The not declared in this scope issue tends to be something simple like missing an underscore or having a line somewhere where the compiler is not expecting it.

i have added LMIC_setLinkCheckMode(1); but it doesnt work.
I just dont get download Pkgs in Node but i see download Pkgs in gateway console.

I have checked once again gateway settings and can someone confirm if this is ok for 1 channel.

Gateway:
ESP-sc-gway.h
SF9
channel = 0
#define _CAD 1
#define _STRICT_1CH 1

Node OTA:
// Pin mapping
lmic_pinmap pins = {
.nss = 10,
.rxtx = 0,
.rst = 0,
.dio = {4, 5, 7}, (dio0,dio1, dio2)
};

int channel = 0;
int dr = DR_SF9;

void forceTxSingleChannelDr() {
for(int i=0; i<9; i++) { // For EU; for US use i<71
if(i != channel) {
LMIC_disableChannel(i);
}
}
// Set data rate (SF) and transmit power for uplink
LMIC_setDrTxpow(dr, 14);
}

and than setup …

os_init();
LMIC_reset();
// Force Single Channel
forceTxSingleChannelDr();
LMIC_setLinkCheckMode(1);

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

What else can i try …

I can see i my Gate Traffic that simulated download package has been sent.

image

I have received this package in my Gateway
image

I did not get any notification from my Node in my serial monitor.
It did not trigger this(“if(LMIC.dataLen)”):

case EV_TXCOMPLETE:
      // use this event to keep track of actual transmissions
      Serial.print("EV_TXCOMPLETE, time: ");
      Serial.println(millis() / 1000);
      if(LMIC.dataLen) { // data received in rx slot after tx
          //debug_buf(LMIC.frame+LMIC.dataBeg, LMIC.dataLen);
            // data received in rx slot after tx
          Serial.print(F("Received "));
          Serial.print(LMIC.dataLen);`Preformatted text`

image

Sorry for not replying earlier, I’ve been kind of busy these last few days. I’ll have to look over your stuff some more.