Project

General

Profile

Port libraries and latest version of Arduino

Added by vladS about 5 years ago

I have a weather station running on JeeNodes. It is battery powered and solar charged. It collects data and periodically transmits them to an indoor receiver that collects data, saves them and displays them. Recently SHT15 sensor failed again (I am getting about one year out of them).
I thought it was time to change to new sensor, HTU21D. That required rewriting part of the code.
My original code was written under Arduino0022. I decided to install latest and greatest Arduino 1.6.0. I knew I will have to change certain parts of code to accommodate latest version. I installed latest Ports library. But nothing worked, I could eventually compile without any errors, but program would not run.
So I went back to Arduino 1.0.1. I could compile and run. This is still with the old sensor just to make sure I was not introducing unknown problems.
Then I went to Arduino 1.0.5. I could compile, but program would not run. I had no errors or warnings even with verbose report. The only way I could make program to run was to comment out all references to rf12_XXX() calls. Any line of code that included anything related to rf12_ will stop program from running.
I have modelled most of my transmit routines on roomNode with all the scheduling and power saving. And it works very well. For that reason I decided to do all debugging using this program.
Again, it works on 1.0.1 but not on 1.0.5 unless I removed all lines with calls to rf12_ functions. In function doMeasure() just one line of code “payload.lobat = rf12_lowbat();” will stop program from running.
I do not know enough about all libraries to be able solve this problem. I would also like to know if I am the only one to have this problem.
Any help will be appreciated.


Replies (6)

RE: Port libraries and latest version of Arduino - Added by JohnO about 5 years ago

Hi vLadS,

When you say you have installed the latest Ports library, have you also installed the latest complete jeelib library?
I have been running Arduino 1.6.0 for a few weeks now without any problems thus far.

RE: Port libraries and latest version of Arduino - Added by vladS about 5 years ago

Hi JohnO,

Sorry for not being quite clear about it. Yes, I installed latest JeeLib from Github, and I used recommended installation using Add library directly from .zip file.
Library resides in Documents\Arduino106\libraries. I made a small error in my original post, I am doing it in Arduino 1.0.6. When I include JeeLib it expands into 10 includes,
like this.

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

I also have these two, they are required by roomNode
#include
#include

I had to comment out stuff related to RF69 because it was giving some errors. Could this be a problem? I am running RF12.
Question still remains why Arduino 1.0.1 is OK. I am running Win7 Home Premium, 64 bit.

Thanks

RE: Port libraries and latest version of Arduino - Added by JohnO about 5 years ago

Perhaps we should establish a baseline between us with all the code set back to as per the library. Could you build RF12demo.ino from the examples directory of jeelib using Arduino 1.6.0. I have just done this successfully with a JeeNode USB equipped with RFM12B radio.

As background, the line below determines which radio code is used for the JeeNode:

#define RF69_COMPAT 0 // define this to use the RF69 driver i.s.o. RF12

This master branch library defaults to build for RFM12B so you should not need to make any changes to build a baseline between us.

Arduino 1.6.1 was released recently but I haven’t tried it yet. I am not aware of anyone with problems such as yours but there were a few issues at the time that most folks upgraded from Arduino 0022 to 100+ versions.

You may see lots of stuff like this around.

#if ARDUINO >= 100
#include  // Arduino 1.0
#else
#include  // Arduino 0022
#endif

RE: Port libraries and latest version of Arduino - Added by vladS about 5 years ago

Hi JOhnO,

thank you for your responses.
I have re-installed 1.6.0 version. I have compiled RF12demo from library examples. Demo program runs. It initially reprogrammed my RFM12 radio to 868MHz, but I reset it back to 915 MHz (I am in Australia). Loaded to two JeeNodes (ID 1 & 2) and it communicates. After issuing ‘t’ command on TX, RX receives
OK 33 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
-> ack
So, all seems to be good, that is progress.
When I tried to compile my program, it compiled with one error:

C:7480404091502182626.tmp\WeatherTX_4_7.cpp.o: In function `doMeasure’:
/Arduino/WeatherTX_4_7.ino:218: undefined reference to `rf69_lowbat()‘
collect2: error: ld returned 1 exit status
Error compiling.
This offending line looks like this:
// readout all the sensors and other values
static void doMeasure() {
byte firstTime = payload.humi == 0; // special case to init running avg
//const word* p=sensor.getData();
payload.lobat = rf12_lowbat();
Just to make sure, here is the top of program with all defines:
#define RF69_COMPAT 0
#include
#include
#include
#include
//#include
#include
#include
#include
//#include
//#include
The problem was the ’#include ’. Once I removed that, it compiled AND runs.
I should have probably done the reinstallation first, but what thrown me off the rails was that 1.0.6 was behaving in similar manner. And it still gives me strange warnings.

OK, now I have to change temp/humi sensor for HTU21D. I have small test program running together with JeeLib, so I hope for the best.

Thank you very much for your input.

RE: Port libraries and latest version of Arduino - Added by JohnO about 5 years ago

That is an unusual thing, since you are not using the RFM69 radio then I am surprised that rf69_lowbat was referenced to produce your error below. The RFM69 doesn’t have a low battery capability.

C:7480404091502182626.tmp\WeatherTX_4_7.cpp.o: In function `doMeasure’:
/Arduino/WeatherTX_4_7.ino:218: undefined reference to `rf69_lowbat()’

I would welcome @jcw’s taking a look at this one.

Glad you have made progress.

RE: Port libraries and latest version of Arduino - Added by jcw about 5 years ago

Not sure I understand all the details, but I think you’re including too many headers.
JeeLib was created long ago to wrap RF12 and Ports, so you never have to include them yourself.
Also, if you don’t use the RFM69, then don’c include or set anything.

So your list can probably be pared down to:

#include
#include
//#include
#include
#include

That last one is probably also not needed?

-jcw

    (1-6/6)