Add driver-options to gateways.
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
// which requires external flash and the DualOptiBoot bootloader.
|
// which requires external flash and the DualOptiBoot bootloader.
|
||||||
// Note: You can still have OTA FW updates without external flash but it
|
// Note: You can still have OTA FW updates without external flash but it
|
||||||
// requires the MYSBootloader and disabled MY_OTA_FIRMWARE_FEATURE
|
// requires the MYSBootloader and disabled MY_OTA_FIRMWARE_FEATURE
|
||||||
#define MY_OTA_FIRMWARE_FEATURE
|
//#define MY_OTA_FIRMWARE_FEATURE
|
||||||
// Slave select pin for external flash
|
// Slave select pin for external flash
|
||||||
#define MY_OTA_FLASH_SS 8
|
#define MY_OTA_FLASH_SS 8
|
||||||
// Flash jdecid
|
// Flash jdecid
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
|
|
||||||
|
|
||||||
// Set the hardware driver to use (initialized by MySensor-class)
|
// Set the hardware driver to use (initialized by MySensor-class)
|
||||||
#if defined __AVR_ATmega328P__
|
//#if defined __AVR_ATmega328P__
|
||||||
#include "MyHwATMega328.h"
|
#include "MyHwATMega328.h"
|
||||||
typedef MyHwATMega328 MyHwDriver;
|
typedef MyHwATMega328 MyHwDriver;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
@@ -44,7 +44,12 @@
|
|||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
|
||||||
#include <MySigningNone.h>
|
#include <MySigningNone.h>
|
||||||
|
#include <MyTransportRF69.h>
|
||||||
#include <MyTransportNRF24.h>
|
#include <MyTransportNRF24.h>
|
||||||
|
#include <MyHwATMega328.h>
|
||||||
|
#include <MySigningAtsha204Soft.h>
|
||||||
|
#include <MySigningAtsha204.h>
|
||||||
|
|
||||||
#include <MyParserSerial.h>
|
#include <MyParserSerial.h>
|
||||||
#include <MySensor.h>
|
#include <MySensor.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -72,11 +77,20 @@
|
|||||||
|
|
||||||
|
|
||||||
// NRFRF24L01 radio driver (set low transmit power by default)
|
// NRFRF24L01 radio driver (set low transmit power by default)
|
||||||
MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
|
MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
|
||||||
// Message signing driver (none default)
|
//MyTransportRF69 transport;
|
||||||
MySigningNone signer;
|
|
||||||
// Construct MySensors library
|
// Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
|
||||||
MySensor gw(radio, signer);
|
//MySigningNone signer;
|
||||||
|
//MySigningAtsha204Soft signer;
|
||||||
|
//MySigningAtsha204 signer;
|
||||||
|
|
||||||
|
// Hardware profile
|
||||||
|
MyHwATMega328 hw;
|
||||||
|
|
||||||
|
// Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
|
||||||
|
MySensor gw(transport, hw /*, signer*/);
|
||||||
|
|
||||||
|
|
||||||
#define IP_PORT 5003 // The port you want to open
|
#define IP_PORT 5003 // The port you want to open
|
||||||
IPAddress myIp (192, 168, 178, 66); // Configure your static ip-address here COMPILE ERROR HERE? Use Arduino IDE 1.5.7 or later!
|
IPAddress myIp (192, 168, 178, 66); // Configure your static ip-address here COMPILE ERROR HERE? Use Arduino IDE 1.5.7 or later!
|
||||||
|
|||||||
@@ -60,7 +60,12 @@ http://forum.mysensors.org/topic/303/mqtt-broker-gateway
|
|||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
|
||||||
#include <MySigningNone.h>
|
#include <MySigningNone.h>
|
||||||
|
#include <MyTransportRF69.h>
|
||||||
#include <MyTransportNRF24.h>
|
#include <MyTransportNRF24.h>
|
||||||
|
#include <MyHwATMega328.h>
|
||||||
|
#include <MySigningAtsha204Soft.h>
|
||||||
|
#include <MySigningAtsha204.h>
|
||||||
|
|
||||||
#include <MySensor.h>
|
#include <MySensor.h>
|
||||||
#include <MsTimer2.h>
|
#include <MsTimer2.h>
|
||||||
#include <Ethernet.h>
|
#include <Ethernet.h>
|
||||||
@@ -94,11 +99,20 @@ uint8_t TCP_MAC[] = { 0x02, 0xDE, 0xAD, 0x00, 0x00, 0x42 }; // Mac-address - You
|
|||||||
//////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// NRFRF24L01 radio driver (set low transmit power by default)
|
// NRFRF24L01 radio driver (set low transmit power by default)
|
||||||
MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
|
MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
|
||||||
// Message signing driver (none default)
|
//MyTransportRF69 transport;
|
||||||
MySigningNone signer;
|
|
||||||
// Construct MySensors library
|
// Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
|
||||||
MySensor gw(radio, signer);
|
//MySigningNone signer;
|
||||||
|
//MySigningAtsha204Soft signer;
|
||||||
|
//MySigningAtsha204 signer;
|
||||||
|
|
||||||
|
// Hardware profile
|
||||||
|
MyHwATMega328 hw;
|
||||||
|
|
||||||
|
// Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
|
||||||
|
MySensor gw(transport, hw /*, signer*/);
|
||||||
|
|
||||||
|
|
||||||
EthernetServer server = EthernetServer(TCP_PORT);
|
EthernetServer server = EthernetServer(TCP_PORT);
|
||||||
MyMessage msg;
|
MyMessage msg;
|
||||||
|
|||||||
@@ -23,8 +23,12 @@
|
|||||||
|
|
||||||
#define NO_PORTB_PINCHANGES
|
#define NO_PORTB_PINCHANGES
|
||||||
|
|
||||||
|
#include <MySigningNone.h>
|
||||||
|
#include <MyTransportRF69.h>
|
||||||
#include <MyTransportNRF24.h>
|
#include <MyTransportNRF24.h>
|
||||||
#include <MyHwATMega328.h>
|
#include <MyHwATMega328.h>
|
||||||
|
#include <MySigningAtsha204Soft.h>
|
||||||
|
#include <MySigningAtsha204.h>
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <MyParserSerial.h>
|
#include <MyParserSerial.h>
|
||||||
@@ -40,15 +44,20 @@
|
|||||||
#define RADIO_RX_LED_PIN 6 // Receive led pin
|
#define RADIO_RX_LED_PIN 6 // Receive led pin
|
||||||
#define RADIO_TX_LED_PIN 5 // the PCB, on board LED
|
#define RADIO_TX_LED_PIN 5 // the PCB, on board LED
|
||||||
|
|
||||||
|
|
||||||
// NRFRF24L01 radio driver (set low transmit power by default)
|
// NRFRF24L01 radio driver (set low transmit power by default)
|
||||||
MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
|
MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
|
||||||
// Message signing driver (none default)
|
//MyTransportRF69 transport;
|
||||||
|
|
||||||
|
// Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
|
||||||
//MySigningNone signer;
|
//MySigningNone signer;
|
||||||
// Construct MySensors library
|
//MySigningAtsha204Soft signer;
|
||||||
|
//MySigningAtsha204 signer;
|
||||||
|
|
||||||
|
// Hardware profile
|
||||||
MyHwATMega328 hw;
|
MyHwATMega328 hw;
|
||||||
|
|
||||||
MySensor gw(radio, hw);
|
// Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
|
||||||
|
MySensor gw(transport, hw /*, signer*/);
|
||||||
|
|
||||||
char inputString[MAX_RECEIVE_LENGTH] = ""; // A string to hold incoming commands from serial/ethernet interface
|
char inputString[MAX_RECEIVE_LENGTH] = ""; // A string to hold incoming commands from serial/ethernet interface
|
||||||
int inputPos = 0;
|
int inputPos = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user