diff --git a/mysensors_controller/src/config.h b/mysensors_controller/src/config.h index a990478..0dfefb1 100644 --- a/mysensors_controller/src/config.h +++ b/mysensors_controller/src/config.h @@ -6,7 +6,7 @@ */ #define SKETCH_NAME "Serial gateway" -#define SKETCH_VERSION "1.0" +#define SKETCH_VERSION "1.1" /********************************** * MySensors node configuration @@ -15,13 +15,15 @@ // General settings #define MY_BAUD_RATE 9600 #define MY_DEBUG -//#define MY_NODE_ID 100 +//#define MY_NODE_ID 32 // NRF24 radio settings #define MY_RADIO_NRF24 //#define MY_RF24_ENABLE_ENCRYPTION //#define MY_RF24_CHANNEL 76 -//#define MY_RF24_PA_LEVEL RF24_PA_HIGH +#define MY_RF24_PA_LEVEL RF24_PA_HIGH +#define MY_RF24_PA_LEVEL_GW RF24_PA_HIGH + //#define MY_DEBUG_VERBOSE_RF24 // RFM69 radio settings @@ -40,7 +42,7 @@ * MySensors gateway configuration */ // Common gateway settings -//#define MY_REPEATER_FEATURE +#define MY_REPEATER_FEATURE // Serial gateway settings #define MY_GATEWAY_SERIAL diff --git a/passive/lib/readme.txt b/passive/lib/readme.txt new file mode 100644 index 0000000..dbadc3d --- /dev/null +++ b/passive/lib/readme.txt @@ -0,0 +1,36 @@ + +This directory is intended for the project specific (private) libraries. +PlatformIO will compile them to static libraries and link to executable file. + +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, see how can be organized `Foo` and `Bar` libraries: + +|--lib +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| |--Foo +| | |- Foo.c +| | |- Foo.h +| |- readme.txt --> THIS FILE +|- platformio.ini +|--src + |- main.c + +Then in `src/main.c` you should use: + +#include +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +More information about PlatformIO Library Dependency Finder +- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/passive/platformio.ini b/passive/platformio.ini new file mode 100644 index 0000000..1be4c1c --- /dev/null +++ b/passive/platformio.ini @@ -0,0 +1,5 @@ +[env:pro8MHzatmega328] +platform = atmelavr +framework = arduino +board = pro8MHzatmega328 + diff --git a/passive/src/passive.ino b/passive/src/passive.ino new file mode 100644 index 0000000..49fde16 --- /dev/null +++ b/passive/src/passive.ino @@ -0,0 +1,44 @@ +// Enable debug prints +#define MY_DEBUG + +// Enable passive mode +#define MY_PASSIVE_NODE +#define MY_REPEATER_FEATURE + +// Passive mode requires static node ID +#define MY_NODE_ID 100 + +// Enable and select radio type attached +#define MY_RADIO_NRF24 +#define MY_RF24_PA_LEVEL RF24_PA_HIGH + +//#define MY_RADIO_NRF5_ESB +//#define MY_RADIO_RFM69 +//#define MY_RADIO_RFM95 + +#include + +#define CHILD_ID 0 // Id of the sensor child + +// Initialize general message +MyMessage msg(CHILD_ID, V_TEMP); + +void setup() +{ +} + +void presentation() +{ + // Send the sketch version information to the gateway and controller + sendSketchInfo("Passive node", "1.0"); + + // Register all sensors to gw (they will be created as child devices) + present(CHILD_ID, S_TEMP); +} + +void loop() +{ + // generate some random data + send(msg.set(25.0+random(0,30)/10.0,2)); + wait(10000); +}