Jump to content
chicken

[Energia Library] Bosch BMP085 Template Library

Recommended Posts

 
  • Launchpad 1.5 msp430G2
  • 2553
  • Bosch BMP085 from sparkfun
  • (no links provided since this is Energia lib problem I think
  • using latest Energia 0101E0011 
  • Windows 7
  • code provided by OP
  • I tried searching for this error and nothing came up.  Did I miss something?  I downloaded the files, uploaded them to the Energia folder "libraries" folder I created, copied the libraries from the Arduino software, and uploaded the example file.  This is the error code I get:

 

c:/users/pat/desktop/rocket stuff/energia-0101e0011-windows/energia-0101e0011/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status

 

Share this post


Link to post
Share on other sites

Hmm, I haven't tried my library with the latest Energia yet. The error message doesn't ring a bell either.

 

Can you post some code to show how you use the library?

 

I used the ReadSensor.ino file included in the github zip file for this library. 

/*
 ReadSensor - Basic example of using I2C-based template library for Bosch BMP085 digital pressure sensor.
   Created by Adrian Studer, April 2013.
   Distributed under MIT License, see license.txt for details.   
*/

#include <Wire.h>          // required by BMP085 library
#include <C:/Users/Pat\Desktop/rocket stuff/energia-0101E0011-windows/energia-0101E0011/libraries/BMP085_t.h>      // import BMP085 template library

BMP085<0> PSensor;         // instantiate sensor, 0 = low precision pressure reading

void setup()
{
  Serial.begin(9600);      // initialize serial, used to display readings in Serial Monitor
  Wire.begin();            // initialize I2C that connects to sensor
  PSensor.begin();         // initalize pressure sensor
}

void loop()
{
  PSensor.refresh();                    // read current sensor data
  PSensor.calculate();                  // run calculations for temperature and pressure
  Serial.print("Temperature: ");         
  Serial.print(PSensor.temperature/10);  // display temperature in Celsius
  Serial.print(".");
  Serial.print(PSensor.temperature%10);  // display temperature in Celsius
  Serial.println("C");
  Serial.print("Pressure:    ");
  Serial.print((PSensor.pressure+50)/100);   // display pressure in hPa
  Serial.println("hPa");

  delay(5000);                          // wait a while before next loop
}

Share this post


Link to post
Share on other sites

I will have to update my Energia to reproduce.

 

Do you need the full path for the BMP085_t.h include?

 

 

#include <BMP085_t.h>

 

Should do the trick if you copied the library into the right folder.

Share this post


Link to post
Share on other sites

Well, I'm not sure that I copied it into the correct folder then. The bmp085_t.h file I copied into the "libraries" folder and tried to call it but it didn't like that. I'll go over adding files correctly to energia again.

 

Sent from my SGH-T889 using Tapatalk

 

 

Share this post


Link to post
Share on other sites

Ok, I get the same error with Energia E0011.

 

For what it's worth, even the Blink sketch throws a similar error. E0010 works just fine.

 

here the last line of the detailed compile output and the error:

 

C:\Other Programs\energia-0101E0011\hardware\tools\msp430\bin\msp430-gcc -Os
-Wl,-gc-sections,-u,main -mmcu=msp430f5529 -o
C:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp\Blink.cpp.elf
C:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp\Blink.cpp.o
C:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp\core.a
-LC:\Users\Adrian2\AppData\Local\Temp\build9069550804598847055.tmp -lm 

c:/other programs/energia-0101e0011/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe:
cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status
And for what it's worth, here the same command that works in E0010:

C:\Other Programs\energia-0101E0010\hardware\tools\msp430\bin\msp430-gcc -Os
-Wl,-gc-sections,-u,main -mmcu=msp430f5529 -o
C:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp\Blink.cpp.elf
C:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp\Blink.cpp.o
C:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp\core.a
-LC:\Users\Adrian2\AppData\Local\Temp\build1899634374725368843.tmp -lm
Maybe someone familiar with the Energia build system can spot the issue.

Share this post


Link to post
Share on other sites

You know what? The "no space in path" finally got me. Interestingly it works fine for Energia 0009 and 0010.

 

Move Energia 0011 into a parent folder that has no spaces, and Blink as well as my example will compile.

Share this post


Link to post
Share on other sites

I finished up my first Energia project, a template library for the Bosch BMP085 temperature and pressure sensor. It uses I2C and supports temperature in Celsius and pressure in Pascal.

 

https://github.com/astuder/BMP085-template-library-Energia

 

Hi @@chicken

 

Thank you very much for your BMP085 library. It works nicely also with the Software I2C Master Library for MSP430G2553 written by Rei Vilo. I tested with MSP430G2 Launchpad and a BMP180 breakout module (bought from Ebay). In the attached screenshot the final value of the pressure was corrected for altitude (that's why the dumped value of p and the pressure are different).

 

Istvan Cserny

 

post-699-0-88936700-1391194560_thumb.png

Share this post


Link to post
Share on other sites

I discovered a very strange behaviour of my BMP180 module. When it gets direct sunlight it immediately (within 1sec) reports higher altitude, and the reported temperature is also continuously increasing (the device becomes hot in reality, too). When I put it in the shadow(indirect sunlight) or cover it with a paper, it immediately sends the correct altitude, and the temperature starts decreasing. In the house (artificial light) or in darkness it works correctly.

Example:

altitude in shadow: 106m / temp: 18

Share this post


Link to post
Share on other sites

When I use the libary the reponse back from my BMP085 is alway 12.8C and 1000hPa. Did I fry my sensor ??

 

 

 

 

 

/*
 ReadSensor - Basic example of using I2C-based template library for Bosch BMP085 digital pressure sensor.
   Created by Adrian Studer, April 2013.
   Distributed under MIT License, see license.txt for details.   
*/

#include <Wire.h>          // required by BMP085 library
#include <BMP085_t.h>      // import BMP085 template library

BMP085<3> PSensor;         // instantiate sensor, 3 = high precision pressure reading

void setup()
{
  Serial.begin(9600);      // initialize serial, used to display readings in Serial Monitor
  Wire.begin();            // initialize I2C that connects to sensor
  PSensor.begin();         // initalize pressure sensor
 }

void loop()
{

  PSensor.refresh();                    // read current sensor data
  PSensor.calculate();                  // run calculations for temperature and pressure
  Serial.print("Temperature: ");         
  Serial.print(PSensor.temperature/10);  // display temperature in Celsius
  Serial.print(".");
  Serial.print(PSensor.temperature%10);  // display temperature in Celsius
  Serial.println("C");
  Serial.print("Pressure:    ");
  Serial.print((PSensor.pressure+50)/100);   // display pressure in hPa
  Serial.println("hPa");

  delay(5000);                          // wait a while before next loop
}
 

Share this post


Link to post
Share on other sites

OK, I'm getting confuseder and confuseder. I had the BMP085 working with an older Windows version of Energia and your library. I've updated to Energia 15 for Ubuntu and presumably have the latest version of BMP085_t.h (dated April 2013).

 

Now my program (on the MSP430F5529) apparently no longer sees the sensor!

 

IIRC I had to patch the earlier library to work with the F5529, but that shouldn't be necessary with this later one, right? I'm using the same "legacy" pin connections as before: SDA to P3.0 and SCL to P3.1.

 

I did notice this in your comments at the top of your driver:

MSP430
------

Tested with Energia 0101E0009
LaunchPad Rev1.5, TI MSP430G2553

Connections
* P1_6 => I2C SCL
* P1_7 => I2C SDA

If I understand, these pin assignments are used somewhere in the Wire library, and I've even read about a method

Wire.setModule()

that seemingly lets you choose from different I2C interfaces (defaulting to #3?). But I can't find any documentation of this.

Can you help clear up the confusion?

Share this post


Link to post
Share on other sites

Make sure you use the latest version as available on GitHub, it was tested with the MSP430F5529 launchpad.

https://github.com/astuder/BMP085-template-library-Energia

 

Make sure to call Wire.begin and optionally Wire.setModule before using the library.

 

That being said, I haven't touched Energia in a while, so it's possible that my code needs to be adjusted for newer versions.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×