Cubecell Board AB01 TTN v3 +EU868 not working with ABP or OTAA

Hi, I bought two Cubecell boards and wanted to use them with TTS (TTN v3). I’ve got a multi-channel RAK Gateway which works perfectly with my Dragino node I bought.
I also have a Heltec ESP32 Lora Board which also works flawlessly with my gateway.

I am in EU868 and am using v1.3.0 of the Cubecell Board config for Arduino.
In TTN I am using v1.0.2 rev B like indicated in other posts.

For my code I am using the bmp280 example file from here https://github.com/HelTecAutomation/CubeCell-Arduino/blob/master/libraries/Sensor_ThirdParty/examples/BMP280/bmp280/bmp280.ino with my added devEUI, appKey…

Using OTAA results in multiple join requests which are accepted like e.g. also described here If there is some data received afterwards its pure luck (sending ever minute for 8h results in like 2 messages received). Using ABP it’s the same problem.
Using the SendReceive Example which only tries to join results in the same behavior.

I tried putting the node right beside the gateway and also some walls away and nothing changes.
I tried also converting to plain basicmac which did not work and for lmic I did not find the right pin mapping.

As far as I see my gateway is configured right, the global_conf matches the one I can download from TTN directly and other devices are successful using it.

I also found some other threads concerning EU868 but all without solutions.
What could be the issue which I did not yet find, anybody else from Europe here with a solution to those problems?

#include "LoRaWan_APP.h"
#include "Arduino.h"
#include <Wire.h>

#include <BMP280.h>

// SHT21 Library
#include <Adafruit_Si7021.h>

/*
 * set LoraWan_RGB to Active,the RGB active in loraWan
 * RGB red means sending;
 * RGB purple means joined done;
 * RGB blue means RxWindow1;
 * RGB yellow means RxWindow2;
 * RGB green means received done;
 */
// TTN OTAA
uint8_t appEui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
uint8_t devEui[] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };
uint8_t appKey[] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };

// TTN ABP
uint8_t nwkSKey[] = {  };
uint8_t appSKey[] = {  };
uint32_t devAddr =  ( uint32_t )0x260XXXX;

/*LoraWan channelsmask, default channels 0-7*/
uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 };
 

/*LoraWan Class*/
DeviceClass_t  loraWanClass = LORAWAN_CLASS;
/*OTAA or ABP*/
bool overTheAirActivation = LORAWAN_NETMODE;
/*ADR enable*/
bool loraWanAdr = LORAWAN_ADR;
/* set LORAWAN_Net_Reserve ON, the node could save the network info to flash, when node reset not need to join again */
bool keepNet = LORAWAN_NET_RESERVE;
/*LoraWan REGION*/
LoRaMacRegion_t loraWanRegion = ACTIVE_REGION;

/* Indicates if the node is sending confirmed or unconfirmed messages */
bool isTxConfirmed = LORAWAN_UPLINKMODE;
/*!
* Number of trials to transmit the frame, if the LoRaMAC layer did not
* receive an acknowledgment. The MAC performs a datarate adaptation,
* according to the LoRaWAN Specification V1.0.2, chapter 18.4, according
* to the following table:
*
* Transmission nb | Data Rate
* ----------------|-----------
* 1 (first)       | DR
* 2               | DR
* 3               | max(DR-1,0)
* 4               | max(DR-1,0)
* 5               | max(DR-2,0)
* 6               | max(DR-2,0)
* 7               | max(DR-3,0)
* 8               | max(DR-3,0)
*
* Note, that if NbTrials is set to 1 or 2, the MAC will not decrease
* the datarate, in case the LoRaMAC layer did not receive an acknowledgment
*/
uint8_t confirmedNbTrials = 1;

/* Application port */
uint8_t appPort = 2;

/*the application data transmission duty cycle.  value in [ms].*/
uint32_t appTxDutyCycle = 15 * 1000;

float Temperature, Humidity, Pressure, lux, co2, tvoc;

BMP280 bmp;
Adafruit_Si7021 sensor = Adafruit_Si7021();


/*!
   \brief   Prepares the payload of the frame
*/

static void PrepareTxFrame( uint8_t port )
{
  pinMode(Vext, OUTPUT);
  digitalWrite(Vext, LOW);
  //delay(500);
  bmp.begin();
  //delay(100);
  //Temperature = bmp.readTemperature();
  //Pressure = bmp.readPressure()/100.0;
  Temperature = sensor.readTemperature();
  Humidity = sensor.readHumidity();
  
  Wire.end();
  digitalWrite(Vext, HIGH);
  
  uint16_t BatteryVoltage = getBatteryVoltage();
  unsigned char *puc;

  puc = (unsigned char *)(&Temperature);
  appDataSize = 26;//AppDataSize max value is 64
  appData[0] = puc[0];
  appData[1] = puc[1];
  appData[2] = puc[2];
  appData[3] = puc[3];

  puc = (unsigned char *)(&Humidity);
  appData[4] = puc[0];
  appData[5] = puc[1];
  appData[6] = puc[2];
  appData[7] = puc[3];

  puc = (unsigned char *)(&Pressure);
  appData[8] = puc[0];
  appData[9] = puc[1];
  appData[10] = puc[2];
  appData[11] = puc[3];

  appData[12] = (uint8_t)(BatteryVoltage >> 8);
  appData[13] = (uint8_t)BatteryVoltage;

  Serial.print("T=");
  Serial.print(Temperature);
  Serial.print("C, RH=");
  Serial.print(Humidity);
  Serial.print(" lx, Pressure=");
  Serial.print(Pressure);
  Serial.print(", BatteryVoltage:");
  Serial.println(BatteryVoltage);
}


void setup() {
  boardInitMcu( );
  Serial.begin(115200);
  deviceState = DEVICE_STATE_INIT;
  //LoRaWAN.ifskipjoin();  // what does this actually do?
}

void loop()
{
  switch ( deviceState )
  {
    case DEVICE_STATE_INIT:
      {
        Serial.printf("LoRaWan Class%X start! \r\n", loraWanClass + 10);
#if(AT_SUPPORT)
        enableAt();
        getDevParam();
#endif
        printDevParam();
        LoRaWAN.init(loraWanClass, loraWanRegion);
        deviceState = DEVICE_STATE_JOIN;
        break;
      }
    case DEVICE_STATE_JOIN:
      {
        LoRaWAN.join();
        break;
      }
    case DEVICE_STATE_SEND:
      {
        PrepareTxFrame( appPort );
        LoRaWAN.send();
        deviceState = DEVICE_STATE_CYCLE;
        break;
      }
    case DEVICE_STATE_CYCLE:
      {
        // Schedule next packet transmission
        txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND );
        LoRaWAN.cycle(txDutyCycleTime);
        deviceState = DEVICE_STATE_SLEEP;
        break;
      }
    case DEVICE_STATE_SLEEP:
      {
        LoRaWAN.sleep();
        break;
      }
    default:
      {
        deviceState = DEVICE_STATE_INIT;
        break;
      }
  }
}

Today I flashed the WASN https://github.com/wasn-eu/CubeCell_Getting_Started Firmware and now I receive messages in TTS.
One side effect, the temperature data from my SHT21 is always -273°.

What has this firmware, what my own firmware does not?

Btw. the wasn firmware is awesome, but I really would like to code my own firmware in the future.

You can try to run the LoRaWAN code separately, without adding the sensor code, and then run the sensor code separately to determine whether the node can communicate with the gateway normally and whether the node can read the sensor data normally.

1 Like

Thanks for the suggestions, that’s what I tried first, but it made no difference.
Even if I use the bmp280 example (adapted all variables to be of the new naming schema…) and I remove there the sensor code, the node will only join after a long time and values are not coming in afterwards very often.

Seems like a frequency problem, but the frequencies are looking fine for EU868?

08:30:43.032 -> LoRaWAN EU868 Class A start!
08:30:43.032 -> 
08:30:43.165 -> joining...TX on freq 868500000 Hz at DR 5
08:30:43.198 -> TX on freq 868500000 Hz at DR 5
08:30:43.264 -> Event : Tx Done
08:30:48.267 -> RX on freq 868500000 Hz at DR 5
08:30:48.300 -> Event : Rx Timeout
08:30:49.294 -> RX on freq 869525000 Hz at DR 0
08:30:49.492 -> Event : Rx Timeout
08:30:50.221 -> TX on freq 868300000 Hz at DR 5
08:30:50.221 -> TX on freq 868300000 Hz at DR 5
08:30:50.287 -> Event : Tx Done
08:30:55.294 -> RX on freq 868300000 Hz at DR 5
08:30:55.328 -> Event : Rx Timeout
08:30:56.323 -> RX on freq 869525000 Hz at DR 0
08:30:56.522 -> Event : Rx Timeout
08:30:57.252 -> TX on freq 868100000 Hz at DR 5
08:30:57.252 -> TX on freq 868100000 Hz at DR 5
08:30:57.318 -> Event : Tx Done
08:31:02.328 -> RX on freq 868100000 Hz at DR 5
08:31:02.362 -> Event : Rx Timeout
08:31:03.356 -> RX on freq 869525000 Hz at DR 0
08:31:03.554 -> Event : Rx Timeout
08:31:04.250 -> TX on freq 868300000 Hz at DR 5
08:31:04.284 -> TX on freq 868300000 Hz at DR 5
08:31:04.350 -> Event : Tx Done
08:31:09.352 -> RX on freq 868300000 Hz at DR 5
08:31:09.386 -> Event : Rx Timeout
08:31:10.380 -> RX on freq 869525000 Hz at DR 0
08:31:10.579 -> Event : Rx Timeout
08:31:11.309 -> TX on freq 868300000 Hz at DR 5
08:31:11.309 -> TX on freq 868300000 Hz at DR 5
08:31:11.408 -> Event : Tx Done
08:31:16.382 -> RX on freq 868300000 Hz at DR 5
08:31:16.415 -> Event : Rx Timeout
08:31:17.443 -> RX on freq 869525000 Hz at DR 0
08:31:17.641 -> Event : Rx Timeout
08:31:18.338 -> TX on freq 868100000 Hz at DR 5
08:31:18.338 -> TX on freq 868100000 Hz at DR 5
08:31:18.437 -> Event : Tx Done
08:31:23.411 -> RX on freq 868100000 Hz at DR 5
08:31:23.445 -> Event : Rx Timeout
08:31:24.472 -> RX on freq 869525000 Hz at DR 0
08:31:24.671 -> Event : Rx Timeout
08:31:25.368 -> TX on freq 868300000 Hz at DR 5
08:31:25.401 -> TX on freq 868300000 Hz at DR 5
08:31:25.467 -> Event : Tx Done
08:31:30.441 -> RX on freq 868300000 Hz at DR 5
08:31:30.474 -> Event : Rx Timeout
08:31:31.502 -> RX on freq 869525000 Hz at DR 0
08:31:31.701 -> Event : Rx Timeout
08:31:32.398 -> TX on freq 868100000 Hz at DR 4
08:31:32.432 -> TX on freq 868100000 Hz at DR 4
08:31:32.587 -> Event : Tx Done
08:31:37.537 -> RX on freq 868100000 Hz at DR 4
08:31:37.570 -> Event : Rx Timeout
08:31:38.598 -> RX on freq 869525000 Hz at DR 0
08:31:38.797 -> Event : Rx Timeout
08:31:45.428 -> TX on freq 868300000 Hz at DR 5
08:31:45.461 -> TX on freq 868300000 Hz at DR 5
08:31:45.527 -> Event : Tx Done
08:31:50.534 -> RX on freq 868300000 Hz at DR 5
08:31:50.534 -> Event : Rx Timeout
08:31:51.561 -> RX on freq 869525000 Hz at DR 0
08:31:51.760 -> Event : Rx Timeout
08:31:52.455 -> TX on freq 868300000 Hz at DR 5
08:31:52.488 -> TX on freq 868300000 Hz at DR 5
08:31:52.555 -> Event : Tx Done
08:31:57.563 -> RX on freq 868300000 Hz at DR 5
08:31:57.563 -> Event : Rx Timeout
08:31:58.591 -> RX on freq 869525000 Hz at DR 0
08:31:58.789 -> Event : Rx Timeout
08:31:59.485 -> TX on freq 868300000 Hz at DR 5
08:31:59.518 -> TX on freq 868300000 Hz at DR 5
08:31:59.585 -> Event : Tx Done
08:32:04.589 -> RX on freq 868300000 Hz at DR 5
08:32:04.643 -> Event : Rx Timeout
08:32:05.618 -> RX on freq 869525000 Hz at DR 0
08:32:05.976 -> Event : Rx Timeout
08:32:06.513 -> TX on freq 868100000 Hz at DR 5
08:32:06.546 -> TX on freq 868100000 Hz at DR 5
08:32:06.612 -> Event : Tx Done
08:32:11.620 -> RX on freq 868100000 Hz at DR 5
08:32:11.653 -> Event : Rx Timeout
08:32:12.647 -> RX on freq 869525000 Hz at DR 0
08:32:12.846 -> Event : Rx Timeout
08:32:13.543 -> TX on freq 868500000 Hz at DR 5
08:32:13.576 -> TX on freq 868500000 Hz at DR 5
08:32:13.642 -> Event : Tx Done
08:32:18.651 -> RX on freq 868500000 Hz at DR 5
08:32:18.746 -> Event : Rx Timeout
08:32:19.679 -> RX on freq 869525000 Hz at DR 0
08:32:19.877 -> Event : Rx Timeout
08:32:20.574 -> TX on freq 868500000 Hz at DR 5
08:32:20.607 -> TX on freq 868500000 Hz at DR 5
08:32:20.673 -> Event : Tx Done
08:32:25.714 -> RX on freq 868500000 Hz at DR 5
08:32:25.714 -> Event : Rx Timeout
08:32:26.704 -> RX on freq 869525000 Hz at DR 0
08:32:26.902 -> Event : Rx Timeout
08:32:27.631 -> TX on freq 868500000 Hz at DR 5
08:32:27.631 -> TX on freq 868500000 Hz at DR 5
08:32:27.730 -> Event : Tx Done
08:32:32.699 -> RX on freq 868500000 Hz at DR 5
08:32:32.806 -> Event : Rx Timeout
08:32:33.739 -> RX on freq 869525000 Hz at DR 0
08:32:33.938 -> Event : Rx Timeout
08:32:34.666 -> TX on freq 868300000 Hz at DR 3
08:32:34.699 -> TX on freq 868300000 Hz at DR 3
08:32:34.931 -> Event : Tx Done
08:32:39.941 -> RX on freq 868300000 Hz at DR 3
08:32:39.974 -> Event : Rx Timeout
08:32:40.970 -> RX on freq 869525000 Hz at DR 0
08:32:41.169 -> Event : Rx Timeout
08:32:58.613 -> TX on freq 868500000 Hz at DR 5
08:32:58.613 -> TX on freq 868500000 Hz at DR 5
08:32:58.712 -> Event : Tx Done
08:33:03.684 -> RX on freq 868500000 Hz at DR 5
08:33:03.806 -> Event : Rx Timeout
08:33:04.743 -> RX on freq 869525000 Hz at DR 0
08:33:04.942 -> Event : Rx Timeout
08:33:05.637 -> TX on freq 868300000 Hz at DR 5
08:33:05.670 -> TX on freq 868300000 Hz at DR 5
08:33:05.737 -> Event : Tx Done
08:33:10.709 -> RX on freq 868300000 Hz at DR 5
08:33:10.743 -> Event : Rx Timeout
08:33:11.771 -> RX on freq 869525000 Hz at DR 0
08:33:11.970 -> Event : Rx Timeout
08:33:12.667 -> TX on freq 868300000 Hz at DR 5
08:33:12.700 -> TX on freq 868300000 Hz at DR 5
08:33:12.766 -> Event : Tx Done
08:33:17.744 -> RX on freq 868300000 Hz at DR 5
08:33:17.835 -> Event : Rx Timeout
08:33:18.806 -> RX on freq 869525000 Hz at DR 0
08:33:19.005 -> Event : Rx Timeout
08:33:19.701 -> TX on freq 868500000 Hz at DR 5
08:33:19.734 -> TX on freq 868500000 Hz at DR 5
08:33:19.801 -> Event : Tx Done
08:33:24.773 -> RX on freq 868500000 Hz at DR 5
08:33:24.806 -> Event : Rx Timeout
08:33:25.834 -> RX on freq 869525000 Hz at DR 0
08:33:26.033 -> Event : Rx Timeout
08:33:26.729 -> TX on freq 868100000 Hz at DR 5
08:33:26.763 -> TX on freq 868100000 Hz at DR 5
08:33:26.829 -> Event : Tx Done
08:33:31.804 -> RX on freq 868100000 Hz at DR 5
08:33:31.837 -> Event : Rx Timeout
08:33:32.865 -> RX on freq 869525000 Hz at DR 0
08:33:33.064 -> Event : Rx Timeout
08:33:33.760 -> TX on freq 868100000 Hz at DR 5
08:33:33.793 -> TX on freq 868100000 Hz at DR 5
08:33:33.859 -> Event : Tx Done
08:33:38.830 -> RX on freq 868100000 Hz at DR 5
08:33:38.863 -> Event : Rx Timeout
08:33:39.891 -> RX on freq 869525000 Hz at DR 0
08:33:40.090 -> Event : Rx Timeout
08:33:40.785 -> TX on freq 868100000 Hz at DR 5
08:33:40.818 -> TX on freq 868100000 Hz at DR 5
08:33:40.884 -> Event : Tx Done
08:33:45.891 -> RX on freq 868100000 Hz at DR 5
08:33:45.891 -> Event : Rx Timeout
08:33:46.920 -> RX on freq 869525000 Hz at DR 0
08:33:47.118 -> Event : Rx Timeout
08:33:47.815 -> TX on freq 868500000 Hz at DR 2
08:33:47.915 -> TX on freq 868500000 Hz at DR 2
08:33:48.347 -> Event : Tx Done
08:33:53.351 -> RX on freq 868500000 Hz at DR 2
08:33:53.417 -> Event : Rx Timeout
08:33:54.379 -> RX on freq 869525000 Hz at DR 0
08:33:54.578 -> Event : Rx Timeout
08:34:31.617 -> TX on freq 868100000 Hz at DR 5
08:34:31.650 -> TX on freq 868100000 Hz at DR 5
08:34:31.717 -> Event : Tx Done
08:34:36.689 -> RX on freq 868100000 Hz at DR 5
08:34:36.722 -> Event : Rx Timeout
08:34:37.750 -> RX on freq 869525000 Hz at DR 0
08:34:37.950 -> Event : Rx Timeout
08:34:38.646 -> TX on freq 868100000 Hz at DR 5
08:34:38.679 -> TX on freq 868100000 Hz at DR 5
08:34:38.745 -> Event : Tx Done
08:34:43.750 -> RX on freq 868100000 Hz at DR 5
08:34:43.750 -> Event : Rx Timeout
08:34:44.777 -> RX on freq 869525000 Hz at DR 0
08:34:44.976 -> Event : Rx Timeout
08:34:45.673 -> TX on freq 868100000 Hz at DR 5
08:34:45.706 -> TX on freq 868100000 Hz at DR 5
08:34:45.772 -> Event : Tx Done
08:34:50.778 -> RX on freq 868100000 Hz at DR 5
08:34:50.778 -> Event : Rx Timeout
08:34:51.805 -> RX on freq 869525000 Hz at DR 0
08:34:52.004 -> Event : Rx Timeout
08:34:52.700 -> TX on freq 868100000 Hz at DR 5
08:34:52.733 -> TX on freq 868100000 Hz at DR 5
08:34:52.799 -> Event : Tx Done
08:34:57.811 -> RX on freq 868100000 Hz at DR 5
08:34:57.811 -> Event : Rx Timeout
08:34:58.839 -> RX on freq 869525000 Hz at DR 0
08:34:59.038 -> Event : Rx Timeout
08:34:59.734 -> TX on freq 868300000 Hz at DR 5
08:34:59.767 -> TX on freq 868300000 Hz at DR 5
08:34:59.834 -> Event : Tx Done
08:35:04.837 -> RX on freq 868300000 Hz at DR 5
08:35:04.837 -> Event : Rx Timeout
08:35:05.865 -> RX on freq 869525000 Hz at DR 0
08:35:06.064 -> Event : Rx Timeout
08:35:06.760 -> TX on freq 868500000 Hz at DR 5
08:35:06.793 -> TX on freq 868500000 Hz at DR 5
08:35:06.860 -> Event : Tx Done

Did you create the node in TTS? You confirm whether your node corresponds to the channel of the gateway.

Sure, I created the node and at some point it will successfully join.
The channels in my gateway are the same as generated by TTNv3, all other LoRaWAN Devices with LMIC or Dragino are working perfectly.

My Gateway + WASN-Cubecell is working fine, but as WASN is closed source I don’t know what was configured there, the only thing I get from this is, that my hardware is working fine.
From the logs I would say that the frequencies are right and the waiting periods for RX are also within reason (5s for TTNv3). But I really can’t figure out what could be wrong. I tried multiple example codes and everything with #include “LoRaWan_APP.h” seems to behave like this for me. I am using v1.3.0 of Cubecell-arduino.

I created a new node in TTS using the default configuration in the LoRaWAN code, and it can communicate successfully. The server address is lora.heltec.org, you can download the default LoRaWAN code to try to communicate.

My Gateway is set to eu1.cloud.thethings.network, did you ever try with the “official” Community Server?

As my other devices are already on TTN, I would not want to change my network. Seems like there is something configured differently between the stacks, seems like I have to investigate in the library file, which parameters could be the problem…

I tested eu1.cloud.thethings.network and it can communicate normally. I use DevEui: 2232330000888809

Did you use the code I pasted here, or could you share your code?

I used the basic LoRaWAN (https://github.com/HelTecAutomation/CubeCell-Arduino/blob/master/libraries/LoRa/examples/LoRaWAN/LoRaWan/LoRaWan.ino) code, and modified DevEui to 2232330000888809 on this basis. I have created this DevEui in TTS, you can try to use this DevEui.

Thanks, unfortunately the behavior the the same as before.
Are you in EU868?

According to the logged frequencies, there are no problems, I had a look into the other devices I have and they are using all the same channels as indicted in the logs.

I think if have to have a look into what frequency the Cubecell is using in reality. I know it works on 868, because of the WASN Firmware, but seems that the current firmware is only thinking it sends on 868, but in reality it is some channels off? (Thats my only explanation currently.)

Yes, it is EU868. If your CubeCell hardware is okay, then there may be a problem with your development environment. You can try to get the latest development environment through Git.

Thank you so much for your help, I did not yet think of this possibility.
Unfortunately nothing changed. I am running Debian (Linux) but installing (and selecting) the Git version did not change a thing. Additionally I tried with a Windows machine and there the same behavior shows.

This is the exact version of my code (I only changed the OTAA params).

#include "LoRaWan_APP.h"
#include "Arduino.h"

/*
 * set LoraWan_RGB to Active,the RGB active in loraWan
 * RGB red means sending;
 * RGB purple means joined done;
 * RGB blue means RxWindow1;
 * RGB yellow means RxWindow2;
 * RGB green means received done;
 */

/* OTAA para*/
uint8_t devEui[] = { 0x22, 0x32, 0x33, 0x00, 0x00, 0x88, 0x88, 0x08 };
uint8_t appEui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
uint8_t appKey[] = { 0xD7, 0x2C, 0x78, 0x75, 0x8C, 0xDC, 0xCA, 0xBF, 0x55, 0xEE, 0x4A, 0x77, 0x8D, 0x16, 0xEF, 0x67 };

/* ABP para*/
uint8_t nwkSKey[] = { 0x15, 0xb1, 0xd0, 0xef, 0xa4, 0x63, 0xdf, 0xbe, 0x3d, 0x11, 0x18, 0x1e, 0x1e, 0xc7, 0xda,0x85 };
uint8_t appSKey[] = { 0xd7, 0x2c, 0x78, 0x75, 0x8c, 0xdc, 0xca, 0xbf, 0x55, 0xee, 0x4a, 0x77, 0x8d, 0x16, 0xef,0x67 };
uint32_t devAddr =  ( uint32_t )0x007e6ae1;

/*LoraWan channelsmask, default channels 0-7*/ 
uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 };

/*LoraWan region, select in arduino IDE tools*/
LoRaMacRegion_t loraWanRegion = ACTIVE_REGION;

/*LoraWan Class, Class A and Class C are supported*/
DeviceClass_t  loraWanClass = LORAWAN_CLASS;

/*the application data transmission duty cycle.  value in [ms].*/
uint32_t appTxDutyCycle = 15000;

/*OTAA or ABP*/
bool overTheAirActivation = LORAWAN_NETMODE;

/*ADR enable*/
bool loraWanAdr = LORAWAN_ADR;

/* set LORAWAN_Net_Reserve ON, the node could save the network info to flash, when node reset not need to join again */
bool keepNet = LORAWAN_NET_RESERVE;

/* Indicates if the node is sending confirmed or unconfirmed messages */
bool isTxConfirmed = LORAWAN_UPLINKMODE;

/* Application port */
uint8_t appPort = 2;
/*!
* Number of trials to transmit the frame, if the LoRaMAC layer did not
* receive an acknowledgment. The MAC performs a datarate adaptation,
* according to the LoRaWAN Specification V1.0.2, chapter 18.4, according
* to the following table:
*
* Transmission nb | Data Rate
* ----------------|-----------
* 1 (first)       | DR
* 2               | DR
* 3               | max(DR-1,0)
* 4               | max(DR-1,0)
* 5               | max(DR-2,0)
* 6               | max(DR-2,0)
* 7               | max(DR-3,0)
* 8               | max(DR-3,0)
*
* Note, that if NbTrials is set to 1 or 2, the MAC will not decrease
* the datarate, in case the LoRaMAC layer did not receive an acknowledgment
*/
uint8_t confirmedNbTrials = 4;

/* Prepares the payload of the frame */
static void prepareTxFrame( uint8_t port )
{
  /*appData size is LORAWAN_APP_DATA_MAX_SIZE which is defined in "commissioning.h".
  *appDataSize max value is LORAWAN_APP_DATA_MAX_SIZE.
  *if enabled AT, don't modify LORAWAN_APP_DATA_MAX_SIZE, it may cause system hanging or failure.
  *if disabled AT, LORAWAN_APP_DATA_MAX_SIZE can be modified, the max value is reference to lorawan region and SF.
  *for example, if use REGION_CN470, 
  *the max value for different DR can be found in MaxPayloadOfDatarateCN470 refer to DataratesCN470 and BandwidthsCN470 in "RegionCN470.h".
  */
    appDataSize = 4;
    appData[0] = 0x00;
    appData[1] = 0x01;
    appData[2] = 0x02;
    appData[3] = 0x03;
}


void setup() {
  Serial.begin(115200);
#if(AT_SUPPORT)
  enableAt();
#endif
  deviceState = DEVICE_STATE_INIT;
  LoRaWAN.ifskipjoin();
}

void loop()
{
  switch( deviceState )
  {
    case DEVICE_STATE_INIT:
    {
#if(LORAWAN_DEVEUI_AUTO)
      LoRaWAN.generateDeveuiByChipID();
#endif
#if(AT_SUPPORT)
      getDevParam();
#endif
      printDevParam();
      LoRaWAN.init(loraWanClass,loraWanRegion);
      deviceState = DEVICE_STATE_JOIN;
      break;
    }
    case DEVICE_STATE_JOIN:
    {
      LoRaWAN.join();
      break;
    }
    case DEVICE_STATE_SEND:
    {
      prepareTxFrame( appPort );
      LoRaWAN.send();
      deviceState = DEVICE_STATE_CYCLE;
      break;
    }
    case DEVICE_STATE_CYCLE:
    {
      // Schedule next packet transmission
      txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND );
      LoRaWAN.cycle(txDutyCycleTime);
      deviceState = DEVICE_STATE_SLEEP;
      break;
    }
    case DEVICE_STATE_SLEEP:
    {
      LoRaWAN.sleep();
      break;
    }
    default:
    {
      deviceState = DEVICE_STATE_INIT;
      break;
    }
  }
}

Hi, I’d like to join this discussion, I have exactly the same problem. My board is a HTCC-AB01 at 868MHz.

I first have done some power tests (very nice with 10uA deep sleep current), I have also had success talking with an I2C sensor, but when I tried to send the data I get only maybe 1 Join out of 50, having the gateway in the same room.

I can connect to the gateway and send data without problems with another device from PyCom, using the same deveui and appkey and also with the same antenna that came with the CubeCell, so the problem is really the CubeCell device (or the software).

I have tried the examples LoRa/LoRaWan/LoraWan and LoraWanMinimal/SendReceive that come with the library, the result is the same.

I have checked the radio signals with a SDR and apparently they are emitted in the correct frequency range, hopping around 868 MHz. The waterfalls looks like it should (the typical zigzag form), so the device emits but something is going wrong.

Any working example out there? Any other hints?

1 Like

I’d also like to add my “+1” to this issue with the HTCC-AB02S at 686MHz. Initially I had no issues connecting to TTN v3 but in the last few days only after multiple (sometimes 100s of) attempts will the board join the network.

I am using the same DEVEUI etc as when it previously worked and can see the uplink messages and downlink messages (the join accept) in TTN.

Dear Heltec,

there is not a lot of support from your side to help your clients :frowning: This problem has been documented in a detailed manner by @conrad784, but no suggestions or solutions whatsoever. I have exactly the same problem so it is not an isolated case. Do we have received a bad device or is your software not ready yet?

Kind regards.

HI, i think i’m running the same issue.

im using lorawan_oled code and i have same output of @conrad784

the strange thing is that if i use the cubecell app and i set my devEui, appEui, appKey it connect perfectly.

do you have any idea?

AT Rev 1.3
+AutoLPM=1

+LORAWAN=1

+KeepNet=0
+OTAA=1
+Class=A
+ADR=0
+IsTxConfirmed=0
+AppPort=2
+DutyCycle=15000
+ConfirmedNbTrials=4
+ChMask=00000000000000000000FF00
+DevEui=70B3D57ED0045E97(For OTAA Mode)
+AppEui=0A0B000000000001(For OTAA Mode)
+AppKey=6ED2A7349004F5449042BADED2BC0DFA(For OTAA Mode)
+NwkSKey=15B1D0EFA463DFBE3D11181E1EC7DA85(For ABP Mode)
+AppSKey=D72C78758CDCCABF55EE4A778D16EF67(For ABP Mode)
+DevAddr=007E6AE1(For ABP Mode)


LoRaWAN EU868 Class A start!

joining...TX on freq 868300000 Hz at DR 4
TX on freq 868300000 Hz at DR 4
Event : Tx Done
RX on freq 868300000 Hz at DR 4
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868100000 Hz at DR 5
TX on freq 868100000 Hz at DR 5
Event : Tx Done
RX on freq 868100000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868500000 Hz at DR 5
TX on freq 868500000 Hz at DR 5
Event : Tx Done
RX on freq 868500000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868500000 Hz at DR 5
TX on freq 868500000 Hz at DR 5
Event : Tx Done
RX on freq 868500000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868500000 Hz at DR 5
TX on freq 868500000 Hz at DR 5
Event : Tx Done
RX on freq 868500000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868500000 Hz at DR 4
TX on freq 868500000 Hz at DR 4
Event : Tx Done
RX on freq 868500000 Hz at DR 4
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868500000 Hz at DR 5
TX on freq 868500000 Hz at DR 5
Event : Tx Done
RX on freq 868500000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868100000 Hz at DR 5
TX on freq 868100000 Hz at DR 5
Event : Tx Done
RX on freq 868100000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868100000 Hz at DR 5
TX on freq 868100000 Hz at DR 5
Event : Tx Done
RX on freq 868100000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 3
TX on freq 868300000 Hz at DR 3
Event : Tx Done
RX on freq 868300000 Hz at DR 3
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868300000 Hz at DR 5
TX on freq 868300000 Hz at DR 5
Event : Tx Done
RX on freq 868300000 Hz at DR 5
Event : Rx Timeout
RX on freq 869525000 Hz at DR 0
Event : Rx Timeout
TX on freq 868100000 Hz at DR 5
TX on freq 868100000 Hz at DR 5
Event : Tx Done

Did you check the gateway log when this issue occurred? Did the gateway have normal uplink and downlink?

gateway is connected correctly but i didn’t see anything on logs (exept ack log) when i tried with wasn app it worked.

If i try with AT commands i receive ok, but when i reset it always show me JOINING with same logs

here you can see my global_conf.json https://pastebin.com/LwpM9tyS

this is the configuration of my end device