Adafruit INA219

I am attempting to migrate my working project from the Particle IDE to Particle Workbench. When I try to compile the code in Workbench, I get an error that the Adafruit INA219 library cannot be found.

I have attempted to review the Particle documents on how to correct this problem. When I use the Workbench Particle:Find Library and Particle:Install Library, the compiler complains that the library cannot be found.

What am I missing?? I have wasted a day on this problem.

Thanks!!

Try this in VSC code:

#include "Adafruit_INA219_.h"

and in Particle Workbench try finding the library using the command: “Particle: Find Libraries”
with “Adafruit_INA219_” as the name parameter to search for this specific library.

You can also search the libraries using CLI. Here is a search command I tried and its output:

particle library search 219
> Found 4 libraries matching 219
adafruit-ina219 0.0.1 48905 This is a library for the Adafruit INA219 breakout board - modified for use with Particle Photon
ledmatrix-max7219-max7221 0.0.10 13383 Library for control 8x8 LED matrices using MAX7219 / MAX7221. Uses Adafruit GFX library.
LedControl-MAX7219-MAX7221 0.0.10 11522 Port of Eberhard Fahle's LedControl library for controlling the MAX7219/MAX7221 for the Spark Core.
Adafruit_INA219_ 1.0.1 2944 This is a library for the Adafruit INA219 breakout board - modified for use with Particle(2021)
1 Like

This the the response I receive when I do as you suggested??

Thanks!!

PS C:\Users\BernardParticle\Particle\Particle_Cell_Setup\Particle_State_Machine> particle library search Adafruit_INA219_
HTTP error 401 from https://api.particle.io/v1/libraries?filter=Adafruit_INA219_ - The access token provided is invalid.
PS C:\Users\BernardParticle\Particle\Particle_Cell_Setup\Particle_State_Machine>

Did you find the library in Workbench?

You will need to be logged in when using VSC. Once you do that then you might be able to use CLI without an access token error.

reinforcing what Rob mentions above, you need to log in from the VS code command palette:

Best

1 Like

Here is another way to search the Particle libraries. When using Google Chrome as browser and logged into console, I was able to do a library search at this link in the reference docs:

https://docs.particle.io/reference/device-os/libraries/search/

I input this string

*219*

with asterisks as wildcards. I also checked the box for “Show search tips”. The output was similar to using CLI.

I don’t know why there is an underscore at the end of the library name. It is easy to miss this character in the output displayed because the entire library name is underlined. I happened to need this library about a year ago.

1 Like

Thanks for the info.

I logged in and managed to get the library installed. When I compile the code for debugging, there are many errors related to the INA219, errors that I cannot understand.

The error are lengthy to paste here. Suggestions on how to get an interpretation of the errors.

Your help is gratefully appreciated!!!

Well, a few errors posted would be helpful. Also, please post your code. If that is not possible, a snippet of code where the errors are occurring.

Also, what device and os version? I imagine everything worked in Particle IDE. Right?

Yes, the IDE code worked great.

Let me make up a snippet of code and a few of the errors.

Thanks again,
Bernard

:::: COMPILING APPLICATION

Creating c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/target/4.0.2/boron/platform_user_ram.ld ...
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::Adafruit_INA219(unsigned char)':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:36: multiple definition of `Adafruit_INA219::Adafruit_INA219(unsigned char)'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:37: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::Adafruit_INA219(unsigned char)':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:36: multiple definition of `Adafruit_INA219::Adafruit_INA219(unsigned char)'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:37: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::~Adafruit_INA219()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:45: multiple definition of `Adafruit_INA219::~Adafruit_INA219()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:46: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::~Adafruit_INA219()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:45: multiple definition of `Adafruit_INA219::~Adafruit_INA219()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:46: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getBusVoltage_raw()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:76: multiple definition of `Adafruit_INA219::getBusVoltage_raw()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:77: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getShuntVoltage_raw()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:91: multiple definition of `Adafruit_INA219::getShuntVoltage_raw()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:92: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getCurrent_raw()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:103: multiple definition of `Adafruit_INA219::getCurrent_raw()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:104: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getPower_raw()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:125: multiple definition of `Adafruit_INA219::getPower_raw()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:126: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getShuntVoltage_mV()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:147: multiple definition of `Adafruit_INA219::getShuntVoltage_mV()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:148: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getBusVoltage_V()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:157: multiple definition of `Adafruit_INA219::getBusVoltage_V()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:158: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getCurrent_mA()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:167: multiple definition of `Adafruit_INA219::getCurrent_mA()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:168: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::getPower_mW()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:178: multiple definition of `Adafruit_INA219::getPower_mW()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:179: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::setCalibration_32V_2A()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:191: multiple definition of `Adafruit_INA219::setCalibration_32V_2A()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:192: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::init()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:69: multiple definition of `Adafruit_INA219::init()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:70: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::begin(TwoWire*)':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:52: multiple definition of `Adafruit_INA219::begin(TwoWire*)'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:53: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::powerSave(bool)':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:280: multiple definition of `Adafruit_INA219::powerSave(bool)'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:280: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::setCalibration_32V_1A()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:300: multiple definition of `Adafruit_INA219::setCalibration_32V_1A()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:300: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::setCalibration_16V_400mA()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:391: multiple definition of `Adafruit_INA219::setCalibration_16V_400mA()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:391: first defined here
c:/users/bernardparticle/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219_.o): in function `Adafruit_INA219::success()':
c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/lib/Adafruit_INA219_/src/Adafruit_INA219_.cpp:487: multiple definition of `Adafruit_INA219::success()'; ../../../build/target/user/platform-13-m/Particle_State_Machine/\libuser.a(Adafruit_INA219.o):c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine//src/Adafruit_INA219.cpp:486: first defined here
collect2.exe: error: ld returned 1 exit status
make[2]: *** [../../../build/module.mk:220: c:/Users/BernardParticle/Particle/Particle_Cell_Setup/Particle_State_Machine/target/4.0.2/boron/Particle_State_Machine.elf] Error 1   
make[1]: *** [../build/recurse.mk:12: modules/boron/user-part] Error 2
make: *** [C:\Users\BernardParticle\.particle\toolchains\buildscripts\1.11.0\Makefile:68: compile-user] Error 2

 *  The terminal process "C:\Users\BernardParticle\.particle\toolchains\buildtools\1.1.1\bin\bash.exe '-c', 'make -f 'C:\Users\BernardParticle\.particle\toolchains\buildscripts\1.11.0\Makefile' compile-user -s'" terminated with exit code: 2. 

I hope thiw iw not too much!! It seems it is complaining about multiple defines of Adafruit_INA219

this occurs in almost all, if not all, the errors:

Before we go further, please provide the rest of the requested information. If you could provide a scaled down version of your code that would be helpful.

Will do.

Thanks

Hopefully this code is enough to be useful for you. Most credit to the Particle team for the OTA code. I simply added to their great work with my current measurement code.

THANKS for your time and interest!!

Bernard

include <Adafruit_INA219_.h>
#include <Wire.h>
#include "Particle.h"

PRODUCT_VERSION(5);

SerialDebugOutput debugOutput;
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);
//****************************************
//  * Define Instances and Constants
//****************************************
#define DEBUG
#define I2C_CurrentSensor
Adafruit_INA219 ina219;

#ifdef I2C_CurrentSensor
    #define currentSenEn         D8
    #define sensorZeroCurrent    4.00                  //mAmp
    #define sensorMaxCurrent     20.00       
#endif

//************** Sensor Parameters End *******************************************************
#define BoastRegEn               D5    
#define VREF                     3300          // ADC's reference voltage value:3300mV

FuelGauge fuel;

/****************************************
 * // PROTOTYPE
 ****************************************/
float getVCell();
void  lowBattery(void);

// If you are using a product, uncomment these lines and set the correct product ID and version
// for your product
// #ifndef SYSTEM_VERSION_v400ALPHA1
// PRODUCT_ID(8761);
// #endif
// PRODUCT_VERSION(4);

SerialLogHandler logHandler(115200);

const std::chrono::milliseconds connectMaxTime = 6min;
const std::chrono::milliseconds cloudMinTime = 10s;

// How long to sleep
const std::chrono::milliseconds sleepTime = 1min;
const std::chrono::milliseconds publishMaxTime = 3min;
const std::chrono::milliseconds firmwareUpdateMaxTime = 5min;

enum State 
{
    STATE_WAIT_CONNECTED = 0,
    STATE_PUBLISH,
    STATE_PRE_SLEEP,
    STATE_SLEEP,
    STATE_FIRMWARE_UPDATE
};
State state = STATE_WAIT_CONNECTED;
unsigned long stateTime;
bool firmwareUpdateInProgress = false;

void readSensorAndPublish(); // forward declaration
void firmwareUpdateHandler(system_event_t event, int param); // forward declaration

void setup() 
{
  Serial.begin(115200);
  waitFor(Serial.isConnected, 30000);
  
  // Initialize the INA219.
  // By default the initialization will use the largest range (32V, 2A).  However
  // you can call a setCalibration function to change this range (see comments).
  if (!ina219.begin()) 
  {
    Serial.println("Failed to find INA219 chip");
    while (1) 
    { 
        delay(10); 
    }
  }
  ina219.setCalibration_16V_400mA();

  Serial.println("Measuring voltage and current with INA219 ...");
  delay(1000);
  pinMode(currentSenEn, OUTPUT);
  pinMode(BoastRegEn, OUTPUT);
  digitalWrite(currentSenEn, LOW);
  digitalWrite(BoastRegEn, LOW);

    FuelGauge fuel;
    if (fuel.getSoC() < 15) {
        // If battery is too low, don't try to connect to cellular, just go back into
        // sleep mode.
        Log.info("low battery, going to sleep immediately");
        state = STATE_SLEEP;
        Serial.println("low battery, going to sleep immediately");
        return;
    }
    System.on(firmware_update, firmwareUpdateHandler);
    Cellular.on();
    Particle.connect();
    stateTime = millis();
    
    // Subscribe to the response event, scoped to webhooks triggered by this device
    Particle.subscribe(System.deviceID() + "/hook-response/current/", ParticleEventHandler_current);
    Particle.subscribe(System.deviceID() + "/hook-response/batteryvoltage/", ParticleEventHandler_batteryvoltage);
}

void loop()
{
    switch(state) 
    {
        case STATE_WAIT_CONNECTED:
            // Wait for the connection to the Particle cloud to complete
            if (Particle.connected()) 
            {
                Log.info("connected to the cloud in %lu ms", millis() - stateTime);
                Serial.println("Particle connected!");
                state = STATE_PUBLISH; 
                stateTime = millis(); 
            }
            else
            if (millis() - stateTime >= connectMaxTime.count()) 
            {
                // Took too long to connect, go to sleep
                Log.info("failed to connect, going to sleep");
                state = STATE_SLEEP;
            }
            break;
        case STATE_PUBLISH:
            readSensorAndPublish();
            if (millis() - stateTime < cloudMinTime.count())
            {
                Log.info("waiting %lu ms before sleeping", (unsigned long)(cloudMinTime.count() - (millis() - stateTime)));
                state = STATE_PRE_SLEEP;
            }
            else 
            {
                state = STATE_SLEEP;
            }
            break;
        case STATE_PRE_SLEEP:
            // This delay is used to make sure firmware updates can start and diagnostics go out
            // It can be eliminated by setting cloudMinTime to 0 and sleep will occur as quickly
            // as possible. 
            if (millis() - stateTime >= cloudMinTime.count()) 
            {
                state = STATE_SLEEP;
            }
            break;
        case STATE_SLEEP:
            if (firmwareUpdateInProgress) 
            {
                Log.info("firmware update detected");
                state = STATE_FIRMWARE_UPDATE;
                stateTime = millis();
                break;
            }
            Log.info("going to sleep for %ld seconds", (long) sleepTime.count());
            {
                SystemSleepConfiguration config;
#if HAL_PLATFORM_NRF52840
                // Gen 3 (nRF52840) does not suppport HIBERNATE with a time duration
                // to wake up. This code uses ULP sleep instead. 
                config.mode(SystemSleepMode::ULTRA_LOW_POWER)
                    .duration(sleepTime);
                System.sleep(config);

                // One difference is that ULP continues execution. For simplicity,
                // we just match the HIBERNATE behavior by resetting here.
                System.reset();
#else
                config.mode(SystemSleepMode::HIBERNATE)
                    .duration(sleepTime);
                System.sleep(config);
                // This is never reached; when the device wakes from sleep it will start over 
                // with setup()
#endif
            }
            break; 
        case STATE_FIRMWARE_UPDATE:
            if (!firmwareUpdateInProgress)
            {
                Log.info("firmware update completed");
                state = STATE_SLEEP;
            }
            else
            if (millis() - stateTime >= firmwareUpdateMaxTime.count())
            {
                Log.info("firmware update timed out");
                state = STATE_SLEEP;
            }
            break;
    }
}

void readSensorAndPublish() 
{
          //float tank_level_voltage_mV    = 0;
//unsigned  long  accumalatedValue         = 0;
          float battery_Voltage          = 0;
          float PSIperInch               = SensorMaxPSI / Sensor_H2O_Col_In;
          float mAmpPerIn                = (sensorMaxCurrent - sensorZeroCurrent) / Sensor_H2O_Col_In;  
          int iterations                 = 3000;
    #ifdef DEBUG
        Serial.println(SensorMaxPSI);
        Serial.println(Sensor_H2O_Col_In);
        Serial.println(sensorMaxCurrent);
        Serial.println(sensorZeroCurrent);
        Serial.println(PSIperInch);
        Serial.println(mAmpPerIn);
    #endif
    digitalWrite(currentSenEn, HIGH);
    digitalWrite(BoastRegEn, HIGH);
    digitalWrite(Si4403En, LOW);
    digitalWrite(MAX1614_ON,LOW);
    digitalWrite(MAX1614_OFF, HIGH);
    delay(100);
    
    #ifdef I2C_CurrentSensor
        float shuntvoltage  = 0;
        float busvoltage    = 0;
        float current_mA    = 0;
        float loadvoltage   = 0;
        float power_mW      = 0;
        int correctionIndex = 0;
        
        shuntvoltage = ina219.getShuntVoltage_mV();
        busvoltage   = ina219.getBusVoltage_V();
        
        current_mA   = 0;
        for(int iCount = 0; iCount < iterations; iCount++)
        {
          current_mA += ina219.getCurrent_mA();
        }
        current_mA = current_mA / iterations;
        correctionIndex = int(current_mA);
        current_mA = current_mA + errorCorrection[correctionIndex];
        
        float inchOfLiquid          = ((current_mA - sensorZeroCurrent) / mAmpPerIn) + sensorHeightAboveTankBottomInches;
        if(inchOfLiquid < 0)
        {
          inchOfLiquid = 0;
        }
        float tankGallons           = inchOfLiquid * gallonsperinch * productSpecificGravity;
        power_mW = ina219.getPower_mW();
        loadvoltage = busvoltage + (shuntvoltage / 1000);
    #endif
\
    bool result = Particle.publish("current", String(tankGallons), PRIVATE, WITH_ACK);
    Log.info("published %s (result=%d)",  String(tankGallons), result);
	battery_Voltage = fuel.getVCell();
    result = Particle.publish("batteryvoltage", String(battery_Voltage), PRIVATE, WITH_ACK);
    Log.info("published %s (result=%d)", String(battery_Voltage), result);
    result = Particle.publish("inchOfLiquid", String(inchOfLiquid), PRIVATE, WITH_ACK);
    Log.info("published %s (result=%d)", String(inchOfLiquid), result);
    bool result = Particle.publish("sensorTest", buf, PRIVATE | WITH_ACK);

    digitalWrite(BoastRegEn, LOW);
}

void firmwareUpdateHandler(system_event_t event, int param)
{
    switch(param) 
    {
        case firmware_update_begin:
             firmwareUpdateInProgress = true;
             Serial.println("firmwareUpdateInProgress");
            break;
        case firmware_update_complete:
        //case firmware_update_failed:
            firmwareUpdateInProgress = false;
            Serial.println("firmware_update_complete");
            break;
    }
}

void ParticleEventHandler_current(const char *event, const char *data) 
{
  Serial.println("Got to Event handler!! current.");
}

void ParticleEventHandler_batteryvoltage(const char *event, const char *data) 
{
  Serial.println("Got to Event handler!! batteryVoltage.");
}

Hi,
from the logs it seems that there is something wrong on the file Adafruit_INA219.cpp:

Can’t say for sure, but if you would have created this file, I would say someone copy-pasted the contents several times.
Since you installed this lib, I do not know what happened.
Can you post the content of the said file, please?
You can also confirm the content with the original file:

(I’m unsure if the lib is at the same version as the git repo, though).

I deleted the lib folder in project explorer and I reinstalled INA219 library. When compiled I get the same messages about redefining multiple times.

/*!

*/

#if defined(PARTICLE)
#include <Particle.h>
#endif
#include “Adafruit_INA219_.h”

/*!

  • @brief Instantiates a new INA219 class
  • @param addr the I2C address the device can be found on. Default is 0x40
    */
    Adafruit_INA219::Adafruit_INA219(uint8_t addr) {
    ina219_i2caddr = addr;
    ina219_currentDivider_mA = 0;
    ina219_powerMultiplier_mW = 0.0f;
    }

/*!

  • @brief INA219 class destructor
    */
    Adafruit_INA219::~Adafruit_INA219() { delete i2c_dev; }

/*!

  • @brief Sets up the HW (defaults to 32V and 2A for calibration values)
  • @param theWire the TwoWire object to use
  • @return true: success false: Failed to start I2C
    */
    bool Adafruit_INA219::begin(TwoWire *theWire) {
    if (!i2c_dev) {
    i2c_dev = new Adafruit_I2CDevice(ina219_i2caddr, theWire);
    }

if (!i2c_dev->begin()) {
return false;
}
init();
return true;
}

/*!

  • @brief begin I2C and set up the hardware
    */
    void Adafruit_INA219::init() {
    // Set chip to large range config values to start
    setCalibration_32V_2A();
    }

/*!

  • @brief Gets the raw bus voltage (16-bit signed integer, so ±32767)
  • @return the raw bus voltage reading
    */
    int16_t Adafruit_INA219::getBusVoltage_raw() {
    uint16_t value;

Adafruit_BusIO_Register bus_voltage_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_BUSVOLTAGE, 2, MSBFIRST);
_success = bus_voltage_reg.read(&value);

// Shift to the right 3 to drop CNVR and OVF and multiply by LSB
return (int16_t)((value >> 3) * 4);
}

/*!

  • @brief Gets the raw shunt voltage (16-bit signed integer, so ±32767)
  • @return the raw shunt voltage reading
    */
    int16_t Adafruit_INA219::getShuntVoltage_raw() {
    uint16_t value;
    Adafruit_BusIO_Register shunt_voltage_reg =
    Adafruit_BusIO_Register(i2c_dev, INA219_REG_SHUNTVOLTAGE, 2, MSBFIRST);
    _success = shunt_voltage_reg.read(&value);
    return value;
    }

/*!

  • @brief Gets the raw current value (16-bit signed integer, so ±32767)
  • @return the raw current reading
    */
    int16_t Adafruit_INA219::getCurrent_raw() {
    uint16_t value;

// Sometimes a sharp load will reset the INA219, which will
// reset the cal register, meaning CURRENT and POWER will
// not be available … avoid this by always setting a cal
// value even if it’s an unfortunate extra step
Adafruit_BusIO_Register calibration_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CALIBRATION, 2, MSBFIRST);
calibration_reg.write(ina219_calValue, 2);

// Now we can safely read the CURRENT register!
Adafruit_BusIO_Register current_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CURRENT, 2, MSBFIRST);
_success = current_reg.read(&value);
return value;
}

/*!

  • @brief Gets the raw power value (16-bit signed integer, so ±32767)
  • @return raw power reading
    */
    int16_t Adafruit_INA219::getPower_raw() {
    uint16_t value;

// Sometimes a sharp load will reset the INA219, which will
// reset the cal register, meaning CURRENT and POWER will
// not be available … avoid this by always setting a cal
// value even if it’s an unfortunate extra step
Adafruit_BusIO_Register calibration_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CALIBRATION, 2, MSBFIRST);
calibration_reg.write(ina219_calValue, 2);

// Now we can safely read the POWER register!
Adafruit_BusIO_Register power_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_POWER, 2, MSBFIRST);
_success = power_reg.read(&value);
return value;
}

/*!

  • @brief Gets the shunt voltage in mV (so ±327mV)
  • @return the shunt voltage converted to millivolts
    */
    float Adafruit_INA219::getShuntVoltage_mV() {
    int16_t value;
    value = getShuntVoltage_raw();
    return value * 0.01;
    }

/*!

  • @brief Gets the bus voltage in volts
  • @return the bus voltage converted to volts
    */
    float Adafruit_INA219::getBusVoltage_V() {
    int16_t value = getBusVoltage_raw();
    return value * 0.001;
    }

/*!

  • @brief Gets the current value in mA, taking into account the
  •      config settings and current LSB
    
  • @return the current reading convereted to milliamps
    */
    float Adafruit_INA219::getCurrent_mA() {
    float valueDec = getCurrent_raw();
    valueDec /= ina219_currentDivider_mA;
    return valueDec;
    }

/*!

  • @brief Gets the power value in mW, taking into account the
  •      config settings and current LSB
    
  • @return power reading converted to milliwatts
    */
    float Adafruit_INA219::getPower_mW() {
    float valueDec = getPower_raw();
    valueDec *= ina219_powerMultiplier_mW;
    return valueDec;
    }

/*!

  • @brief Configures to INA219 to be able to measure up to 32V and 2A
  •      of current.  Each unit of current corresponds to 100uA, and
    
  •      each unit of power corresponds to 2mW. Counter overflow
    
  •      occurs at 3.2A.
    
  • @note These calculations assume a 0.1 ohm resistor is present
    */
    void Adafruit_INA219::setCalibration_32V_2A() {
    // By default we use a pretty huge range for the input voltage,
    // which probably isn’t the most appropriate choice for system
    // that don’t use a lot of power. But all of the calculations
    // are shown below if you want to change the settings. You will
    // also need to change any relevant register settings, such as
    // setting the VBUS_MAX to 16V instead of 32V, etc.

// VBUS_MAX = 32V (Assumes 32V, can also be set to 16V)
// VSHUNT_MAX = 0.32 (Assumes Gain 8, 320mV, can also be 0.16, 0.08, 0.04)
// RSHUNT = 0.1 (Resistor value in ohms)

// 1. Determine max possible current
// MaxPossible_I = VSHUNT_MAX / RSHUNT
// MaxPossible_I = 3.2A

// 2. Determine max expected current
// MaxExpected_I = 2.0A

// 3. Calculate possible range of LSBs (Min = 15-bit, Max = 12-bit)
// MinimumLSB = MaxExpected_I/32767
// MinimumLSB = 0.000061 (61uA per bit)
// MaximumLSB = MaxExpected_I/4096
// MaximumLSB = 0,000488 (488uA per bit)

// 4. Choose an LSB between the min and max values
// (Preferrably a roundish number close to MinLSB)
// CurrentLSB = 0.0001 (100uA per bit)

// 5. Compute the calibration register
// Cal = trunc (0.04096 / (Current_LSB * RSHUNT))
// Cal = 4096 (0x1000)

ina219_calValue = 4096;

// 6. Calculate the power LSB
// PowerLSB = 20 * CurrentLSB
// PowerLSB = 0.002 (2mW per bit)

// 7. Compute the maximum current and shunt voltage values before overflow
//
// Max_Current = Current_LSB * 32767
// Max_Current = 3.2767A before overflow
//
// If Max_Current > Max_Possible_I then
// Max_Current_Before_Overflow = MaxPossible_I
// Else
// Max_Current_Before_Overflow = Max_Current
// End If
//
// Max_ShuntVoltage = Max_Current_Before_Overflow * RSHUNT
// Max_ShuntVoltage = 0.32V
//
// If Max_ShuntVoltage >= VSHUNT_MAX
// Max_ShuntVoltage_Before_Overflow = VSHUNT_MAX
// Else
// Max_ShuntVoltage_Before_Overflow = Max_ShuntVoltage
// End If

// 8. Compute the Maximum Power
// MaximumPower = Max_Current_Before_Overflow * VBUS_MAX
// MaximumPower = 3.2 * 32V
// MaximumPower = 102.4W

// Set multipliers to convert raw current/power values
ina219_currentDivider_mA = 10; // Current LSB = 100uA per bit (1000/100 = 10)
ina219_powerMultiplier_mW = 2; // Power LSB = 1mW per bit (2/1)

// Set Calibration register to ‘Cal’ calculated above
Adafruit_BusIO_Register calibration_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CALIBRATION, 2, MSBFIRST);
calibration_reg.write(ina219_calValue, 2);

// Set Config register to take into account the settings above
uint16_t config = INA219_CONFIG_BVOLTAGERANGE_32V |
INA219_CONFIG_GAIN_8_320MV |
INA219_CONFIG_BADCRES_12BIT |
INA219_CONFIG_SADCRES_12BIT_1S_532US |
INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;
Adafruit_BusIO_Register config_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CONFIG, 2, MSBFIRST);
_success = config_reg.write(config, 2);
}

/*!

  • @brief Set power save mode according to parameters
  • @param on
  •      boolean value
    

*/
void Adafruit_INA219::powerSave(bool on) {
Adafruit_BusIO_Register config_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CONFIG, 2, MSBFIRST);

Adafruit_BusIO_RegisterBits mode_bits =
Adafruit_BusIO_RegisterBits(&config_reg, 3, 0);
if (on) {
_success = mode_bits.write(INA219_CONFIG_MODE_POWERDOWN);
} else {
_success = mode_bits.write(INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS);
}
}

/*!

  • @brief Configures to INA219 to be able to measure up to 32V and 1A
  •      of current.  Each unit of current corresponds to 40uA, and each
    
  •      unit of power corresponds to 800uW. Counter overflow occurs at
    
  •      1.3A.
    
  • @note These calculations assume a 0.1 ohm resistor is present
    */
    void Adafruit_INA219::setCalibration_32V_1A() {
    // By default we use a pretty huge range for the input voltage,
    // which probably isn’t the most appropriate choice for system
    // that don’t use a lot of power. But all of the calculations
    // are shown below if you want to change the settings. You will
    // also need to change any relevant register settings, such as
    // setting the VBUS_MAX to 16V instead of 32V, etc.

// VBUS_MAX = 32V (Assumes 32V, can also be set to 16V)
// VSHUNT_MAX = 0.32 (Assumes Gain 8, 320mV, can also be 0.16, 0.08, 0.04)
// RSHUNT = 0.1 (Resistor value in ohms)

// 1. Determine max possible current
// MaxPossible_I = VSHUNT_MAX / RSHUNT
// MaxPossible_I = 3.2A

// 2. Determine max expected current
// MaxExpected_I = 1.0A

// 3. Calculate possible range of LSBs (Min = 15-bit, Max = 12-bit)
// MinimumLSB = MaxExpected_I/32767
// MinimumLSB = 0.0000305 (30.5uA per bit)
// MaximumLSB = MaxExpected_I/4096
// MaximumLSB = 0.000244 (244uA per bit)

// 4. Choose an LSB between the min and max values
// (Preferrably a roundish number close to MinLSB)
// CurrentLSB = 0.0000400 (40uA per bit)

// 5. Compute the calibration register
// Cal = trunc (0.04096 / (Current_LSB * RSHUNT))
// Cal = 10240 (0x2800)

ina219_calValue = 10240;

// 6. Calculate the power LSB
// PowerLSB = 20 * CurrentLSB
// PowerLSB = 0.0008 (800uW per bit)

// 7. Compute the maximum current and shunt voltage values before overflow
//
// Max_Current = Current_LSB * 32767
// Max_Current = 1.31068A before overflow
//
// If Max_Current > Max_Possible_I then
// Max_Current_Before_Overflow = MaxPossible_I
// Else
// Max_Current_Before_Overflow = Max_Current
// End If
//
// … In this case, we’re good though since Max_Current is less than MaxPossible_I
//
// Max_ShuntVoltage = Max_Current_Before_Overflow * RSHUNT
// Max_ShuntVoltage = 0.131068V
//
// If Max_ShuntVoltage >= VSHUNT_MAX
// Max_ShuntVoltage_Before_Overflow = VSHUNT_MAX
// Else
// Max_ShuntVoltage_Before_Overflow = Max_ShuntVoltage
// End If

// 8. Compute the Maximum Power
// MaximumPower = Max_Current_Before_Overflow * VBUS_MAX
// MaximumPower = 1.31068 * 32V
// MaximumPower = 41.94176W

// Set multipliers to convert raw current/power values
ina219_currentDivider_mA = 25; // Current LSB = 40uA per bit (1000/40 = 25)
ina219_powerMultiplier_mW = 0.8f; // Power LSB = 800uW per bit

// Set Calibration register to ‘Cal’ calculated above
Adafruit_BusIO_Register calibration_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CALIBRATION, 2, MSBFIRST);
calibration_reg.write(ina219_calValue, 2);

// Set Config register to take into account the settings above
uint16_t config = INA219_CONFIG_BVOLTAGERANGE_32V |
INA219_CONFIG_GAIN_8_320MV |
INA219_CONFIG_BADCRES_12BIT |
INA219_CONFIG_SADCRES_12BIT_1S_532US |
INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;
Adafruit_BusIO_Register config_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CONFIG, 2, MSBFIRST);
_success = config_reg.write(config, 2);
}

/*!

  • @brief set device to alibration which uses the highest precision for
  • current measurement (0.1mA), at the expense of
    
  • only supporting 16V at 400mA max.
    

*/
void Adafruit_INA219::setCalibration_16V_400mA() {

// Calibration which uses the highest precision for
// current measurement (0.1mA), at the expense of
// only supporting 16V at 400mA max.

// VBUS_MAX = 16V
// VSHUNT_MAX = 0.04 (Assumes Gain 1, 40mV)
// RSHUNT = 0.1 (Resistor value in ohms)

// 1. Determine max possible current
// MaxPossible_I = VSHUNT_MAX / RSHUNT
// MaxPossible_I = 0.4A

// 2. Determine max expected current
// MaxExpected_I = 0.4A

// 3. Calculate possible range of LSBs (Min = 15-bit, Max = 12-bit)
// MinimumLSB = MaxExpected_I/32767
// MinimumLSB = 0.0000122 (12uA per bit)
// MaximumLSB = MaxExpected_I/4096
// MaximumLSB = 0.0000977 (98uA per bit)

// 4. Choose an LSB between the min and max values
// (Preferrably a roundish number close to MinLSB)
// CurrentLSB = 0.00005 (50uA per bit)

// 5. Compute the calibration register
// Cal = trunc (0.04096 / (Current_LSB * RSHUNT))
// Cal = 8192 (0x2000)

ina219_calValue = 8192;

// 6. Calculate the power LSB
// PowerLSB = 20 * CurrentLSB
// PowerLSB = 0.001 (1mW per bit)

// 7. Compute the maximum current and shunt voltage values before overflow
//
// Max_Current = Current_LSB * 32767
// Max_Current = 1.63835A before overflow
//
// If Max_Current > Max_Possible_I then
// Max_Current_Before_Overflow = MaxPossible_I
// Else
// Max_Current_Before_Overflow = Max_Current
// End If
//
// Max_Current_Before_Overflow = MaxPossible_I
// Max_Current_Before_Overflow = 0.4
//
// Max_ShuntVoltage = Max_Current_Before_Overflow * RSHUNT
// Max_ShuntVoltage = 0.04V
//
// If Max_ShuntVoltage >= VSHUNT_MAX
// Max_ShuntVoltage_Before_Overflow = VSHUNT_MAX
// Else
// Max_ShuntVoltage_Before_Overflow = Max_ShuntVoltage
// End If
//
// Max_ShuntVoltage_Before_Overflow = VSHUNT_MAX
// Max_ShuntVoltage_Before_Overflow = 0.04V

// 8. Compute the Maximum Power
// MaximumPower = Max_Current_Before_Overflow * VBUS_MAX
// MaximumPower = 0.4 * 16V
// MaximumPower = 6.4W

// Set multipliers to convert raw current/power values
ina219_currentDivider_mA = 20; // Current LSB = 50uA per bit (1000/50 = 20)
ina219_powerMultiplier_mW = 1.0f; // Power LSB = 1mW per bit

// Set Calibration register to ‘Cal’ calculated above
Adafruit_BusIO_Register calibration_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CALIBRATION, 2, MSBFIRST);
calibration_reg.write(ina219_calValue, 2);
// Set Config register to take into account the settings above
uint16_t config = INA219_CONFIG_BVOLTAGERANGE_16V |
INA219_CONFIG_GAIN_1_40MV |
INA219_CONFIG_BADCRES_12BIT |
INA219_CONFIG_SADCRES_12BIT_1S_532US |
INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;

Adafruit_BusIO_Register config_reg =
Adafruit_BusIO_Register(i2c_dev, INA219_REG_CONFIG, 2, MSBFIRST);
_success = config_reg.write(config, 2);
}

/*!

  • @brief Provides the the underlying return value from the last operation
  •      called on the device.
    
  • @return true: Last operation was successful false: Last operation failed
  • @note For function calls that have intermediary device operations,
  •      e.g. calibration before read/write, only the final operation's
    
  •      result is stored.
    

*/
bool Adafruit_INA219::success() { return _success; }

I was able to compile your code for a Boron device without the errors you are having. I do get some errors but they are mostly due to missing information related to some constants, variables, etc. which were probably culled for a smaller code file. But, I am guessing with some information. Can you reply to the previous question below?

Also, @gusgonnet makes an excellent point about the unknown state of the library file(s) in your current Workbench project. After you follow thru with his suggestion, perhaps you could try creating a new project in Workbench (Particle: Create New Project).

In the interest of time, I am going to stick with working software in the web IDE. Trying to get this to work in Workbench is beyond my capabilities.

Thanks for your efforts.

Bernard

You are welcome. Migrating from IDE to Workbench can feel like a daunting experience. When you have time in the future, I highly recommend you give it another shot. :grinning: I feel you are close to achieving the goal. So, come on back when you can spare the time. I think you will find the time invested will be well worth it.

1 Like

You are very kind! I will give it another try when the customer is not waiting.

Thanks,
Bernard