MySensor.h conflict with RF24.h?



  • My goal is simply to Xmit the battery voltage and moisture sensor data from one Pro Mini (with RF24) to another Pro Mini (also with a RF24 radio), not using gw calls. My receiving Pro Mini will simply control a relay.

    I'm trying to combine two example sketches:

    • Plant_Moisture_Sensor_Low_Power
    • Arduino RF24XmitExample

    #include <SPI.h>
    #include <MySensor.h>
    #include "RF24.h"

    However, I'm getting compile errors. There seems to be a conflict between the MySensor gw library calls and the RF24 library calls.

    The first of many compile errors I get are:
    C:\Users\Dieter\AppData\Local\Temp\build3316808d9e952884aa2dded546ad6403.tmp\libraries\RF24\RF24.cpp.o: In function `SPIClass::setBitOrder(unsigned char)':

    C:\Users\Dieter\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:293: multiple definition of `RF24::csn(bool)'

    In the end, I get: Exit status 1
    Error compiling for board Arduino Pro or Pro Mini.

    Both examples individually compile OK.

    Any thoughts?
    Dieter



  • I forgot to mention I only use the gw libary to put the 3.3v Mini to sleep.


  • Mod

    Using both rf24 and MySensors will not work.

    If you only need sleep, the rocketscream lowpower library will probably be a better choice (except that it won't put the radio to sleep I think so you'll need to handle that separately.



  • When using the GW library, is there a way to communicate from one node to another, without having to go thru a controller?

    I have read some of the 1.5 API, but I cant really tell if this can be done.

    What about the LowPower.h library. Does it put the Radio to sleep?



  • What can i use to create an interrupt to wake a sleeping Arduino?
    This using your Plant_Moisture_Sensor sketch.


  • Mod

    @y4CdW42Ol8 said:

    When using the GW library, is there a way to communicate from one node to another, without having to go thru a controller?

    I have read some of the 1.5 API, but I cant really tell if this can be done.

    Yes. Use setDestination on the message, see https://www.mysensors.org/download/sensor_api_15#the-full-api

    What about the LowPower.h library. Does it put the Radio to sleep?

    To my knowledge, LowPower.h is the rocketscream lowpower library. So no, it does not.


  • Mod

    @y4CdW42Ol8 said:

    What can i use to create an interrupt to wake a sleeping Arduino?
    This using your Plant_Moisture_Sensor sketch.

    A timer (whick my sketch alreay uses) or a change in an interrupt pin, see the Sleeping section on https://www.mysensors.org/download/sensor_api_15#the-full-api and http://playground.arduino.cc/Code/Interrupts


 

245
Online

7.8k
Users

8.7k
Topics

93.1k
Posts