Wisen Whisper Node LoRa TTN working example

I got whisper node working for US915 … I did solder jumpers JP15 and JP16 for DIO1 (A2) and DIO2 (A3).

Use this LMIC library… it fits in the atmega 328 memory.

  1. open lmic/config.h and make sure your region and radio is properly selected. CFG_us915 for me and CFG_sx1276_radio

  2. Use the ttn-otaa sketch (make sure to register your application in TTN on the server as your gateway (us west for me)

  3. When you are updating your keys in the sketch you must hit the reverse button to get your app eui and dev eui in lsb format. THIS is because it is an avr board

  4. Pin mapping should look like this

// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 10,
.rxtx = LMIC_UNUSED_PIN,
.rst = 7,
.dio = {2, A2, A3},
};

  1. Change/add some options in the setup() section

LMIC_reset();
LMIC_setLinkCheckMode(1);
LMIC_setDrTxpow(DR_SF7,14);
LMIC_selectSubBand(1);
LMIC_setAdrMode(1);

  1. Modify sketch for low power

    //add these lines near the top of the sketch
    #include <T2WhisperNode.h>
    #include <LowPower.h>
    T2Flash myFlash;

    //replace the os_setTimedCallback line with this
    //os_setTimedCallback(&sendjob, os_getTime() + sec2osticks(TX_INTERVAL), do_send);
    for (int i=0; i<int(TX_INTERVAL/8); i++) {
    // Use library from https://github.com/rocketscream/Low-Power
    Serial.println(F(“looping”));
    Serial.flush();
    LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
    }
    do_send(&sendjob);

    //Add these lines in the void setup() section
    // Flash - We’re not using, so just power it down to save energy
    myFlash.init(T2_WPN_FLASH_SPI_CS);
    myFlash.powerDown();