Commit Graph
99 Commits
Author SHA1 Message Date
Patrick Fallberg 0f55969ace Cleaned up Doxygen warnings in library drivers 2016-01-19 23:56:27 +01:00
Patrick Fallberg 877cac266f Cleaned up Doxygen warnings in examples 2016-01-19 23:56:27 +01:00
Patrick Fallberg 5853cf5fe0 Cleaned up Doxygen warnings in libraries/MySensors/drivers/AVR 2016-01-19 23:56:26 +01:00
Patrick Fallberg 44b52f10be Cleaned up Doxygen warnings in MyConfig.h 2016-01-19 23:56:26 +01:00
Patrick Fallberg 0683709506 Cleaned up Doxygen warnings in libraries/MySensors/core 2016-01-19 23:56:25 +01:00
Patrick Fallberg 92f6585a90 Merge pull request #358 from fallberg/sign-fix
Make sure signing presentation data is sent correctly
2016-01-19 23:46:40 +01:00
Patrick Fallberg 6b6e829f93 Make sure signing presentation data is sent correctly
The message sender was retrieved from the message buffer after
prepareSigningPresentation() was called. This function resets
the message buffer so that is not the proper way to do it. Now,
the message sender is extracted first in signerProcessInternal()
in order to avoid the value being overwritten later on.
2016-01-19 09:17:18 +01:00
Patrick Fallberg f6d482d4ce Merge pull request #333 from Kolbi/patch-2
Update HumiditySensor.ino
2016-01-15 11:16:39 +01:00
Patrick Fallberg e966366968 Merge pull request #339 from tbowmo/samd
Fixes problem with MY_LED_BLINKING_FEATURE being enabled on all builds
2016-01-13 20:53:30 +01:00
Patrick Fallberg 1f365342c2 Merge pull request #342 from marcovannoord/development
Use the internal pullup to be able to hook up this sketch directly to S0 meters
2016-01-13 19:08:57 +01:00
Patrick Fallberg 74a54267d2 Merge pull request #305 from fallberg/signing_refactoring
Signing improvements
2016-01-12 17:08:43 +01:00
Patrick Fallberg c52d2cd643 All software security related data moved to EEPROM
The Sha204Personalizer has been converted to a SecurityPersonalizer.
It takes care of generation and storage of keys and data to both
ATSHA204A and nonvolatile storage (EEPROM).
Library has been updated to read any software security related data
from the corresponding EEPROM locations.

The effect this has is that any node using any security feature has to
execute the personalizer at least once to store appropriate values.
The benefit of this is that the software no longer contain sensitive data
such as HMAC or AES keys.
Whitelists still are stored in software as they are variable in size.
2016-01-12 10:26:58 +01:00
Patrick Fallberg 3bf9184670 Removed signing identifier from nonces
It serves no practical use to have signing identifier in nonces
as nonces are architecture independent.

Fixes #318
2016-01-12 08:43:11 +01:00
Patrick Fallberg 58dbc2ad27 MY_DEBUG_VERBOSE_SIGNING flag implemented
This enables more verbose debug information for signing operations.

Fixes #319
2016-01-12 08:43:10 +01:00
Patrick Fallberg ff015dd373 Signing whitelisting rewritten
Whitelisting is now supported by all nodes that support signing,
while only nodes that define a whitelist with
MY_SIGNING_NODE_WHITELISTING will check signatures against a whitelist.
This allows a single node in a network to have a whitelist without require
all nodes that communicate it to be configured for whitelisting. The node
will publish its whitelisting preferences to the gateway together with its
signing preferences. In other words; whitelisting is now working as signing
requirements does.
A node that use whitelisting will reject any message (signed or unsigned)
from nodes not present in its whitelist.

Fixes #279
2016-01-12 08:41:55 +01:00
Patrick Fallberg 5ecf146f15 Sha256 calculator for library use
The signing infrastructure now supports calculating sha256.
This feature does not require signing support to be activated.
Fixes #315
2016-01-12 08:41:54 +01:00
Patrick Fallberg 02fbe536d4 Signing infrastructure refactored
Signing logic has now been centralized to MySigning.cpp in order to simplify
maintenance and debugging.
Debug prints have been extended and "demoted" to verbose level.
To get signing related debug info, MY_DEBUG_VERBOSE will need to be defined.
This fixes #278
2016-01-12 08:41:54 +01:00
Patrick Fallberg b64f676316 Merge pull request #325 from tekka007/ClearConfig
HW-independent ClearEepromConfig, substitutes #314
2016-01-11 23:41:00 +01:00
Patrick Fallberg 91985beb9d Bumped version to 2.0.0-beta
Considering the magnitude of the delta between master and
development branch currently, 2.0.0-beta apperas to be a
more realistic version than 1.6.0-beta.
2016-01-10 12:52:07 +01:00
Patrick Fallberg cee1dd3a4e Merge pull request #323 from tbowmo/samd
LED HW definitions in arduino HW files overridable
2016-01-07 23:43:59 +01:00
Patrick Fallberg 3e0e4d601b Merge pull request #327 from Br3nda/patch-1
spelling correction in esp8266 example sketch
2016-01-07 15:45:22 +01:00
Patrick Fallberg 7ee39509eb Merge pull request #321 from Mickaelh51/development
Add Oregon decoder library
2016-01-04 23:03:29 +01:00
Patrick Fallberg ebf183c3cf Merge pull request #311 from tbowmo/samd
Samd
2016-01-03 23:35:32 +01:00
Patrick Fallberg 62f522a065 Prevent SecureActuator from accepting ACKs as commands
As ACKs are not currently signed, allowing ACKs as commands
is a considerable security hole for this sketch. This is now resolved.
2015-12-16 10:54:05 +01:00
Patrick Fallberg ca4358591d Make sure nodes not supporting signing informs GW
A node that does not support signing, still needs to inform the
gateway about this to make sure the gateway carries a valid signing
requirement table when a node Id that was requiering signing stops
doing this.
This fixes #286.
2015-12-16 10:53:53 +01:00
Patrick Fallberg 68e8c2438e Better output directory handling in doxygen 2015-12-11 12:35:18 +01:00
Patrick Fallberg ce36a087fa Adjusted MySigning documentation slightly based on feedback 2015-12-11 00:40:03 +01:00
Patrick Fallberg 313bcf05f8 Added some more docs for MyMessage 2015-12-11 00:40:03 +01:00
Patrick Fallberg 5142cdc936 Documentation styling made a bit more "MySensorish" 2015-12-11 00:40:03 +01:00
Patrick Fallberg 6bfe853709 Added doc default style templates and activated graphing 2015-12-11 00:40:03 +01:00
Patrick Fallberg 941503b24f Divided public and private/internal modules
Public modules can be declared as normal. Internal modules should
have @ingroup internals after the group definition.
2015-12-11 00:40:03 +01:00
Patrick Fallberg a69f2889bf Better file documentation for the MySigning group 2015-12-11 00:40:03 +01:00
Patrick Fallberg f34ed5466e Added documentation extension mapping for INO files 2015-12-11 00:40:03 +01:00
Patrick Fallberg 9f0a348fbf Removed obsolete Doxyfile tags 2015-12-11 00:40:02 +01:00
Patrick Fallberg 9d7a2fd6e3 Documented signing related functionality 2015-12-11 00:40:02 +01:00
Patrick Fallberg cc544909ce Doxygen warnings cleanup
But made sure that any undocumented parts generates a warning
2015-12-11 00:40:02 +01:00
Patrick Fallberg e9971285a5 Initial Doxyfile commit
Project named "MySensors Library & Examples"
Index root is libraries/MySensors with recursive search
No LaTeX generation
Documentation/html added to .gitignore
2015-12-11 00:40:02 +01:00
Patrick Fallberg 36dcf2b5b6 Let prints on GW:s be up to MY_GATEWAY_MAX_SEND_LENGTH large 2015-11-30 14:16:58 +01:00
Patrick Fallberg 8280479724 Removed requirement for payload data for signed messages 2015-11-27 13:53:10 +01:00
Patrick Fallberg f6e018f5e3 Fixed bug in repeaters when forwarding signed messages
For repeated messages, sign flag must not be touched.
2015-11-19 09:28:36 +01:00
Patrick Fallberg cec516bc7e Added support for private configuration data
libraries/MySensors/core/MyPrivateConfig.h.sample contain an example for
how private configuration data can be organized.
Rename that file to MyPrivateConfig.h and place it in the same folder
as the sketch you want to build and include it in order to add private
settings that you for various reasons do not want to store in git:
Make sure to place this include before

All MyPrivateConfig.h files are ignored by git.
2015-11-17 14:04:55 +01:00
Patrick Fallberg 7cacb7d4fe Activated OTA in SensebenderMicro example by default 2015-11-16 22:14:26 +01:00
Patrick Fallberg 8a134f4a89 Refactored signing backend debug prints
Signing backend debugs are now controlled by the MY_DEBUG flag.
This also means that on serial gateways, signing related debug
messages are forwarded to the controller with the appropriate
MySensors header information.
2015-10-29 09:13:57 +01:00
Patrick Fallberg d793b5a089 Changed library version to comply with Semantic Versioning
New version: 1.6.0-beta for development of 1.6.0.
See http://semver.org
2015-10-28 10:55:24 +01:00
Patrick Fallberg 3c4ebbe310 Fixed bug in nonce exchange
Nonce-state machine got locked in SIGN_OK state.
2015-10-27 18:56:07 +01:00
Patrick Fallberg e75e735a10 Signing related fixes
* Secure actuator example now require signed messages by default
* Whitelisting config example in MyConfig.h now uses correct keywords
* keywords.txt updated with the actual whitelisting keyword
* Signing backends have improved debug output
  - The type of backend is presented in Get and Put nonce functions
  - The resulting signature is printed for both sender and receiver
* Fixed bug in soft signer (the untransmitted part of the nonce buffer was
  not the same in both ends)
* The ATSHA personalizer is updated to use acceptable syntax for user provided
  HMAC key
2015-10-26 22:15:42 +01:00
Patrick Fallberg 921b9fd3fc Forward declare all inline functions
This seem to be mandatory for newer Arduino IDE versions.
2015-09-24 10:45:46 +02:00
Patrick Fallberg a33e9cce48 Added preprocessor definitions to MySensors AVR boards
This allows the MySensors AVR boards (SenseBender) to be built with
upcoming versions of the Arduino IDE.
2015-09-22 23:25:43 +02:00
Patrick Fallberg a6e13bb4f1 Added build badges for the nightly builds of "future" Arduino IDE 2015-09-09 11:48:22 +02:00
Patrick Fallberg 255a8d821c Fixed "invalid suffix on literal" warning 2015-09-08 23:41:33 +02:00
Patrick Fallberg 33ddd161d5 Include utility/SPIFlash.h in SensebenderBlink.ino 2015-08-15 18:46:16 +02:00
Patrick Fallberg b7e4d23902 Merge master into development 2015-08-15 18:28:22 +02:00
Patrick Fallberg 21166528f8 Removed warnings in parkingsensor example 2015-08-13 23:10:16 +02:00
Patrick Fallberg e6a25ebb6b Renamed illegaly named sketches so they can be built
Also fixed the warnings in RGB-3D.ino
2015-08-13 17:43:18 +02:00
Patrick Fallberg 2b2a0ce294 Fixed various sketch-specific warnings 2015-08-09 10:06:10 +02:00
Patrick Fallberg af6e5d3019 Resolved various compiler warnings
This should make Jenkins happy.
2015-08-09 10:06:09 +02:00
Patrick Fallberg 997cb33226 Allow MySensor specific boards to be compiled with warnings enabled
This commit enables the Arduino IDE to configure MySensor specific
boards with more verbose warnings just as official Arduino boards.
2015-08-08 00:18:41 +02:00
Patrick Fallberg 99cec3bb16 Support Arduino MEGA boards for RFM69 interrupt config 2015-08-07 21:09:23 +02:00
Patrick Fallberg 4aee5bd448 Demoted #error to #warning in SecureActuator.ino 2015-08-07 15:16:47 +02:00
Patrick Fallberg 1049246a88 Make sure SPI backend is initialized in SPIFlash driver
In some cases, SPIFlash driver hangs during initialization
because it reads data from the SPI backend. But if SPI backend
has not been initialized, this fails.
2015-06-20 13:39:30 +02:00
Patrick Fallberg f8281302eb Fixed software signing whitelisting example in SecureActuator
The software serial is now provided to the backend as it should be.
2015-03-18 22:31:14 +01:00
Patrick Fallberg 6fb7266752 Removed 'new' from PinChangeInt library
As a consequence, only one pin is currently suppored.
AddPin will not really add a new pin, just replace the configuration
of the existing pin.

The motivation for this limitation is that 'new' costs a lot of
program memory.
2015-03-16 23:15:55 +01:00
Patrick Fallberg 6fd26880a2 Made "Inclusion started by button" a DEBUG message
In other words, the message will only be printed if DEBUG flag is enabled.
2015-03-16 23:15:55 +01:00
Patrick Fallberg 70eac0423d Added config flag MY_SIGNING_FEATURE in MyConfig.h
By disabeling MY_SIGNING_FEATURE all signing logic in the library
will be removed.
2015-03-16 23:15:54 +01:00
Patrick Fallberg 7a2a5dad81 Message signing logic now integrated into sendRoute() 2015-03-16 23:15:54 +01:00
Patrick Fallberg 2d2eb74e0a Fixed bug with storing signing table in EEPROM
eeprom_updated_block() uses a non-string-standardised order of
arguments.
2015-03-16 20:24:43 +01:00
Patrick Fallberg 611ba0cf44 Slimmed down memory footprint of signing backends 2015-03-16 20:24:42 +01:00
Patrick Fallberg f295ef2961 Whitelisting support in signing backend
Whitelisting is enabled using MY_SECURE_NODE_WHITELISTING in MyConfig.h.
The whitelist is provided in backend constructors.
See the SecureActuator example for a typical usecase.
2015-03-16 20:21:05 +01:00
Patrick Fallberg cf31edcb81 New way of presenting ATSHA204 serial in personalizer
The serial is now more copy+paste friendly for use in whitelists.
2015-03-16 20:15:09 +01:00
Patrick Fallberg e35a01766b Implemented basic whitening of nonce
A simple (for performanc reasons) whitening scheme has been
implemented for the ATSHA204 backeds that strengthens the
nonce "randomness".
2015-03-16 20:15:06 +01:00
Patrick Fallberg a1024cd2cd Added support to read the serial number from ATSHA204
The serial number can be used for whitelisting of nodes
that are considered "trusted".
2015-03-16 20:14:25 +01:00
Patrick Fallberg 4c4c9a8b39 Added SHA command to ATSHA204 backend driver
The SHA command is available in ATSHA204A variants of the chip
and can be used to calculate SHA256 digests of arbitrary data.

This enables us to strengthen the quality of the signatures by
salting signatures with node-specific data and improving the
quality of random data.
2015-03-16 20:14:22 +01:00
Patrick Fallberg a21715d415 SHA204 personalizer updated to handle HMAC key better
HMAC key is now configured and printed exactly as it is set
in MyConfig.h. This makes it easier to move the key around.
2015-03-09 00:20:17 +01:00
Patrick Fallberg 79be69b08d Support for gateways to request signed messages
Various fixes and tweaks to permit a gateway to request
signatures from nodes.
The following messages will not be signed (nor verified):
* All signing-related handshake messages
* All ID-related handshake messages
* All ACKs

An important change is that the polarity for the signing request
flags stored in EEPROM has changed. '0' now means signing required.
This ensures that if the "ClearEepromConfig" sketch is executed,
signing requests will be turned off by default.
As a consequence, it is recommended to clear EEPROM if signing will
be used to ensure all nodes default to a non-signing state.
2015-03-08 11:20:33 +01:00
Patrick Fallberg 961366313b Fixed bug that caused the wrong message to be signed
process() altered the message buffer pending signing when
called in sign() causing the wrong message to be sent to the
signing backend. This is resolved by copying the original
message before processing incoming messages to make sure
the original message is kept. After it is successfully signed,
it is copied back to its original location again.
Also, the old 'ack' message buffer is renamed to tmpMsg to
indicate its use as a temporary message buffer for various
purposes.
2015-02-25 22:50:51 +01:00
Patrick Fallberg 2ab9822172 Bugfix for gateway signing requirements
Gateway now only indicate signing requirements for sensors
that in turn have indicated signing requirements.
2015-02-22 23:32:45 +01:00
Patrick Fallberg cfc8d9f28a Added example sketch for a secure actuator
The sketch closely resembles the RelayActuator example.
The difference is that this sketch require gateway to sign
all messages addressed to the actuator.
2015-02-17 23:25:50 +01:00
Patrick Fallberg 644eac1712 Signing support implemented in the MySensors library
The dummy signing driver backend is used. But with this commit all
framework logic for managing signed messages in the MySensors
ecosystem is implemented and enables more sophisticated signing
backends to be added later on.

For a sensor (or gateway) that require a gateway to send signed
messages to it, add 'true' as the fifth argument to 'begin'.
The gateway will automatically inform a node of it's signing
requirements as soon as it receivs the nodes signing preference.
It is important to understand that if the gateway require
signing, it will in this implementation only require signing from
nodes that require signing by the gateway.

If the sensor requires signing from another node on the network
which it communicates directly with, it needs to send 'true' in
an internal message of type I_REQUEST_SIGNING.
2015-02-17 23:25:41 +01:00
Patrick Fallberg 911ae9c9d9 ATSHA204 emulated signing backend
ATSHA204 emulated signing backend. The emulated ATSHA204
implementation offers pseudo random number generation and
HMAC-SHA256 authentication compatible with a "physical"
ATSHA204.

NOTE: Key is stored in clear text in the Arduino firmware.
Therefore, the use of this back-end could compromise the key
used in the signed message infrastructure if device is lost
and its memory dumped.

The seed for the random number generated is sampled from an
analog pin. The pin is set in MyConfig.h using RANDOMSEED_PIN.
The pin should be unconnected.

The key to use for HMAC calculations must match the key used by
other nodes this node will exchange signed messages with. The key
for ATSHA204 emulator is set in MyConfig.h using hmacKey.
2015-02-17 23:25:33 +01:00
Patrick Fallberg ce290e280e ATSHA204 signing backend
Default SDA pin is A3 for single wire communication.
The pin is selected in MyConfig.h.
I2C variant of ATSHA204 is not supported.

Messages are signed using HMAC-SHA256 where some parts of the
message digest are ATSHA204 specific.
2015-02-17 23:25:24 +01:00
Patrick Fallberg fca0d4b544 Dummy signing driver backend
The dummy signing driver implements the most rudimentary form of
signing. No pre-shared key is used, nonce is simply incremeted
each turn and signature is only calculated on the fist byte using
data XOR nonce.
This driver is intended for library debugging and sensor network
integrity verification (signed messages will force the radio to
transmit all 32 bytes of data).
It does check SIGNING_IDENTIFIER byte to avoid illegal mixing of
signing backends in the network (as seen by this node) and it does
verify proper execution order on the API.
The dummy driver rejects all other signing backend protocols.

Signing backend is selected in MyConfig.h
2015-02-17 23:25:16 +01:00
Patrick Fallberg c2a75d064e Signing driver framework
The signing driver framework resembles the radio driver framework
in the sense that it relies on MyConfig.h for driver specific
settings. This allows the constructor to be clean and the API less
likely to need change.

The API is designed with function pairs for sender and receiver of
a signed message.
The sender of a signed message uses putNonce() and signMsg()
and the receiver of a signed message uses getNonce() and
verifyMsg().
In addition, receiver is expected to call checkTimer() at regular
intervals to make sure the message session does not time out.

The program flow is that the sender transmit, after determining
that the message needs signing, a request to the receiver for a
nonce (I_GET_NONCE). The receiver calls getNonce() to obtain a
nonce and transmits the nonce back to the sender
(I_GET_NONCE_RESPONSE).
The sender stores the received nonce in the driver with putNonce()
and then calls signMsg() to sign the message to be transmitted.
The receiver then calls verifyMsg() to authenticate the signed
message using the nonce transmitted earlier.

The flow is described below:
---------------- --------            ---------- ------------------
|senders driver| |sender|            |receiver| |receivers driver|
---------------- --------            ---------- ------------------
        |            |    I_GET_NONCE     |  getNonce()  |
        |            |------------------->|------------->|
        |            |                    |              |
        | setNonce() |I_GET_NONCE_RESPONSE|              |
        |<-----------|<-------------------|<-------------|
        | signMsg()  |                    |              |
        |<-----------|                    | verifyMsg()  |
        |----------->|------------------->|------------->|
        |            |                    | OK / not OK  |
        |            |                    |<-------------|

It is expected that all signing schemes is built upon this
principle.
2015-02-17 23:25:08 +01:00
Patrick Fallberg 9f337e3cae Message header updates for signing support
One bit in the protocol version field is converted to a sign
indicator. '1' means the message carries a signature in the
unused part of the payload data buffer.

Three new internal message types have been defined:

 * I_REQUEST_SIGNING    carries a boolean and is used to exchange
                        signing requirement information between
                        nodes.
                        If the I_REQUEST_SIGNING carries 'true'
                        the receiver is informed that the sender
                        require properly signed messages in order
                        to be able to accept the messages.
 * I_GET_NONCE          is passed from sender to a receiver that
                        require signing tellig it to submit a
                        cryptographic 'nonce' that the sender needs
                        in order to be able to sign the message it
                        intend to send. The I_GET_NONCE carries no
                        payload.
 * I_GET_NONCE_RESPONSE is sent by the receiver of a signed
                        message in response to I_GET_NONCE.
                        The first byte of the payload is a signing
                        identifier informing the sender of the
                        signed message about the type of signature
                        the receiver is expecting.
2015-02-17 23:25:00 +01:00
Patrick Fallberg 4d3fc96ebf ATSHA204 personalization sketch updated
New default pin is A3.

New option to skip UART confirmation: SKIP_UART_CONFIRMATION
This option prohibits the possibility to auto-generate key as there
will probably not be a way to show the generated key to the user.

More copy+paste friendly serial output of the generated key for
insertion into personalization sketch.
2015-02-16 22:30:50 +01:00
Patrick Fallberg 7d37cd9aa5 MyDriver structure renamed to MyRFDriver
The MyDriver scheme is radio specific, so it is renamed
accordingly to permit other driver schemes to coexist with it
without confusion.
2015-01-28 23:53:37 +01:00
Patrick Fallberg 6aa370d6f2 Personalization sketch for ATSHA204
This sketch is used to personalize the ATSHA204 crypto
circuit.
This is required in order to use the device for secure
communication.

The sketch also supports random key generation.

To personalize a ATSHA204 device, do the following:
1. Ensure the correct pin is used for the ATSHA204.
2. Execute the sketch without other changes to verify
   that it can communicate properly with the device.
3g. For a device used in a gateway:
    Enable LOCK_CONFIGURATION to lock the configuration
    and enable random key generation as well as key storage.
4g. Execute the sketch to lock the configuration and obtain
    a unique key. Be sure to note down the key printed in the
    UART log as it has been stored in the chip and will never
    be accessible again (a new key is calculated on subsequent
    runs).
    The key can still be changed.
5g. Enable SKIP_KEY_STORAGE to prevent generating new random
    keys on sketch re-execution.
3n. For a device used as a node:
    Enable USER_KEY_DATA and enter your private key data
    in user_key_data.
    Then enable LOCK_CONFIGURATION to lock the configuration
4n. Execute the sketch to lock the configuration and store
    the user-supplied key.
5n. Optionally: Enable SKIP_KEY_STORAGE to prevent re-writing
    the user supplied key on sketch re-execution.
6.  Optionally: Enable LOCK_DATA to prevent the key to be
    changed.
2015-01-10 19:57:09 +01:00
Patrick Fallberg 963a756605 sha204 library extended with CRC calculator
Locking operations are recommended to include CRC
and since sha204 library internally carries the proper
algorithm for this, it has now been refactored to support
both static and incremental calculations needed for both
command marchalling and locking.
2015-01-10 18:39:47 +01:00
Patrick Fallberg 1ac6f0a291 Removed examples from sha204 libraries
MySensors will have native support for sha204 and the
source for usage and personalization of sha204 will be
much more elaborate than this example so it does not
provide additional understanding for the chip.
2015-01-10 18:39:46 +01:00
Patrick Fallberg 9fd41b4030 Added sha204 library
Taken from the sha204_library folder in
https://github.com/jimblom/sha204-Breakout
Commit 8e1ac05ef987b1869605ad067db2bdbaec1c109f

ATSHA204 is a crypto cirquit from Atmel that enables
SHA256-based MAC and HMAC calculations as well as
secure key storage and random number generation.

This can be used to sign messages passed between
sensor nodes and prevent both man-in-the-middle and
replay attacking.
2015-01-10 18:37:43 +01:00
Patrick Fallberg 96f5b39e50 Corrected merge mistake 2014-10-11 00:03:35 +02:00
Patrick Fallberg 99b7b12856 Merge remote-tracking branch 'upstream/development' into development
Conflicts:
	libraries/MySensors/examples/EthernetGateway/EthernetGateway.ino
2014-10-11 00:00:27 +02:00
Patrick Fallberg e0e0d4aff3 Merge remote-tracking branch 'upstream/development' into development
Conflicts:
	libraries/MySensors/examples/EthernetGateway/EthernetGateway.ino
2014-10-10 23:56:29 +02:00
Patrick Fallberg f5ef712308 Support for WIZnet W5100 ethernet module SPI_EN
The W5100 module has a SPI_EN signal that enables or disables the SPI
bus.
A bug in the module causes MISO to be continously driven by the module
when SPI_EN is pulled high. This is described in this application note:
https://www.google.se/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCAQFjAA&url=http%3A%2F%2Fwww.wiznet.co.kr%2FUpLoad_Files%2FReferenceFiles%2FW5100_AN_SPI.pdf&ei=ij84VK7uM6nNygPqvICYDw&usg=AFQjCNGz1qttBEwG1azc1Eza4j69v1rpDQ&sig2=UUUtb4Dr0F35g8ByHMsyig&bvm=bv.77161500,d.bGQ

This commit changes the Ethernet gateway sketch to drive SPI_EN high or
low, depending on which module is in use (SPI bus is shared between
Ethernet and RF modules).
The pin attached to SPI_EN is defined by W5100_SPI_EN. This define can
be commented out if SPI_EN is not needed (different module) or if the
module manages SPI_EN in hardware (some W5100 shields does this).
2014-10-10 22:39:47 +02:00
Patrick Fallberg b97372ed01 Added .gitignore to filter stino settings files
Stino is a plugin for SublimeText to allow SublimeText to act as
an Arduino IDE.
2014-10-10 22:34:14 +02:00
Patrick Fallberg ba1d813469 Merge remote-tracking branch 'upstream/development' into development 2014-09-08 00:04:00 +02:00
Patrick Fallberg c13425d15e Updated BinarySwitchSensorInt to handle two sensors
The new sleep() constructor allows for two interrupt sources
to wake device from sleep. This example is now updated to
illustrate this.
2014-09-07 17:43:51 +02:00
Patrick Fallberg 35788d6d94 Added constructor to sleep() for monitoring two interrupts
The new constructor allows two separate interrupts with two
separate trigger policies to wake up device.
2014-09-07 15:53:57 +02:00
Patrick Fallberg ae35b9a058 Minor refactoring of delay variables
This is a preparation for handling multiple interrupts in delay().
It also reduces the size of the interrupt-related variables and
arguments to int8_t as that should be ample enough for any Arduino
implementation.
2014-09-07 15:22:58 +02:00
Patrick Fallberg 4ffb53b091 Implementation of interrupt driven binary switch
The difference between the interrupt driven binary switch example and
the normal binary switch example is the following:
* Interrupt example does not use debouncer because it rely on loop()
iterating over time (but it sleeps between iterations)
* Interrupt example is more power conservative because it sleeps as soon
as it has sent updated data and no activity happens on the pin
* Interrupt example is limited to only two IO pins for the sensor, due
to limitations in the Arduino HW. The example uses the preprocessor to
ensure that this is not misconfigured or sleep function can not be
expected to behave as intended.
2014-09-03 23:59:36 +02:00