Commit a512f521 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Update with changes from latest NM 1.7-dev

parent e8b6204d
# Continuous Integration (CI) is the practice, in software
# engineering, of merging all developer working copies with a shared mainline
# several times a day < http://docs.platformio.org/page/ci/index.html >
#
# Documentation:
#
# * Travis CI Embedded Builds with PlatformIO
# < https://docs.travis-ci.com/user/integration/platformio/ >
#
# * PlatformIO integration with Travis CI
# < http://docs.platformio.org/page/ci/travis.html >
#
# * User Guide for `platformio ci` command
# < http://docs.platformio.org/page/userguide/cmd_ci.html >
#
#
# Please choice one of the following templates (proposed below) and uncomment
# it (remove "# " before each line) or use own configuration according to the
# Travis CI documentation (see above).
#
#
# Template #1: General project. Test it using existing `platformio.ini`.
#
# language: python
# python:
# - "2.7"
#
# sudo: false
# cache:
# directories:
# - "~/.platformio"
#
# install:
# - pip install -U platformio
#
# script:
# - platformio run
#
# Template #2: The project is intended to by used as a library with examples
#
# language: python
# python:
# - "2.7"
#
# sudo: false
# cache:
# directories:
# - "~/.platformio"
#
# env:
# - PLATFORMIO_CI_SRC=path/to/test/file.c
# - PLATFORMIO_CI_SRC=examples/file.ino
# - PLATFORMIO_CI_SRC=path/to/test/directory
#
# install:
# - pip install -U platformio
#
# script:
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
#if (ARDUINO >= 100)
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
......@@ -41,4 +41,4 @@ int freeMemory() {
free_memory += freeListSize();
}
return free_memory;
}
\ No newline at end of file
}
This diff is collapsed.
EAGLE AutoRouter Statistics:
Job : /home/reinhold/temp/eagle/MySensors MQ GasSensors Board/MQ_GasSensors_Board.brd
Start at : 21:52:28 (02.07.17)
End at : 21:52:30 (02.07.17)
Elapsed time : 00:00:00
Signals : 6 RoutingGrid: 6 mil Layers: 2
Connections : 12 predefined: 12 ( 0 Vias )
Router memory : 300140
Passname : TopRouter Route Optimize1 Optimize2 Optimize3 Optimize4
Time per pass : 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00
Number of Ripups : 0 0 0 0 0 0
max. Level : 0 0 0 0 0 0
max. Total : 0 0 0 0 0 0
Routed : 0 0 0 0 0 0
Vias : 0 0 0 0 0 0
Resolution : 100.0 % 100.0 % 100.0 % 100.0 % 100.0 % 100.0 %
Final : 100.0% beendet
This diff is collapsed.
This diff is collapsed.
......@@ -2426,9 +2426,6 @@ void SensorMHZ19::setRxTx(int rxpin, int txpin) {
// what to do during before
void SensorMHZ19::onBefore() {
}
// what to do when receiving an interrupt
void SensorMHZ19::onInterrupt() {
}
// what to do during setup
void SensorMHZ19::onSetup() {
......
......@@ -12,8 +12,6 @@
void printFM();
void printFM();
/***********************************
Constants
*/
......
/*
NodeManager is intended to take care on your behalf of all those common tasks a MySensors node has to accomplish, speeding up the development cycle of your projects.
NodeManager includes the following main components:
- Sleep manager: allows managing automatically the complexity behind battery-powered sensors spending most of their time sleeping
- Power manager: allows powering on your sensors only while the node is awake
- Battery manager: provides common functionalities to read and report the battery level
- Remote configuration: allows configuring remotely the node without the need to have physical access to it
- Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line
- Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line
Documentation available on: https://github.com/mysensors/NodeManager
*/
*/
// load user settings
#include "config.h"
// include supporting libraries
......@@ -29,65 +28,82 @@ NodeManager nodeManager;
// before
void before() {
// setup the serial port baud rate
Serial.println(F("BEFORE"));
printFM();
Serial.begin(MY_BAUD_RATE);
Serial.begin(MY_BAUD_RATE);
/*
* Register below your sensors
*/
nodeManager.setSleepMinutes(2);
nodeManager.setReportIntervalMinutes(2);
// nodeManager.setSleepSeconds(10);
// nodeManager.setReportIntervalSeconds(10);
Serial.println(F("BEFORE"));
printFM();
nodeManager.setSleepMinutes(2);
nodeManager.setReportIntervalMinutes(2);
// nodeManager.setSleepSeconds(10);
// nodeManager.setReportIntervalSeconds(10);
SensorMQ* mqSensor = 0;
Serial.print(F("BEFORE registerSensor0: ")); printFM();
Serial.print(F("BEFORE registerSensor 0: ")); printFM();
int mq2 = nodeManager.registerSensor(SENSOR_MQ, A0, 1);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq2));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
Serial.print(F("BEFORE registerSensor1: ")); printFM();
mqSensor->setDescription("MQ-2");
Serial.print(F("BEFORE registerSensor 1: ")); printFM();
int mq3 = nodeManager.registerSensor(SENSOR_MQ, A1, 2);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq3));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
Serial.print(F("BEFORE registerSensor2: ")); printFM();
mqSensor->setDescription("MQ-3");
Serial.print(F("BEFORE registerSensor 2: ")); printFM();
int mq4 = nodeManager.registerSensor(SENSOR_MQ, A2, 3);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq4));
mqSensor->setCalibrationSampleTimes(10);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq4));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
Serial.print(F("BEFORE registerSensor3: ")); printFM();
mqSensor->setDescription("MQ-4");
Serial.print(F("BEFORE registerSensor 3: ")); printFM();
int mq5 = nodeManager.registerSensor(SENSOR_MQ, A3, 4);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq5));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
/* Serial.print(F("BEFORE registerSensor0: ")); printFM();
int mq6 = nodeManager.registerSensor(SENSOR_MQ, A4, 5);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq6));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
Serial.print(F("BEFORE registerSensor1: ")); printFM();
int mq7 = nodeManager.registerSensor(SENSOR_MQ, A5, 6);
mqSensor->setDescription("MQ-5");
Serial.print(F("BEFORE registerSensor 4: ")); printFM();
int mq7 = nodeManager.registerSensor(SENSOR_MQ, A4, 5);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq7));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
Serial.print(F("BEFORE registerSensor2: ")); printFM();
int mq8 = nodeManager.registerSensor(SENSOR_MQ, A6, 7);
mqSensor->setDescription("MQ-7");
Serial.print(F("BEFORE registerSensor 5: ")); printFM();
int mq8 = nodeManager.registerSensor(SENSOR_MQ, A5, 6);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq8));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
Serial.print(F("BEFORE registerSensor3: ")); printFM();
int mq9 = nodeManager.registerSensor(SENSOR_MQ, A7, 8);
mqSensor->setDescription("MQ-8");
Serial.print(F("BEFORE registerSensor 6: ")); printFM();
int mq9 = nodeManager.registerSensor(SENSOR_MQ, A6, 7);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq9));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
mqSensor->setDescription("MQ-9");
Serial.print(F("BEFORE registerSensor 7: ")); printFM();
int mq135 = nodeManager.registerSensor(SENSOR_MQ, A7, 8);
mqSensor = ((SensorMQ*)nodeManager.getSensor(mq135));
mqSensor->setCalibrationSampleTimes(10);
mqSensor->setCalibrationSampleInterval(250);
*/
mqSensor->setDescription("MQ-135");
Serial.print(F("BEFORE reg.Sens. MHZ19: ")); printFM();
int co2 = nodeManager.registerSensor(SENSOR_MHZ19, 6, 5);
int co2 = nodeManager.registerSensor(SENSOR_MHZ19, 6, 9);
SensorMHZ19* co2Sensor = ((SensorMHZ19*)nodeManager.getSensor(co2));
co2Sensor->setRxTx(6, 7);
co2Sensor->setDescription("MH-Z19 CO2 Sensor");
Serial.print(F("AFTER registering Sensors: ")); printFM();
/*
* Register above your sensors
......@@ -111,7 +127,6 @@ void setup() {
void loop() {
// call NodeManager loop routine
nodeManager.loop();
}
// receive
......@@ -127,3 +142,7 @@ void receiveTime(unsigned long ts) {
}
template<int s> struct Wow;
//Wow<sizeof(Sensor)> unused_warning;
//Wow<sizeof(SensorMQ)> unused_warning;
//Wow<sizeof(NodeManager)> unused_warning;
File mode changed from 100755 to 100644
......@@ -6,16 +6,16 @@
*/
#define SKETCH_NAME "AirQuality"
#define SKETCH_VERSION "1.0"
#define SKETCH_VERSION "1.1"
/**********************************
* MySensors node configuration
*/
// General settings
#define MY_BAUD_RATE 9600
//#define MY_BAUD_RATE 9600
//#define MY_DEBUG
//#define MY_NODE_ID 100
#define MY_NODE_ID 50
//#define MY_SMART_SLEEP_WAIT_DURATION_MS 500
// NRF24 radio settings
......@@ -63,7 +63,7 @@
* MySensors gateway configuration
*/
// Common gateway settings
//#define MY_REPEATER_FEATURE
#define MY_REPEATER_FEATURE
// Serial gateway settings
//#define MY_GATEWAY_SERIAL
......
......@@ -16,4 +16,3 @@ platform = atmelavr
board = nanoatmega328
framework = arduino
lib_deps = MySensors
upload_port = /dev/ttyUSB1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment