Commit Graph
1772 Commits
Author SHA1 Message Date
Marcelo Aquino fb3d936d4c Linux: Binds to MY_IP_ADDRESS in client mode (#849) 2017-05-21 14:27:22 +02:00
Olivier abba1ec377 Minor updates STM32F1 support (#851) 2017-05-21 14:20:07 +02:00
d00616 6c12dddf5a Enhance randomness (AVR, ESP8266, Linux, NRF5) (#845)
This commit changes the way random numbers are available
with MySensors.

The AVR platform uses a 32 Bit random seed build from a floating
analog pin. The way of the generation of this seed is FIPS 140-2
compliant.

For support MCU with a fast way to generate random data, the
hwGetentropy() command is now available to allow rapid generation
of random data.

The ESP8266 platform uses the internal random source for randomness
for hwGetentropy() and Arduino's random() function.

The NRF5 platform initializes the pseudo random number generator
from internal hardware number generator. The internal AES-ECB unit
generates random data after filling with HWRNG data by AES-CBC.

On Linux getrandom() is implemented via syscall().

signerAtsha204SoftGetNonce speed:
AVR = ~14000us (sha204Soft)
NRF51 = ~152us (AES-CBC), 1739us (old sha204Soft)
NRF52 = ~31us (AES-CBC), 183us (old sha204Soft)
ESP8266 = ~20us (RANDOM_REG32), 380us (old sha204Soft)

All Nonce results tested for FIPS 140-2 compliance successfully.
2017-05-21 14:12:09 +02:00
Olivier b479a0cf3f Support for Teensy3 boards (#850) 2017-05-21 08:43:26 +02:00
Olivier e041bf4d74 NRF5: Updates for Jenkins verifier (#852) 2017-05-21 08:41:11 +02:00
Marcelo Aquino 6e648f58da Linux: Fix compilation error for rfm69 (#848) 2017-05-16 08:00:47 +02:00
Marcelo Aquino 14766382d3 Linux: Default SPI driver set to SPIDEV (#847) 2017-05-16 08:00:24 +02:00
Marcelo Aquino 34444a48b3 Linux: Fix compilation error for rfm95 (#846)
Fix #843
2017-05-16 07:59:49 +02:00
Marcelo Aquino 582c653a19 Fix cppcheck includes.cfg (#842) 2017-05-15 07:30:15 +02:00
Marcelo Aquino 2a7145cc15 Linux: Add inclusion mode to gateway example (#841)
Fix #770
2017-05-15 07:29:28 +02:00
Marcelo Aquino 4c52c56605 Linux: Give an error if UDP is selected (#840)
UDP isn't implemented in Linux.
2017-05-15 07:28:49 +02:00
d00616 726a20dad9 Add nrf5 platform (#830)
* Add NVRAM support

This is an EEPROM replacement based on MCU's internal Flash memory.
The NVRAM class is designed to be stateless. Each operation is
written to flash immediately.

The last 16k(nRF51)/32k(nRF52) of Flash memory are managed by the
VirtualPage class.  This class allows writing a single emulated 4k
page up 40,000 times.

The NVRAM class is a log based byte-wise storage allowing up to
40,000,000 writes depending on the number of used addresses.  Each
four allocated addresses from the beginning of the NVRAM reduce the
write log by one.

When first 256 bytes of the emulated storage are used, there is an
average writing capacity of 145,000 cycles per byte.

When the write log is full, the NVRAM is compressed into a new flash
page. After a new page is ready, the old page is released. This
process can take up to 4500 ms and cannot be interrupted.

The NVRAM functionality can easily be ported to ESP8266 or SAMD by
providing a Flash interface.

* Add NRF5 platform support

This is the support of the Nordic Semiconductor NRF51 (nrf51822,
nrf51422) and NRF52 (nrf52832) platform. Based on arduino-nRF5
(https://github.com/sandeepmistry/arduino-nRF5).

The included radio driver is compatible with the NRF24 devices.
Using a SoftDevice (BLE)is not supported and must be removed before
flashing MySensors with a "mass_erase" operation.
2017-05-14 11:53:01 +02:00
Marcelo Aquino a4c7b249c1 Linux: Fix Ethernet client and server (#836)
- Fix documentation.
- Add function close() to client class.
- Function connected() now return true if the connection is in
  stablished state or there is still unread data.
- Update hasClient() to check if any client has disconnected.
- Fix _accept() to better handle the case of maximum clients reached.
- Fix peek() to return the next byte of the read queue.
- Simplifies write() of the server class.
- Implements flush().
- Updates read() to non-blocking type, the same way as in Arduino.
2017-05-13 09:49:16 +02:00
Marcelo Aquino 95f719b604 Linux: Fix interrupt handler (#835)
Minor fix to configure.
2017-05-11 15:20:57 +02:00
Marcelo Aquino fa673bdb3e Linux: Fix rfm69 power level build error (#829) 2017-04-28 19:11:41 +02:00
Marcelo Aquino 66ff5b2880 Linux: Add support for RFM69 (#823) 2017-04-19 22:40:21 +02:00
Marcelo Aquino 4c31e22d6f Restructure RPi files (#827)
- Restructure SPi files for linux and RPi
- Update RPi revision detection (#826)
2017-04-19 22:03:10 +02:00
Olivier 26c237adad Restructure HAL files (arch) (#820) 2017-04-17 20:33:08 +02:00
freynder b4b5eb52e8 Corrections for stm32f1 serial communication (#821)
- use MY_SERIALDEVICE in hwInit
- disable use of MY_SERIALDEVICE.flush() since the current STM32duino
  implementation performs a reset instead of an actual flush.
2017-04-10 23:11:21 +02:00
Embedded Innovation bffc87fe93 Fix clear pending ints for AVR (#816)
Support full AVR range
2017-04-03 21:08:10 +02:00
Dustin aac4562ab0 Clear interrupt flag based on the interrupt used (#815)
The previous code would clear the proper interrupt flag assuming
interrupt1 was INT0 and interrupt2 was INT1. If interrupt1 was INT1 or
interrupt2 was INT0, the sleep bug would be triggered.
2017-04-03 08:53:05 +02:00
Olivier 818f887926 Polishing code (#803) 2017-04-02 20:03:59 +02:00
Embedded Innovation f84960dc28 Fix watchdog sleep calculation (#814)
Round requested sleep time up to next multiple of 16ms, to sleep at
least requested time.
Sleep time of 0 will return immediately.
Fixed watchdog sleep time calculation. AVR libc watchdog time
implementation is inconsistent, and requires larger flash/ram usage.
2017-04-02 19:49:57 +02:00
Patrick Fallberg 7e6db413c7 Security personalizer rewritten (#794)
* Removed ability to lock data section
* Introduced "guided mode" to simplify process
* Refactored the sketch to be less monolithic
* Print details and instructions in tables
* Use device unique ID as serial when
* Calculate and store personalization checksum
* Print serial in a copy+paste friendly manner (fixes #804)
* Clarify meaning of UART confirmation (fixes #805)
2017-04-02 15:37:21 +02:00
Embedded Innovation 3350d79fe6 AVR sleep with external interrupts fixes (#813)
Fixing #812, #811, #809
2017-04-01 15:05:57 +02:00
Olivier b132a8a81e Transport update (#722)
* Major transport rework

* Adjust signal report calculations

* Minor driver optimizations

* Implement sanity check in legacy RFM69 driver

* Additional RFM69 rework

* RFM95 encryption

* Polishing
2017-03-28 20:31:08 +02:00
Olivier 63b8d935c8 Fix RFM95 driver (RPi) (#800) 2017-03-26 11:30:54 +02:00
Olivier cde5d8f7c3 Add STM32F1 HW support (#795) 2017-03-25 20:01:31 +01:00
Marcelo Aquino 72926527be Linux: Configure script update (#797)
Incorporates #756
- Documentation improvements.
- Fix bash warning.
2017-03-21 19:42:58 +01:00
Dustin ef42b3b534 MQTT Client Retain Feature (#793)
Optionally allow MQTT client to publish specific messages with
the retain flag set.

default/current behavior should not be impacted.
2017-03-21 14:47:07 +01:00
Olivier 61a415c422 Code cleanup (#787)
* Cleanup Core

* SAMD adjustments
2017-03-15 19:05:17 +01:00
Olivier 481bd367f3 Add function to retrieve unique ID (if present) (#780) 2017-03-14 18:54:32 +01:00
Soef e7ae5d144e UDP/TCP client mode repaired (#766) 2017-03-07 18:55:40 +01:00
Olivier 7824e12823 I2C eeprom write fix for SAMD (#786)
* I2C eeprom write fix for samd

* Implement extEEPROM library for SAMD
2017-03-06 16:45:58 +01:00
Frédéric FRANCE 7358521566 Fix typo in README (#778) 2017-03-01 20:04:17 +01:00
Olivier 9ecb78598b Calling WiFi.config() before WiFi.begin() (#772) 2017-02-13 07:17:43 +01:00
Thomas Mørch a34f2e518e Added pin setup for RFM69 reset / dio5 (#768) 2017-02-07 15:59:55 +01:00
Olivier fd417b66b2 Update doxygen (#767) 2017-02-03 21:32:53 +01:00
Patrick Fallberg 91cb61b19e Fix doxygen problem in SPI.h 2017-02-02 10:00:29 +01:00
Olivier 4380d6618f Workaround for AVR-specific compiler issue (#759) 2017-02-01 20:45:42 +01:00
Olivier b69bba485f Revert "Reduce memory footprint" (#763) 2017-01-31 22:31:00 +01:00
FotoFieber 09de6d8075 Reduce memory footprint (#762)
Allows to run this sketch on an AVR 328 with
all sensors enabled.

Changes:
- use F() macro
- use msg_generic instead of individual variables
2017-01-30 16:48:47 +01:00
Olivier eeb880957c Bump version to 2.2.0-beta (#754) 2017-01-19 19:13:09 +01:00
Olivier c90ff65b53 MySensors 2.1.1 release (#746) 2017-01-17 23:58:02 +01:00
Olivier 7abbfd7b47 Merge Master into Dev (#745)
* Fix spi flash error when compiling in Arduino IDE 1.6.6

* Bump minor version

* Fixed "invalid suffix on literal" warning

* Fix addressing bug in _doSign bitfield

* 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.

* 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.

* Backport of bugfix (#259) in repeaters when forwarding signed messages

* Bumped version to 1.5.2

* Corrected doSign variable name (was _doSign)

* Bumped version to 1.5.3

* Add NULL termination to payloads

Messages addressed to "this" node, will have a null char
appended to the payload after message verification is
done, because some "getters" assume the message being a
string.
2017-01-17 23:23:02 +01:00
Olivier c2dfedc1a9 Revert "Bump version to 2.2.0-beta" (#744) 2017-01-17 22:44:11 +01:00
Olivier 6bad2c721b Consolidate open PRs for bugfix release (#741) 2017-01-16 20:36:15 +01:00
Olivier e66989138b Fix signing presentation bug (#740) 2017-01-16 19:49:12 +01:00
Olivier 815084b4fa AVR: Restrict fast pin function use (#739) 2017-01-15 20:10:15 +01:00
Olivier 952edf7ed7 Rename MyHwATmega328 to MyHwAVR (#738) 2017-01-15 18:10:15 +01:00