Commit Graph

264 Commits (cb7213a09cfe0f93ec8e2e707f2ba83fcb2aea34)

Author SHA1 Message Date
Michael Zanetti ea73d28213 Fix node type parsing
Parsing of NodeTypeEndDevice and NodeTypeRouter were swapped.
2022-08-30 22:48:19 +02:00
jenkins b9ff17ace8 Merge PR #59: NXP backend: Fix release file parsing and allow multiple release files as list 2022-08-19 15:41:04 +02:00
Simon Stürz 7acb35d11c Fix release file parsing and allow multiple release files as list 2022-08-09 14:25:45 +02:00
Michael Zanetti ebf004af01 Implement Electricalmeasurement server command handling 2022-07-04 14:08:44 +02:00
jenkins a5d49d7b64 Merge PR #57: Implement commands for metering cluster 2022-06-30 15:04:00 +02:00
jenkins 50e329b1ce Merge PR #56: Add Time cluster implementation 2022-06-30 15:03:58 +02:00
jenkins 2883080413 Merge PR #55: Fix a crash if the controller takes too long to start 2022-06-30 15:03:57 +02:00
Michael Zanetti 92cdc4bc84 Implement commands for metering cluster
Main reasoning behind this is actually that Tuya devices seem
to send a CancelMessage command every other minute and are currently
spamming the log with unhandled ZCL indication warnings.

Instead of just silencing the warning (which is very useful most of the times)
I decided to complete the implementation of the metering cluster and
actually make it a handled ZCL indication.
2022-06-20 23:30:18 +02:00
Michael Zanetti 725272e1fa Add Time cluster implementation 2022-06-20 00:03:50 +02:00
Michael Zanetti e9d594ee5b Fix a crash if the controller takes too long to start
This may happen on very rare occations after a nymea restart
if the controller is taking too long to initialize but still succeeds
in the end. Also increases the timeout for the procedure.
2022-06-08 23:30:05 +02:00
jenkins 3bd8787e41 Merge PR #54: Make NXP update provider independent from the chip module type 2022-06-07 23:06:20 +02:00
jenkins 0b92eb4968 Merge PR #53: Explicitly stop the ZCL timeout timer 2022-06-07 23:06:19 +02:00
jenkins d8c74fd52e Merge PR #52: Fix a debug message 2022-06-07 23:06:17 +02:00
jenkins 59025c0c2e Merge PR #50: Fix a typo in the illuminancemeasurement cluster 2022-06-07 23:06:16 +02:00
jenkins 19d262b459 Merge PR #49: Add IAS WD cluster 2022-06-07 23:06:15 +02:00
Simon Stürz 874c55f809 Make NXP update provider independent from the chip module type 2022-05-17 14:55:34 +02:00
Michael Zanetti c90ed3ab09 Fix a typo in the illuminancemeasurement cluster 2022-05-13 11:22:07 +02:00
Michael Zanetti 365386ea71 Add IAS WD cluster 2022-05-13 11:21:20 +02:00
Michael Zanetti d210d696e0 Add Battery Alarm State support to PowerConfiguration cluster 2022-05-13 11:20:49 +02:00
Michael Zanetti fd12d0518b Explicitly stop the ZCL timeout timer
Also don't use a QueuedConnection, as it's not guaranteed the
sender will still live on by the time slot is called.
2022-05-12 17:33:35 +02:00
Michael Zanetti e0bf02b115 Fix a debug message 2022-05-12 17:11:51 +02:00
jenkins 53bd313766 Merge PR #47: Timeout ZCL replies 2022-04-25 23:53:22 +02:00
jenkins ed87b53d50 Merge PR #46: Fix permit joining duration/remaining signals 2022-04-25 23:53:20 +02:00
jenkins 6de3c8318d Merge PR #45: Fix a crash when ZDO responses come in after the ZDO request timed out 2022-04-25 23:53:19 +02:00
jenkins 07f25a749b Merge PR #44: Add electrical measurement and metering clusters 2022-04-25 23:53:18 +02:00
Michael Zanetti b96f9fa98f Timeout ZCL replies
This is basically the same as #41 does with ZDO replies but for ZCL replies.

Working with a z-stack dongle and a Gewiss binary input device a lot of
timeouts happen during the device interview. While basic device interview
timeouts are caught by the ZDO timeouts, later interview steps like
cluster attribute reading run into the same issue with this device and
the interview process never finishes.
2022-04-25 14:31:10 +02:00
Michael Zanetti 4f63ae01c0 Fix permit joining duration/remaining signals
* Prevent resetting the duration repeatedly by not calling setPermitJoiningState
in the timer any more
* Added signal emissions for when remaining changes in an unexpected manner.
2022-04-23 23:32:35 +02:00
Michael Zanetti c20d14b793 Fix a crash when ZDO requests time out 2022-04-23 12:07:20 +02:00
Jenkins nymea 2af5d1a759 Merge PR #43: Consolidate permit joining timer 2022-03-10 12:33:48 +01:00
Jenkins nymea 8cffe484f6 Merge PR #41: Timeout ZDO replies 2022-03-10 12:33:47 +01:00
Jenkins nymea 9d8efd4317 Merge PR #40: More work on the thermostat cluster 2022-03-10 12:33:46 +01:00
Jenkins nymea 38ee4c97ba Merge PR #39: Simplify cluster inheritance 2022-03-10 12:33:45 +01:00
Jenkins nymea fd5449688d Merge PR #38: Add helpers for mandatory attributes in AnalogInput cluster 2022-03-10 12:33:44 +01:00
Jenkins nymea 1013feaa57 Merge PR #37: Add support for floating point attribute parsing 2022-03-10 12:33:43 +01:00
Jenkins nymea 5ccf077941 Merge PR #36: deConz: Remove unused/redundant firmware version string members 2022-03-10 12:33:42 +01:00
Jenkins nymea edfe29775a Merge PR #35: Fix debug print for ZigbeeNetwork errors 2022-03-10 12:33:41 +01:00
Jenkins nymea cbc25b2949 Merge PR #34: Allow removing uninitialized nodes 2022-03-10 12:33:40 +01:00
Jenkins nymea ea2e1cbf0a Merge PR #33: Add support for TI z-Stack based adapters 2022-03-10 12:33:38 +01:00
Jenkins nymea 728be6ad55 Merge PR #32: Refactor handling of TSNs in ZCL to allow the application using it. 2022-03-10 12:33:37 +01:00
Michael Zanetti 9abcdfcf3d Add electrical measurement and metering clusters
Renamed the SimpleMetering enum to Metering as that's what it is in the Zigbee
Alliance Spec. SimpleMetering seems to come from a NXP document which
isn't complete though and the upstream spec is what matters in the end.
Also adds some cluster ids which are in the Zigbee spec but missing in
the NXP document.
2022-03-08 01:21:52 +01:00
Michael Zanetti 806065ff5c Timeout ZDO replies
I've been observing devices that won't reply to ZDO node descriptor requests,
at least not on the first attempt as well as out-of-spec devices which claim
to have an endpoint x but then won't reply on getting the endpoint descriptor.

I have a Lumi (lumi.sensor_switch.aq2) button here which allows to reproduce
both of those. It will never reply on the first attemt.

Anyhow, it happens that the ZDO, waiting on the data indication never finishes
because there does not seem to be a timeout connected to it and it fails initialisation.
Adding a timeout, the code retries and it seems to succeed on the second attempt.
2022-03-07 12:07:40 +01:00
Michael Zanetti 961008027d Consolidate permit joining timer
Starting/stopping the permit joining duration timer is not something
each backend should do on it's own. So making the timer a private
member of ZigbeeNetwork and taking control over it internally.

Also reduce some logic about the remaining duration by merging the
related methods into one and hiding the "remaining" duration from
backend implementations completely.
2022-03-07 11:22:59 +01:00
Michael Zanetti b84f37e7d8 Add support for TI z-Stack based adapters 2022-03-07 11:22:05 +01:00
Michael Zanetti 88920274da More work on the Thermostat cluster 2022-02-17 01:15:10 +01:00
Michael Zanetti a38e8be190 Simplify ZigbeeCluster inheritance
Instead of having 2 methods (setAttribute and addOrUpdateAttribute)
to allow specific cluster implementations to override behavior,
merge them into one, setAttribute, and use standard C++ syntax for
calling a base class implementation.
2022-02-14 11:23:36 +01:00
Michael Zanetti 7ccbfc3a6d Add helpers for mandatory attributes in AnalogInput cluster 2022-02-14 11:21:55 +01:00
Michael Zanetti 977e31f2ba Add support for floating point attribute parsing 2022-02-14 11:21:41 +01:00
Michael Zanetti 45eb4de576 deConz: Remove unused/redundant firmware version string member variable and functions 2022-01-30 14:06:22 +01:00
Michael Zanetti daae851767 Fix debug print for ZigbeeNetwork errors 2022-01-30 14:03:11 +01:00
Michael Zanetti 14895fc559 Allow removing uninitialized nodes 2022-01-30 14:01:38 +01:00
Michael Zanetti df0b7e9c63 Rafactor handling of TSNs in ZCL to allow the application using it.
This patch separates the transactionSequenceNumber used for sending from the
one received. According to the specification, the transactionSequenceNumber is
not meant to equally increase on both ends, but instead really just be a "random"
number which allows to match a reply to a request. Syncing them on both ends
has the outcome to increase the likelyhood of collisions if a device sends
a notification at the same time we send a request and thus even may wrongly
interpret that incoming command as a reply to the request. In fact, ideally TSNs for
outgoing messages would stay away as far as possible from incoming ones.

The old code additionally had the problem that it would re-use the last received
TSN for outgoing requests, given it used a post-increment when reading
m_transactionSequenceNumber after setting it to the last received TSN.

The new code will use a single static upcounting TSN for all outgoing requests
but will still allow overriding it with a custom TSN of for some reason a certain
device requires a specific TSN (apparently those exist).
It will not do anything with incoming TSNs but forward them now to the application
layer which may decide to use it match its own transactions or to deduplicate packets.

This allows fixing the issue in nymea that remote controls sometimes produce duplicate
pressed events (seen most often with the Tradfri Symfonisk) by discarding commands that
didn't increase the TSN.
2022-01-22 13:51:21 +01:00
Michael Zanetti daa462863b Remove 1 from lib name 2022-01-10 00:35:51 +01:00
Jenkins nymea 09f4f5ef80 Merge PR #26: More work on OnOff, LevelControl and ScenesCluster 2021-12-11 00:30:27 +01:00
Jenkins nymea 6e912af594 Merge PR #25: Remove a duplicate debug print and fix some typos 2021-12-11 00:30:26 +01:00
Jenkins nymea 4c44f314b8 Merge PR #24: Print node manufacturer code 2021-12-11 00:30:25 +01:00
Jenkins nymea d7db4f235d Merge PR #23: Add a clear method to channel mask 2021-12-11 00:30:23 +01:00
Jenkins nymea ec8c13ad33 Merge PR #22: Add support for IAS Zone enrollment 2021-12-11 00:30:22 +01:00
Michael Zanetti a22fdcedde Add manufacturer specific philips cluster 2021-12-07 20:36:24 +01:00
Michael Zanetti 6afc214202 More work on OnOff, LevelControl and ScenesCluster
This alignes the OnOff cluster with the LevelControl cluster in terms
of signal behavior: Previously, the OnOff cluster would fire a generic
commandSent() signal for some commands and specific signals for others.
Effectively forcing the user to connect multiple signals even if only
the command would be of interest.

The LevelControl cluster instead always fired a generic commandSent()
signal and *additionally* more specific signals for parsed parameters.

This changes the OnOff cluster to be in line with the LevelCluster
as and making the API a bit simpler to use when parameters are not of
interest.

Also it completes the specific parsing for all 3 clusters.
2021-12-07 10:14:02 +01:00
Michael Zanetti 9782ad5eac Remove a duplicate debug print and fix some typos 2021-11-06 15:47:29 +01:00
Michael Zanetti 5582b6c599 Print the manufacturer code in the node debug prints 2021-10-22 00:32:37 +02:00
Michael Zanetti b6301ab9c9 Add a clear method to channel mask 2021-10-21 18:47:22 +02:00
Michael Zanetti e7d533b9e8 Add support for IAS Zone enrollment 2021-10-15 17:01:14 +02:00
Jenkins nymea db4961f2af Merge PR #17: Improve node removed behavior 2021-06-30 12:42:39 +02:00
Simon Stürz 2f8af57d4e Add invalid measurment filtering for measurement clusters 2021-05-21 08:54:49 +02:00
Simon Stürz 76d43fc99e Improve node removed behavior 2021-05-11 09:00:13 +02:00
Simon Stürz 5072ad7c1e Add develco profile and manufacturer, implement manufacturer specific cluster methods, improve binary input cluster 2021-04-28 13:39:07 +02:00
Simon Stürz d2f2f8c727 Implement missing deconz firmware parameters and fix configuration. Factory reset works now properly 2021-01-27 14:40:44 +01:00
Simon Stürz a75bf9c18a Rework init process and fix firmware version request to make it work on newest firmware revisions.
Fix firmware version read request
2021-01-25 16:28:23 +01:00
Simon Stürz 16d4bfa0e0 Add serialnumber member to network class and extend deconz backend rectry range 2020-12-18 15:35:32 +01:00
Simon Stürz 1dd3406120 Update IAS Zone cluster 2020-12-15 16:44:06 +01:00
Simon Stürz 108898053e Make default response a gloabl command in the frame control header field 2020-12-15 15:21:39 +01:00
Simon Stürz 1c30c1de8b Implement ZCL default response for clusters and improve ISA zone cluster 2020-12-15 15:17:41 +01:00
Simon Stürz 2edfaa402a Fix buffered message clean up on finished 2020-12-15 09:37:42 +01:00
Simon Stürz e2d5910e30 Fix deconz init interrupion due to timeout or uart flickering and retry 3 times before giving up 2020-12-14 18:49:24 +01:00
Simon Stürz b65386be19 Process firmware ACK packages for NXP networking 2020-12-14 15:04:52 +01:00
Simon Stürz 86db15b8a1 Improve reachable handling and buffered message handling 2020-12-14 14:15:52 +01:00
Simon Stürz 94539c0d02 Add scene cluster basic structure 2020-12-11 18:06:43 +01:00
Simon Stürz 2893f39e61 Improve reachable refresh behaviour 2020-12-10 18:22:03 +01:00
Simon Stürz f57ce01664 Update node initialization and finish the initialization in any case with the given information 2020-12-09 17:20:50 +01:00
Simon Stürz 2ed1487053 Handle network address changes and remove unrecognized nodes from the network once and for all if they show up again 2020-12-09 13:33:03 +01:00
Simon Stürz 85856eaaa8 Fix optional building with or without libudev 2020-12-09 10:58:53 +01:00
Simon Stürz 40d6fdaa90 Move common data process mechanism to network base class 2020-12-09 10:53:33 +01:00
Simon Stürz 3997b5a5de Make udev optional and provide basic cluster information in node object 2020-12-04 14:15:35 +01:00
Simon Stürz 72150b6bfb Make use of TX options in the NXP backend and send permit join to short address broadcast, not group 2020-12-03 10:44:31 +01:00
Simon Stürz 1eed81562a Fix initialization error due to timeout issue and improve debugging 2020-12-02 12:03:44 +01:00
Simon Stürz 4e8254fcb9 Add network node evaluation and readd node if nwk address changed 2020-11-30 17:44:12 +01:00
Simon Stürz 9e3bbc55ca Add warning for occupancy sensor value convertion 2020-11-28 17:05:09 +01:00
Simon Stürz cc725a9533 Improve debug output and add level cluster signals 2020-11-26 18:32:07 +01:00
Simon Stürz 5901dc06b5 Add multistate value cluster 2020-11-26 13:16:53 +01:00
Simon Stürz ae18e793e6 Add multistate output cluster 2020-11-26 13:13:30 +01:00
Simon Stürz 6c2bccd775 Add binary value cluster 2020-11-26 13:08:19 +01:00
Simon Stürz e2ac3a48ea Add binary output cluster 2020-11-26 13:03:50 +01:00
Simon Stürz 6762d0e007 Add binary input cluster 2020-11-26 12:58:52 +01:00
Simon Stürz 8bfdaaae44 Add analog value cluster 2020-11-26 12:53:10 +01:00
Simon Stürz 62b491fca8 Add analog output cluster 2020-11-26 12:47:37 +01:00
Simon Stürz 3854be170e Add analog input cluster 2020-11-26 12:38:47 +01:00
Simon Stürz a651ece1cf Add multistate input cluster and improve internal endpoint initialization 2020-11-26 12:01:26 +01:00
Simon Stürz e245f7c845 Introduce binding management and cleaning 2020-11-25 13:06:31 +01:00
Simon Stürz 61114fc773 Restructure error handling depnding on layer and add MAC layer errors to replies 2020-11-24 18:14:54 +01:00