Commit Graph

517 Commits

Author SHA1 Message Date
Orne Brocaar
438d120fb0 Make gateway state consistent + make stats interval configurable.
This:

* Makes the gateway stats interval configurable (default 30 sec)
* Adds GatewayState type (NEVER_SEEN, OFFLINE, ONLINE)
* Adds gateway state to gateway lists
* Fixes dashboard inconsistencies

Closes #76.
2023-01-11 10:51:53 +00:00
dependabot[bot]
d065df2805
Bump json5 from 1.0.1 to 1.0.2 in /ui (#79)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-11 10:50:06 +00:00
dependabot[bot]
85a064ea5b
Bump tokio from 1.21.1 to 1.23.1 (#78)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.21.1 to 1.23.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.21.1...tokio-1.23.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-11 10:49:32 +00:00
Orne Brocaar
687c3f21ec Add missing <Admin> block around Delete device + format code.
The <Admin> block hides components when the user doesn't have sufficient
permissions to perform an UI action. Without this the 'Delete device'
button was visible, but on click, the user would be redirect to the
login page due to permission issues (API).

Fixes #71.
2023-01-10 16:50:13 +00:00
Orne Brocaar
ac30f68d85 Update .gitignore + re-generate API. 2023-01-10 15:57:06 +00:00
Stian
74b5d1a7ca
Protobuf Java and Kotlin code generation. (#64)
Co-authored-by: Stian Brandt <stian.brandt@it-smurfan.no>
2023-01-10 15:46:04 +00:00
Orne Brocaar
b24ca28adb Fix java_outer_classname for request_log.proto.
See #64.
2023-01-10 15:43:21 +00:00
Orne Brocaar
e5e0514d9f Fix regions regex (UI). 2023-01-09 13:28:08 +00:00
Orne Brocaar
02d66b8a5d Reset registered regions on setup call.
This ensures that each test will reset the regions hashmap.
2023-01-09 13:24:28 +00:00
Orne Brocaar
e78dac316a Fix region config id in gateway list + add link to region. 2023-01-09 12:22:27 +00:00
Orne Brocaar
103e4298fb Add device-profile option to configure region configuration.
By selecting a region configuration, devices using the device-profile
will only stick to the selected region configuration, rather than the
configurations provided by the selected region common-name.

This change also renames the region 'name' option to 'id' in the region
configuration, as well it adds a 'description' to provide a human
readable description, which is used in the drop-down in the UI.

This also fixes the JS API generation. In a previous commit the the
protobuf package was updated, but the latest protobuf compiler no longer
supports generating JS code (this now requires an external plugin). This
has been fixed.

Please note that if you have implemented custom ADR algorithms that are
referring to the 'regionName' key, that you must change this to
'regionConfigId' (see the ADR code example).
2023-01-09 12:04:10 +00:00
Orne Brocaar
6016159c86 Change a.get_ideal_... to Algorithm::get_ideal_...
In the previous change, this method was changed to an associated
function.
2023-01-09 09:49:08 +00:00
Orne Brocaar
0193d783b0 Fix clippy feedback in chirpstack crate. 2023-01-07 20:02:05 +00:00
Orne Brocaar
cee3dd8d9c Fix clippy feedback in lrwn crate. 2023-01-07 19:56:07 +00:00
Orne Brocaar
e6fb1a5bc1 Fix clippy feedback in backend crate. 2023-01-07 19:37:04 +00:00
Orne Brocaar
927a68a436 Bump version to 4.1.3 2022-12-27 11:14:43 +00:00
Orne Brocaar
417179ba54 Fix header z-index issue in UI.
The z-index of the header was set to 2000 because of Leaflet JS zoom
controls going over the header instead of under when scrolling. However,
this caused issues with the notifications and dropdowns (menu and
autocomplete).

Setting the z-index to 1001 is enough to fix the Leaflet JS issues,
without causing other issues.
2022-12-24 10:46:23 +00:00
Orne Brocaar
1813e6a7b2 Fix redis_key implementation. 2022-12-22 21:04:40 +00:00
Orne Brocaar
e2682db6e2 Bump version to 4.1.2 2022-12-16 09:44:47 +00:00
Orne Brocaar
aa9923a60b Handle integration events async of uplink / downlink flow.
Wrapping the handling of integration events in a tokio::spawn should
already have been there, as we do not want to delay the downlink in case
of slow integrations.
2022-12-15 21:33:23 +00:00
Orne Brocaar
fd061d4657 Bump version to 4.1.1 2022-12-13 13:48:42 +00:00
Orne Brocaar
e3fae6260b Make get device-session for phypayload functions update f_cnt.
This fixes the FrmPayload decryption in case of frame-counter rollover
(16lsb) as it was using the f_cnt as sent over the air (16lsb) and not
the full frame-counter (32b).

Before, these functions would return the device-session for the given
uplink PhyPayload (if a matching device-session was found), together
with the full frame-counter. However it would not modify the f_cnt of
the PhyPayload to the full frame-counter making it prone to errors like
the above.
2022-12-13 12:44:00 +00:00
Orne Brocaar
07d4e89a92 Update JS API dependencies to latest versions. 2022-12-13 10:57:54 +00:00
arctic-alpaca
8e7f321e93
[Rust API] Replace relative paths to .proto files with absolute paths (#69) 2022-12-13 10:37:56 +00:00
Orne Brocaar
c874c97c96 Bump version to 4.1.0 2022-12-06 09:36:55 +00:00
TomSievers
8d0c4bf6a8
Emit all fields for json even if they are their default values (#63) 2022-12-06 09:19:40 +00:00
Orne Brocaar
fe3d6d3fdf Re-generate API + update code. 2022-12-05 11:46:36 +00:00
Orne Brocaar
abee88712c Make metadata consistent in protobuf messages. 2022-12-05 11:45:58 +00:00
Orne Brocaar
cb3ab9466e Fix notification z-index. 2022-12-05 11:29:44 +00:00
Orne Brocaar
b130953e31 Update API docker files. 2022-12-05 10:44:46 +00:00
Orne Brocaar
d91e687484 Update to latest Rust and Alpine versions. 2022-12-05 10:00:21 +00:00
Orne Brocaar
364a4ac48c Rename to import_legacy_lorawan_devices_repository.
The lorawan-devices repository structure is going to change and the
latest revisions no longer contain a LICENSE file.

This does mean that the latest data can't be imported and we will be
missing newly added devices and potential bugfixes. However, it does
provide time to work on a better solution.

As requested, TTN and The Things Network is no longer used in the
naming and description.

Closes #61.
2022-11-30 10:17:53 +00:00
Orne Brocaar
dda9d3ffac Fix Redis pipelines for Redis Cluster.
redis::pipe() can't be used with the ClusterClient struct, instead we
must use cluster_pipe() to start the pipeline. This implements a wrapper
which constructs the pipeline based on the used Redis setup.
2022-11-30 08:50:49 +00:00
Orne Brocaar
c1c89d06f8 Bump version to 4.1.0-test.1 2022-11-28 15:17:53 +00:00
dependabot[bot]
2428390e32
Bump loader-utils from 2.0.0 to 2.0.4 in /ui (#66)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.0 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.0...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 12:18:46 +00:00
Orne Brocaar
ec09710b24 Log uplink frames without device match to DevEUI 0000000000000000.
It can be useful to handle uplinks that do not match a DevEUI in a
separate process. This includes DevAddr to DevEUI pointer does not
exist, or DevAddr points to one or multiple DevEUIs, but it does not
pass the MIC check.
2022-11-28 10:59:28 +00:00
Orne Brocaar
963842ef55 Implement api request logging to Redis Streams.
This makes it possible for external services to subscribe (through
Redis) for realtime events. E.g. a create, update or delete device event
could trigger an external synchronization.
2022-11-28 10:59:28 +00:00
Orne Brocaar
84dc8fd333 Bump version to 4.0.5 2022-11-28 10:23:54 +00:00
Orne Brocaar
948ed00b60 Add keep_alive_interval config for MQTT.
In case there is a loadbalancer between ChirpStack and the MQTT broker,
it is useful to have control over the keep-alive messages, to make sure
that the loadbalancer does not drop the connection if there is no
activity. In such a case you want to set the keep_alive_interval to a
lower interval than the loadbalancer timeout.
2022-11-25 12:51:35 +00:00
Orne Brocaar
3a6e359ce1 Fix leafletjs controls floating over header. 2022-11-25 09:22:45 +00:00
Orne Brocaar
e2bdef757c Send ThingsBoard telemetry (f_port, f_cnt, ...) even if object is None. 2022-11-21 09:18:52 +00:00
Orne Brocaar
d98518c5f9 Fix ThingsBoard location and status telemetry. 2022-11-18 11:24:21 +00:00
Orne Brocaar
9fe8ee2474 Fix incorrect splitting of multiple http integration endpoints.
Closes #62.
2022-11-17 13:00:17 +00:00
Orne Brocaar
bfcff17f34 Bump version to 4.0.4 2022-11-15 10:13:35 +00:00
Orne Brocaar
6973e91ade Remove unsetting of device_queue_item.
In case the queue-item does fit the first RX window, but not the second
one, it will be set to None. If this happens, then the
save_downlink_frame step will not add the queue-item ID to the
DownlinkFrame (internal).

Then on txack, ChirpStack is unable to dequeue the payload causing the
payload to stay in the queue.
2022-11-08 15:40:37 +00:00
Orne Brocaar
e2214f9485 Add coding_rate field to LoraDataRate (+ fix 2.4GHz coding-rate).
Per Regional Parameters Specification, the LoRa modulation always uses
coding-rate 4/5, however this is not the case for ISM2400 (which is
currently not covered by the reg. params) in which case coding-rate
4/8LI must be used.

Closes #51.
2022-11-08 15:19:45 +00:00
Orne Brocaar
0ac4ef51e2 Bump version to 4.0.3 2022-11-07 11:40:11 +00:00
Orne Brocaar
6b1cf4f8ba Fix metrics per day interval calculation.
This fixes the issue where after a from DST to non-DST, the timstamp was
not incremented by a full day. As the ts was then truncated to day
precision, this would create a never ending loop.

Example, incrementing 2022-10-30 00:00:00 by days(1) would result in
2022-10-30 23:00:00, trucated to day precision would result in
2022-10-30 00:00:00.

If the date (30) is the same after incrementing by days(1), we increment
by days(2), which in the above example results in 2022-10-31 23:00:00,
truncated to day precision results in 2022-10-31 00:00:00 which is the
desired result.
2022-11-07 11:23:02 +00:00
Orne Brocaar
42d6f62509 Simplify error return. 2022-11-04 14:30:55 +00:00
Orne Brocaar
347ac6fcfa Check if channel is closed. Fix blocking_send error.
In order to properly handle the SendError, we must return the original
error, instead of creating a new anyhow::Error.
2022-11-04 14:29:04 +00:00