Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Dec 25, 2019
2 parents 27bcc29 + 23a78e9 commit 7138ddd
Show file tree
Hide file tree
Showing 71 changed files with 2,367 additions and 575 deletions.
3 changes: 3 additions & 0 deletions BUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
| USE_MP3_PLAYER | - | - | - | - | x | - | - |
| USE_AZ7798 | - | - | - | - | - | - | - |
| USE_PN532_HSU | - | - | - | - | x | - | - |
| USE_RDM6300 | - | - | - | - | x | - | - |
| USE_IBEACON | - | - | - | - | x | - | - |
| USE_GPS | - | - | - | - | - | - | - |
| USE_ZIGBEE | - | - | - | - | - | - | - |
| | | | | | | | |
| USE_IR_REMOTE | - | - | x | x | x | x | x |
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In addition to the [release webpage](https://github.com/arendst/Tasmota/releases

## Development

[![Dev Version](https://img.shields.io/badge/development%20version-v7.2.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Dev Version](https://img.shields.io/badge/development%20version-v8.1.x.x-blue.svg)](https://github.com/arendst/Tasmota)
[![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://thehackbox.org/tasmota/)
[![Build Status](https://img.shields.io/travis/arendst/Tasmota.svg)](https://travis-ci.org/arendst/Tasmota)

Expand Down Expand Up @@ -68,6 +68,11 @@ See [wiki migration path](https://tasmota.github.io/docs/#/Upgrading?id=migratio
4. Migrate to **Sonoff-Tasmota 6.x**
5. Migrate to **Tasmota 7.x**

--- Major change in parameter storage layout ---

6. Migrate to **Tasmota 8.1**
7. Migrate to **Tasmota 8.x**

## Support Information

<img src="https://user-images.githubusercontent.com/5904370/68332933-e6e5a600-00d7-11ea-885d-50395f7239a1.png" width=150 align="right" />
Expand Down
57 changes: 19 additions & 38 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# RELEASE NOTES

### Sonoff-Tasmota is now Tasmota

## Migration Information

See [migration path](https://tasmota.github.io/docs/#/Upgrading?id=migration-path) for instructions how to migrate to a major version. Pay attention to the following version breaks due to dynamic settings updates:
Expand All @@ -14,7 +12,12 @@ See [migration path](https://tasmota.github.io/docs/#/Upgrading?id=migration-pat
4. Migrate to **Sonoff-Tasmota 6.x**
5. Migrate to **Tasmota 7.x**

Only this version will support fallback from version 8.x.
--- Major change in parameter storage layout ---

6. Migrate to **Tasmota 8.1**
7. Migrate to **Tasmota 8.x**

While fallback or downgrading is common practice it was never supported due to Settings additions or changes in newer releases. Starting with release **v8.1.0 Doris** the Settings are re-allocated in such a way that fallback is only allowed and possible to release **v7.2.0 Constance**. Once at v7.2.0 you're on your own when downgrading even further.

## Supported Core versions

Expand Down Expand Up @@ -49,38 +52,16 @@ The following binary downloads have been compiled with ESP8266/Arduino library c

## Changelog

### Version 7.2.0 Constance

- Change Exception reporting removing exception details from ``Status 1`` and consolidated in ``Status 12`` if available
- Change HTTP CORS from command ``SetOption73 0/1`` to ``Cors <cors_domain>`` allowing user control of specific CORS domain by Shantur Rathore (#7066)
- Change GUI Shutter button text to Up and Down Arrows based on PR by Xavier Muller (#7166)
- Change amount of supported DHT sensors from 3 to 4 by Xavier Muller (#7167)
- Change some Settings locations freeing up space for future single char allowing variable length text
- Change tasmota-basic.bin and FIRMWARE_BASIC to tasmota-lite.bin and FIRMWARE_LITE
- Change basic version string to lite (#7291)
- Fix flashing H801 led at boot by Stefan Hadinger (#7165, #649)
- Fix duplicated ``Backlog`` when using Event inside a Backlog by Adrian Scillato (#7178, #7147)
- Fix Gui Timer when using a negative zero offset of -00:00 by Peter Ooms (#7174)
- Fix DeepSleep in case there is no wifi by Stefan Bode (#7213)
- Fix Fade would ignore ``savedata 0`` and store to flash anyways (#7262)
- Fix Arduino IDE compile error (#7277)
- Fix restore ShutterAccuracy, MqttLog, WifiConfig, WifiPower and SerialConfig (#7281)
- Fix no AP on initial install (#7282)
- Fix failing downgrade (#7285)
- Add command ``SerialConfig 0..23`` or ``SerialConfig 8N1`` to select Serial Config based in PR by Luis Teixeira (#7108)
- Add command ``Sensor34 9 <weight code>`` to set minimum delta to trigger JSON message by @tobox (#7188)
- Add rule var ``%topic%`` by Adrian Scillato (#5522)
- Add rule triggers ``tele-wifi1#xxx`` by Adrian Scillato (#7093)
- Add SML bus decoder syntax support for byte order by Gerhard Mutz (#7112)
- Add experimental support for stepper motor shutter control by Stefan Bode
- Add optional USE_MQTT_TLS to tasmota-minimal.bin by Bohdan Kmit (#7115)
- Add save call stack in RTC memory in case of crash, command ``Status 12`` to dump the stack by Stefan Hadinger
- Add Home Assistant force update by Frederico Leoni (#7140, #7074)
- Add Wifi Signal Strength in dBm in addition to RSSI Wifi Experience by Andreas Schultz (#7145)
- Add Yaw, Pitch and Roll support for MPU6050 by Philip Barclay (#7058)
- Add reporting of raw weight to JSON from HX711 to overcome auto-tare functionality by @tobox (#7171)
- Add Zigbee support for Xiaomi Aqara Vibration Sensor and Presence Sensor by Stefan Hadinger
- Add Shutter functions ramp up/down and MQTT reporting by Stefan Bode
- Add fallback support from version 8.x
- Add restriction if fallback firmware is incompatible with settings resulting in unreachable device
- Add support for DHT12 Temperature and Humidity sensor by Stefan Oskamp
### Version 8.1.0 Doris

- Change Settings text handling allowing variable length text within a total text pool of 699 characters
- Change Smoother ``Fade`` using 100Hz instead of 20Hz animation (#7179)
- Change number of rule ``Var``s and ``Mem``s from 5 to 16 (#4933)
- Change number of ``FriendlyName``s from 4 to 8
- Add commands ``WebButton1`` until ``WebButton16`` to support user defined GUI button text (#7166)
- Add support for max 150 characters in most command parameter strings (#3686, #4754)
- Add support for GPS as NTP server by Christian Baars and Adrian Scillato
- Add support for ``AdcParam`` parameters to control ADC0 Moisture formula by Federico Leoni (#7309)
- Add Zigbee coalesce sensor attributes into a single message
- Add Zigbee better support for Xiaomi Double Switch and Xiaomi Vibration sensor
- Add Deepsleep start delay based on Teleperiod if ``Teleperiod`` differs from 10 or 300
39 changes: 39 additions & 0 deletions lib/ArduinoNTPd/NTPPacket.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* File: NTPPacket.cpp
* Description:
* NTP packet representation.
* Author: Mooneer Salem <[email protected]>
* License: New BSD License
*/

#include "NTPPacket.h"

void NtpPacket::swapEndian()
{
reverseBytes_(&rootDelay);
reverseBytes_(&rootDispersion);
reverseBytes_(&referenceTimestampSeconds);
reverseBytes_(&referenceTimestampFraction);
reverseBytes_(&originTimestampSeconds);
reverseBytes_(&originTimestampFraction);
reverseBytes_(&receiveTimestampSeconds);
reverseBytes_(&receiveTimestampFraction);
reverseBytes_(&transmitTimestampSeconds);
reverseBytes_(&transmitTimestampFraction);
}

void NtpPacket::reverseBytes_(uint32_t *number)
{
char buf[4];
char *numberAsChar = (char*)number;

buf[0] = numberAsChar[3];
buf[1] = numberAsChar[2];
buf[2] = numberAsChar[1];
buf[3] = numberAsChar[0];

numberAsChar[0] = buf[0];
numberAsChar[1] = buf[1];
numberAsChar[2] = buf[2];
numberAsChar[3] = buf[3];
}
75 changes: 75 additions & 0 deletions lib/ArduinoNTPd/NTPPacket.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* File: NTPPacket.h
* Description:
* NTP packet representation.
* Author: Mooneer Salem <[email protected]>
* License: New BSD License
*/

#ifndef NTP_PACKET_H
#define NTP_PACKET_H

#include "Arduino.h"


/*
* Contains the data in a typical NTP packet.
*/
struct NtpPacket
{
static const int PACKET_SIZE = 48;

unsigned char leapVersionMode;

unsigned int leapIndicator() const { return leapVersionMode >> 6; }
void leapIndicator(unsigned int newValue) { leapVersionMode = (0x3F & leapVersionMode) | ((newValue & 0x03) << 6); }

unsigned int versionNumber() const { return (leapVersionMode >> 3) & 0x07; }
void versionNumber(unsigned int newValue) { leapVersionMode = (0xC7 & leapVersionMode) | ((newValue & 0x07) << 3); }

unsigned int mode() const { return (leapVersionMode & 0x07); }
void mode(unsigned int newValue) { leapVersionMode = (leapVersionMode & 0xF8) | (newValue & 0x07); }

char stratum;
char poll;
char precision;
uint32_t rootDelay;
uint32_t rootDispersion;
char referenceId[4];
uint32_t referenceTimestampSeconds;
uint32_t referenceTimestampFraction;
uint32_t originTimestampSeconds;
uint32_t originTimestampFraction;
uint32_t receiveTimestampSeconds;
uint32_t receiveTimestampFraction;
uint32_t transmitTimestampSeconds;
uint32_t transmitTimestampFraction;

/*
* Rearranges bytes in 32 bit values from big-endian (NTP protocol)
* to little-endian (Arduino/PC), or vice versa. Must be called before
* modifying the structure or sending the packet.
*/
void swapEndian();

/*
* Returns packet as a char array for transmission via network.
* WARNING: modifying the return value is unsafe.
*/
const char *packet() { return (const char*)this; }

/*
* Copies packet buffer to packet object.
*/
void populatePacket(const char *buffer)
{
memcpy(this, buffer, PACKET_SIZE);
}
private:
/*
* Reverses bytes in a number.
*/
void reverseBytes_(uint32_t *number);
};

#endif // NTP_PACKET_H
79 changes: 79 additions & 0 deletions lib/ArduinoNTPd/NTPServer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* File: NTPServer.cpp
* Description:
* NTP server implementation.
* Author: Mooneer Salem <[email protected]>
* License: New BSD License
*/


#include <WiFiUdp.h>

#include "NTPPacket.h"
#include "NTPServer.h"

#define NTP_PORT 123
#define NTP_TIMESTAMP_DIFF (2208988800) // 1900 to 1970 in seconds

bool NtpServer::beginListening()
{
if (timeServerPort_.begin(NTP_PORT)){
return true;
}
return false;
}

bool NtpServer::processOneRequest(uint32_t utc, uint32_t millisecs)
{
// We need the time we've received the packet in our response.
uint32_t recvSecs = utc + NTP_TIMESTAMP_DIFF;
double recvFractDouble = (double)millisecs/0.00023283064365386963; // millisec/((10^6)/(2^32))
uint32_t recvFract = (double)recvFractDouble; //TODO: really handle this!!!
bool processed = false;

int packetDataSize = timeServerPort_.parsePacket();
if (packetDataSize && packetDataSize >= NtpPacket::PACKET_SIZE)
{
// Received what is probably an NTP packet. Read it in and verify
// that it's legit.
NtpPacket packet;
timeServerPort_.read((char*)&packet, NtpPacket::PACKET_SIZE);
// TODO: verify packet.

// Populate response.
packet.swapEndian();
packet.leapIndicator(0);
packet.versionNumber(4);
packet.mode(4);
packet.stratum = 2; // I guess stratum 1 is too optimistic
packet.poll = 10; // 6-10 per RFC 5905.
packet.precision = -21; // ~0.5 microsecond precision.
packet.rootDelay = 0; //60 * (0xFFFF / 1000); // ~60 milliseconds, TBD
packet.rootDispersion = 0; //10 * (0xFFFF / 1000); // ~10 millisecond dispersion, TBD
packet.referenceId[0] = 'G';
packet.referenceId[1] = 'P';
packet.referenceId[2] = 'S';
packet.referenceId[3] = 0;
packet.referenceTimestampSeconds = utc;
packet.referenceTimestampFraction = recvFract;
packet.originTimestampSeconds = packet.transmitTimestampSeconds;
packet.originTimestampFraction = packet.transmitTimestampFraction;
packet.receiveTimestampSeconds = recvSecs;
packet.receiveTimestampFraction = recvFract;

// ...and the transmit time.
// timeSource_.now(&packet.transmitTimestampSeconds, &packet.transmitTimestampFraction);

// Now transmit the response to the client.
packet.swapEndian();
timeServerPort_.beginPacket(timeServerPort_.remoteIP(), timeServerPort_.remotePort());
for (int count = 0; count < NtpPacket::PACKET_SIZE; count++)
{
timeServerPort_.write(packet.packet()[count]);
}
timeServerPort_.endPacket();
processed = true;
}

return processed;
}
35 changes: 35 additions & 0 deletions lib/ArduinoNTPd/NTPServer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* File: NTPServer.h
* Description:
* NTP server implementation.
* Author: Mooneer Salem <[email protected]>
* License: New BSD License
*/

#ifndef NTP_SERVER_H
#define NTP_SERVER_H

class NtpServer
{
public:
NtpServer(WiFiUDP Port)
{
timeServerPort_=Port;
}

/*
* Begins listening for NTP requests.
*/
bool beginListening(void);


/*
* Processes a single NTP request.
*/
bool processOneRequest(uint32_t utc, uint32_t millisecs);

private:
WiFiUDP timeServerPort_;
};

#endif // NTP_SERVER_H
28 changes: 27 additions & 1 deletion tasmota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,40 @@

## Released

### 8.1.0 20191225

- Release

### 8.0.0.3 20191224

- Version bump due to internal Settings change

### 8.0.0.2 20191223

- Changed Settings variable namings
- Change number of ``FriendlyName``s from 4 to 8
- Add Zigbee better support for Xiaomi Double Switch and Xiaomi Vibration sensor
- Add support for ``AdcParam`` parameters to control ADC0 Moisture formula by Federico Leoni (#7309)
- Add commands ``WebButton1`` until ``WebButton16`` to support user defined GUI button text (#7166)

### 8.0.0.1 20191221

- Change Settings text handling allowing variable length text within a total text pool of 699 characters
- Change Smoother ``Fade`` using 100Hz instead of 20Hz animation (#7179)
- Change number of rule ``Var``s and ``Mem``s from 5 to 16 (#4933)
- Add support for max 150 characters in most command parameter strings (#3686, #4754)
- Add support for GPS as NTP server by Christian Baars and Adrian Scillato
- Add Zigbee coalesce sensor attributes into a single message
- Add Deepsleep start delay based on Teleperiod if ``Teleperiod`` differs from 10 or 300

### 7.2.0 20191221

- Release
- Change basic version string to lite (#7291)
- Fix Arduino IDE compile error (#7277)
- Fix restore ShutterAccuracy, MqttLog, WifiConfig, WifiPower and SerialConfig (#7281)
- Fix no AP on initial install (#7282)
- Fix failing downgrade (#7285)
- Change basic version string to lite (#7291)

### 7.1.2.6 20191214

Expand Down
Loading

0 comments on commit 7138ddd

Please sign in to comment.