Commit Graph
102 Commits
Author SHA1 Message Date
d00616 aabddc841c NRF5 ESB fix Errata #78,#102,#106 (#995) 2017-11-18 17:02:38 +01:00
Mikael Falkvidd 1e3305959e BCM driver: include inttypes (#983)
This makes it possible to compile the Raspberry Pi gateway on
Raspbian 9 (stretch), even without adding
--extra-cxxflags="-D__STDC_FORMAT_MACROS"
(as was suggested in
https://github.com/mysensors/MySensors/issues/955 but was
insufficient for remediating this problem)

The compile problem was inadvertently introduced in
2d5404de9.

This change fixes the problem discussed in
https://github.com/mysensors/MySensors/issues/980
2017-11-17 21:16:01 +01:00
tekka d44ecd95dd RF24: Fix logical operator (#990) 2017-11-12 11:12:06 +01:00
tekka 3830c5dde0 RFM69: Add missing SPI namespace (#987) 2017-11-11 18:26:14 +01:00
tekka 4f0a4ee021 Use dedicated namespace for radio SPI (#985) 2017-11-11 15:59:54 +01:00
tekka d43c755508 Fix RFM95 reset (#982)
I've verified that the datasheet says to go low, and checked that the commit history does not indicate a reason for doing otherwise.
2017-11-10 18:23:36 +01:00
d00616 0042cd4bee NVM: consideration of SoftDevice memory layout (#977) 2017-11-07 21:54:00 +01:00
Patrick Fallberg 2d5404de97 CppCheck cleanup (#975)
* Add support for inline cppcheck suppressions
* Clean out all known cppcheck issues
* Terminate toll-gate on found cppcheck issues
2017-11-07 20:37:36 +01:00
tekka e2ac85afbb Reshuffle arch files (#974) 2017-11-06 21:24:38 +01:00
tekka b892aef6c3 Jenkins: Add STM32F1 support (#972) 2017-11-05 14:19:42 +01:00
tekka 1f07d7eafe Update debug message table (#965) 2017-10-30 20:22:50 +01:00
tekka e6cef8ba63 Implement RFM95 sanity check (#963) 2017-10-29 15:08:39 +01:00
d00616 8cb9b26920 NRF24 disable DYN_ACK support (#940) 2017-10-01 22:39:09 +02:00
d00616 1b1cf8ff9c Nrf5 improvements (#938)
* Fix NRF5_ESB_readMessage, allways enable radio

* NRF5: fixes and improvements

- Compiles with arduino core for nRF52 (primo)
  MY_RADIO_NRF5_ESB stays unsupported with primo!

- Split ACK negation flag into
    MY_NRF5_ESB_REVERSE_ACK_TX
    MY_NRF5_ESB_REVERSE_ACK_RX

- MY_RADIO_NRF5_ESB changes to act more than NRF24

- MY_RADIO_NRF5_ESB better support for powerdown/standby

- Moved initialization from MyMainNRF5 to hwInit()
2017-09-30 22:55:55 +02:00
Olivier 0ed558f1d0 Make debug prints portable (#929) 2017-09-17 20:54:20 +02:00
Patrick Fallberg df34c00118 Skip check personalization with simple passwd flag (#915)
Personalization does not need validation if the simple password
security flag is set.

Fixes #914
2017-08-29 09:32:23 +02:00
Marcelo Aquino d291a3661b RPi: Fix GPIO Layout detection (#895) (#906) 2017-08-12 08:58:02 -03:00
bilbolodz d17b9dd6f1 Added posibility to use non standard SPI Flash (#899)
Added possibility to tune flash commands and parameters
in case off use non standard SPI flash for OTA
2017-08-03 09:01:05 +02:00
Patrick Fallberg f3ab329ad3 Refactor the Doxygen structure (#880) 2017-07-31 18:42:26 +02:00
Krister W 8f58b18e1a I2C EEPROM support for OTA using dual Optiboot #802 (#834)
* Added support for I2C EEPROM OTA

* EEPROM OTA now uses extEEPROM as driver

* Compiler warning fix

* Style check fixes

* Fix doxygen warnings of I2CEeprom

* Use bool instead of boolean in I2CEeprom shim

* Fix re-merged style problem
2017-07-24 21:32:47 +02:00
Mikael Falkvidd git@mjo.se b85c11c383 Move pubsubclient files to PubSubClient (case sensitive) 2017-07-24 15:01:20 +02:00
Mikael Falkvidd a941827157 Use bool instead of boolean in drivers (#888)
In the Arduino IDE, boolean is an alias for bool.
The Arduino IDE might deprecate boolean in the future. See
https://github.com/arduino/Arduino/issues/4673 for details.

Command:
find drivers -type f | xargs sed -i 's/boolean/bool/g'
2017-07-05 16:23:27 +02:00
Olivier 4820475e5c NRF5: Enable critical section (#879) 2017-06-13 18:49:14 +02:00
Rainer Clasen 59337b19fe Memory optimizations in signing (#874)
* Sha256 driver cosmetics

cosmetic cleanups:
- use actual define that was used to allocate the array
- remove unused file globals

* Save memory by eliminating sha256_hash array

eliminated sha256_hash array to save memory. Instead pass the
Sha256Class result pointer.

There seems to be no use for the extra sha256_hash array as it was
zeroed exactly at the same time, the Sha256Class result was invalidated
(by calling signerSha256Init)

If the result needs to stay around while another sha is calculated,
it's better to have the user taking care of this.

* Moved hmac methods and buffers to separate class

This allows saving the buffer memory if no hmac is needed ... eg. with
the public Signing API.
2017-06-07 08:25:56 +02:00
Marcelo Aquino 28c4f3f19e Signing improvements package (#871)
* Signing support with MAX_PAYLOAD>32

Support in the signing backends to handle configurations
where MAX_PAYLOAD is more than 32 bytes.

Fixes #748

* Support big message signatures

Support for signing messages larger than 32 bytes.
This is not fully testable with the current version of
the library but the change would add theoretical support
for signing any sized messages.

Fixes #749

* Have gw properly indicate whitelisting preferences

If the gateway hold a signing whitelist, inform all
nodes of this requirement and not just nodes that hold
whitelists themselves.

Fixes #806

* Harden security

The flag MY_SIGNING_GW_REQUEST_SIGNATURES_FROM_ALL
has been removed. Gateway will now request signatures
from everyone by default.
In addition to this, no nodes in the network will allow
clearing of signing/whitelisting preferences by OTA
commands by default.
If the old behaviour is needed (suitable for gradual
signing roll out and development purposes) a new flag,
MY_SIGNING_WEAK_SECURITY can be set.

Fixes #807

* Signing debug messages rewritten

All signing related debug has been rewritten to
better match other core debug printouts.
Also, backends are updated to have a smaller
implementation delta.

* Simplified signing option implemented

Enable by MY_SIGNING_SIMPLE_PASSWD. Signing, and signing requirements
will be enabled, as will encryption. Whitelisting is optional.
The value provided to MY_SIGNING_SIMPLE_PASSWD is used as HMAC and AES
key. Whitelists use the first 8 bytes of the password and the ninth
byte from the node ID as serial.
Password is required to be at least 8 characters wide. It is zero
padded if it is not long enough to cover the AES (16 bytes) and HMAC
(32 bytes) keys. It is not recommended to have a password shorter than
32 bytes, and there is no need for a password longer than 32 bytes.

* Add documentation section for signing debug

* Add nRF5 encryption to simple signing option

* Restructure MySigning documentation

* Minor fixes for Linux
2017-05-31 17:13:29 +02:00
Olivier 60aab1b87b Fix ext. EEPROM update() (#866) 2017-05-27 21:13:30 +02:00
Olivier b5595e870d Teensy3: Define default radio pins (#857) 2017-05-21 22:22:01 +02:00
Olivier b74805251e Fix RFM69 driver (#855) 2017-05-21 21:39:44 +02:00
Marcelo Aquino fb3d936d4c Linux: Binds to MY_IP_ADDRESS in client mode (#849) 2017-05-21 14:27:22 +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
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 818f887926 Polishing code (#803) 2017-04-02 20:03:59 +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
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
Olivier 61a415c422 Code cleanup (#787)
* Cleanup Core

* SAMD adjustments
2017-03-15 19:05:17 +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
Patrick Fallberg 91cb61b19e Fix doxygen problem in SPI.h 2017-02-02 10:00:29 +01:00
Olivier 815084b4fa AVR: Restrict fast pin function use (#739) 2017-01-15 20:10:15 +01:00
Marcelo Aquino 2e0f6b6229 Linux: Add support for SPIDEV (#734)
RPi and Linux refactor.

Add GPIO Sysfs for GPIO operations.

Update configure script.

Fix some cppcheck warnings.

Add serial emulation that prints to stdout.

Fix some file headers.
2017-01-14 23:50:21 +01:00