Compile error Arduino Uno WiFi Rev2 with Dragino Lora Shield

Hi, I am using a Dragino LoRa shield v1.4 connected to an Arduino Uno WiFi Rev 2. My aim is to add this node to the Helium network in Adelaide, Australia. The LMIC library version is 4.1.0.

The below is the lmic_project_config file

// project-specific definitions
//#define CFG_eu868 1
//#define CFG_us915 1
#define CFG_au915 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP /* for as923-JP; also define CFG_as923 */
//#define CFG_kr920 1
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS

I have modified the pin mapping section of the helium-otaa.ino sketch as below

// Pin mapping
// We use the built-in mapping – see src/hal/getpinmap_thisboard.cpp
//
// If your board isn’t supported, declare an lmic_pinmap object as static
// or global, and set pPimMap to that pointer.
//
// const lmic_pinmap *pPinMap = Arduino_LMIC::GetPinmap_ThisBoard();
lmic_pinmap lmic_pins = {
.nss = 10,
.rxtx = LMIC_UNUSED_PIN,
.rst = 9,
.dio = {2, 6, 7},
.rxtx_rx_active = 0,
};

const lmic_pinmap *pPinMap = &lmic_pins;


// don't die mysteriously; die noisily.
if (pPinMap == nullptr) {
    pinMode(LED_BUILTIN, OUTPUT);
    for (;;) {
        // flash lights, sleep.
        for (int i = 0; i < 5; ++i) {
            digitalWrite(LED_BUILTIN, 1);
            delay(100);
            digitalWrite(LED_BUILTIN, 0);
            delay(900);
        }
        Serial.println(F("board not known to library; add pinmap or update getconfig_thisboard.cpp"));
    }
}

os_init_ex(pPinMap);

The below is the error messages when compiling.

I would greatly appreciate assistance on how this can be fixed.

It appears that your BSP has changed digitalWrite() to be different than previous versions. Older versions would accept bool because bool could be converted to an int and then to a PinStatus; the new Arduino BSP has apparently changed this. Perhaps you should ask upstream if this was an intended change, as I suspect someone made a change without realizing that it would break many libraries.

You also have to add an explicit pinmap for our board, but that doesn’t matter until the compile problems are fixed. You can work around the change by adding the expliciit conversion (original_exp) ? HIGH : LOW, or whatever the PinStatus value now accepts.

I think I was actually using an older BSP. When I updated to the newest version it compiled without problem. Thank you. I’m successfully able to uplink to the Helium network here in Adelaide.

1 Like