Box opening - no video

Can you please share?

https://www.genericnode.com/docs/
To
https://www.genericnode.com/docs/getting-started/
To
https://www.genericnode.com/docs/getting-started/se-hands-on-guide/
To
Long videos.

I am sorry, I have been looking for how to register the node using the links and the QR code and can not find the information.

I followed the Sensor Edition Software Setup to get the device running.

It is early days for the documentation as the firmware is developed, I’ve not seen a “Out the box” setup guide, only the programming guide - which gives much of the information for setup with keys etc.

Thank you @descartes, I will give that a try.

Just try the included examples.
LoRaWAN keys (for relevant examples) are placed in conf/app_conf.h (currently only for OTAA).

1 Like

I also got it up and running with the ST-link V2 and the LoRawan example, I see the messages in the console, anyone has a decoder / payload formatter at hand for the example? otherwise I will have to go thru the code :slight_smile:

If you mean the Basic_LoRaWAN (basic_lorawan) code, you should see some real magic in the device console that is instantly decodable without JavaScript because as far as I know, it just sends AA BB CC:

1 Like

I actually get this payload 4077580B26800C010290A70921631BF0

I think i should use the freefall, but seems it only has temperature and battery level, no example with all sensors?

Which app did you compile for?

Because …

It occurs to me that you are probably seeing the out-the-box demo payload. The free-fall source only sends a count of free-falls, just one unsigned byte. The README.md in the Software folder only talks about dummy payloads.

I don’t think the source for the startup app has been released …

@elsalahy & @cndrxn, could you put the demo app on GitHub please

1 Like

Thx Nick, @elsalahy your video is awesome! I am still struggling with getting all sensor data and sending it, so would really appreciate some demo on that.

1 Like

Can you answer my questions, it’s the only thing that motivates me to answer further questions …

Hi Nick, i typed it and delete it yesterday to avoid being the nagging noob :slight_smile:
so the payload 4077580B26800C010290A70921631BF0 (and 60% changes) is from the basic_lorawan, i am not able to understand where it comes from yet. I did flash/upload using the cube/stlinkv2 and I flashed the basic with LED and it worked. (I can confirm that it was flashed)
I wanted to use the freefall because it gives an example of reading sensor and sending it… and i think i understand it.

Neither am I, I’d best go and find a debugger and step my way through the code.

If asked a question a reply is sort of polite and expected, it’s more the reverse, if you’re being hassled with questions, just say so.

This is new product so we all have things to learn about it!

That is the raw packet as forwarded by the gateway. You need to look at “Uplink Data Message” for the data in the packet. (And that is 0xAA 0xBB 0xCC in my tests)

2 Likes

Thx Jac, you are right, that was “raw message”
I had to activate the javascript formatter first
image
and then the message was shown
image
Thx!
now I need to play around with the sensors

1 Like

There isn’t a JS formatter in the device repository so unless you entered a formatter that would have no effect. All’s that happened here is you’ve looked on the application / device console where the payload is decoded for you.

Have you used the v2 stack much?

Hi Nick, I see, you are right. I am quite familiar with V2, mixed the “payload” and “Raw payload” in V3.

now i’m trying to add read temperature and send over lora

but while debugging, i see the SHT is not initializing, i see there might be a reported issue

will continue next weekend :slight_smile: Unless Nick has a hint

@Baxter @descartes a while back I made a hacky branch to add temperature humidity readings and send them over LoRaWAN. The app name is called "basic_lorawan_th.
This is where all the action happens:
generic-node-se/lora_app.c at feature/basic_lorawan_TH · TheThingsIndustries/generic-node-se (github.com)

static void SendTxData(void)
{
  UTIL_TIMER_Time_t nextTxIn = 0;

  UTIL_TIMER_Create(&TxLedTimer, 0xFFFFFFFFU, UTIL_TIMER_ONESHOT, OnTimerLedEvent, NULL);
  UTIL_TIMER_SetPeriod(&TxLedTimer, 200);
  UTIL_TIMER_Start(&TxLedTimer);


  // User can add any indication here (LED manipulation or Buzzer)
  GNSE_BSP_LED_Toggle(LED_BLUE);
  GNSE_BSP_Sensor_I2C1_Init();

  sensirion_i2c_init(); // placefiller function

  int32_t temperature = 0;
  int32_t humidity = 0;
  int16_t status = 0;
  uint16_t temp_int = 0;
  uint16_t humidity_int = 0;

  if (SHTC3_probe() != SHTC3_STATUS_OK)
  {
      APP_PPRINTF("\r\n Failed to initialize SHTC3 Sensor, entering error state\r\n");
      GNSE_BSP_LED_On(LED_RED);
      while (1)
      {
      }
  }

  status = SHTC3_measure_blocking_read(&temperature, &humidity);
    if (status == SHTC3_STATUS_OK)
    {
        //Remove the division by 1000 to observe the higher resolution
        APP_PPRINTF("\r\n Measured Temperature: %d'C & Relative Humidity: %d \r\n", temperature/100, humidity/100);
    }
    else
    {
        APP_PPRINTF("\r\n Failed to read data from SHTC3 sensor, Error status: %d \r\n", status);
        GNSE_BSP_LED_On(LED_RED);
        while (1)
        {
        }
    }

  temp_int = (uint16_t)((temperature/100)+400); // add offset value for the temp
  humidity_int = (uint16_t)(humidity/100);


  AppData.Port = LORAWAN_APP_PORT;
  AppData.BufferSize = 5;
  AppData.Buffer[0] = (uint8_t)(temp_int >> 8 );       // HI byte
  AppData.Buffer[1] = (uint8_t)(temp_int & 0xFF);      // LO byte
  AppData.Buffer[2] = (uint8_t)(humidity_int >> 8 );   // HI byte 2
  AppData.Buffer[3] = (uint8_t)(humidity_int & 0xFF);  // LO byte 2
  AppData.Buffer[4] = 0xAA; // placeholder


  if (LORAMAC_HANDLER_SUCCESS == LmHandlerSend(&AppData, LORAWAN_DEFAULT_CONFIRMED_MSG_STATE, &nextTxIn, false))
  {
    APP_LOG(TS_ON, VLEVEL_L, "SEND REQUEST\r\n");
  }
  else if (nextTxIn > 0)
  {
    APP_LOG(TS_ON, VLEVEL_L, "Next Tx in  : ~%d second(s)\r\n", (nextTxIn / 1000));
  }
}

And simple payload formatter looked like this:

function decodeUplink(input) {
  var data = {};
  data.temperature = ((input.bytes[0] << 8) + input.bytes[1]-400)/10;
  data.humidity = ((input.bytes[2] << 8) + input.bytes[3])/10;
  return {
    data: data,
  };
}
1 Like

Thanks Orkhan, works like a charm!
Also love the +400 for temperature, helps get along with temps below zero!
image

1 Like