CubeCell Example LoRaWan + BMP0180 work not together

Hallo,

I tried to connect an BMP0180 to a CubeCell and send the data over LoraWan.

The example LoRaWAN worked fine.

The example BMP0180 on GitHub could be compiled.

So i put it together:

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

#include "BMP180.h"
BMP085 bmp;

// TTN-Parameter für ABP und OTAA in comissioning.h in der Library LoRaWan_APP

#ifndef ACTIVE_REGION
#define ACTIVE_REGION LORAMAC_REGION_CN470
#endif

#ifndef CLASS_MODE
#define CLASS_MODE CLASS_A
#endif

DeviceClass_t CLASS=CLASS_MODE;

/*
** * set LoraWan_RGB to 1,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;**
** /*
#ifndef LoraWan_RGB
#define LoraWan_RGB 0
#endif

/ set to 1 the enable AT mode/ set to 0 the disable support AT mode /
#define AT_SUPPORT 1

/*!
** * When set to true the application uses the Over-the-Air activation procedure**
** * When set to false the application uses the Personalization activation procedure**
** /*
bool OVER_THE_AIR_ACTIVATION = true;

/ LoRaWAN Adaptive Data Rate /
bool LORAWAN_ADR_ON = true;

/ Indicates if the node is sending confirmed or unconfirmed messages /
bool IsTxConfirmed = true;

/*!
*** 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 = 8;

/ Application port /
uint8_t AppPort = 2;

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

/ Prepares the payload of the frame /
static void PrepareTxFrame( uint8_t port )
{
** AppDataSize = 4;//AppDataSize max value is 64**
** AppData[0] = 0x00;**
** AppData[1] = 0x01;**
** AppData[2] = 0x02;**
** AppData[3] = 0x03;**
}

void setup() {
** BoardInitMcu();**
** Serial.begin(115200);**
** DeviceState = DEVICE_STATE_INIT;**


}

void loop()
{
** switch( DeviceState )**
** {**
** case DEVICE_STATE_INIT:**
** {**
** Serial.printf(“LoRaWan Class%X test start! \r\n”,CLASS+10); **
#if(AT_SUPPORT)
** Enable_AT();**
** getDevParam();**
#endif
** printDevParam();**
** LoRaWAN.Init(CLASS,ACTIVE_REGION);**
** DeviceState = DEVICE_STATE_JOIN;**
** break;**
** }**
** case DEVICE_STATE_JOIN:**
** {**
** LoRaWAN.Join();**
** break;**
** }**
** case DEVICE_STATE_SEND:**
** {**
** PrepareTxFrame( AppPort );**

** if (!bmp.begin()) {**
** Serial.println(“Could not find a valid BMP180 sensor, check wiring!”);**


** }**
** delay(100); // To let Sensor settle**


Serial.print("Temperature = ");
** Serial.print(bmp.readTemperature());**
** Serial.println(" C");*


** Serial.print(“Pressure = “);**
** Serial.print(bmp.readPressure());**
** Serial.println(” Pa”);**


** // Calculate altitude assuming ‘standard’ barometric**
** // pressure of 1013.25 millibar = 101325 Pascal**
** Serial.print(“Altitude = “);**
** Serial.print(bmp.readAltitude());**
** Serial.println(” meters”);**



** LoRaWAN.Send();**
** DeviceState = DEVICE_STATE_CYCLE;**
** break;**
** }**
** case DEVICE_STATE_CYCLE:**
** {**
** // Schedule next packet transmission**
** TxDutyCycleTime = APP_TX_DUTYCYCLE + 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;**
** }**
** }**
}

But now i got this Errors:

C:\Users\Sch\AppData\Local\Temp\arduino_build_39581/…\arduino_cache_527522\core\core_e767d6445c5824d0225abb8ac71530cc.a(asr_board.c.o): In function `rint’:

C:\Users\Sch\AppData\Local\Arduino15\packages\CubeCell\hardware\CubeCell\0.0.3\cores\asr650x\board\src/asr_board.c:415: multiple definition of `rint’

c:/users/sch/appdata/local/arduino15/packages/cubecell/tools/gcc-arm-none-eabi/8-2019-q3/bin/…/lib/gcc/arm-none-eabi/5.4.1/…/…/…/…/arm-none-eabi/lib/armv6-m\libm.a(lib_a-s_rint.o):s_rint.c:(.text.rint+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Fehler beim Kompilieren für das Board CubeCell-Board.

Arduino IDE 1.8.7 CubeCell Dev-boards 0.0.3

What is the Problem?

Hi yes it does not work! You need to use the raystream version from github as you need to add a modified asr_board to where the board manager loads files.This removes Rint function .The bmp/bme range then work. Heltec need to update board manager to a 0.0.4.

1 Like

All my changes upto yesterday are now in the official HelTec GitHub repository.
Heltec needs to make a new release, 0.0.4 for example.

1 Like

Thank you!:grinning: