Commit Graph

517 Commits

Author SHA1 Message Date
Orne Brocaar
3cf05e8fb9 Fix passive-roaming tx ack and save device-session order.
We first need to save the device-session and then handle the tx ack, as
else we are overwriting the frame-counter increment.
2022-08-26 12:54:46 +01:00
Orne Brocaar
46bc4d6038 Use rf_region_encode module for rf_region in ULMetaData. 2022-08-25 10:43:36 +01:00
Orne Brocaar
75f67f8c5c Use default for Description and do not serialize if empty. 2022-08-25 09:52:54 +01:00
Orne Brocaar
ca2961c7b6 Bump version to 4.0.0-rc.3 2022-08-23 08:59:05 +01:00
Orne Brocaar
63b0af6cf3 Remove owning_ref indirect dep by updating prometheus-client.
The owning_ref crate has a vulnerable. The updated prometheus-client no
longer uses owning_ref as a dependency.
2022-08-22 10:54:33 +01:00
Orne Brocaar
d97da8ed50 Fix c > 64 to c >= 64 typo in channel-mask calculation.
Depending the channel-configuration, this would send three LinkADRReq
mac-commands while the same configuration could be send to the device in
two LinkADRReq mac-commands.
2022-08-21 21:48:27 +01:00
Orne Brocaar
3b297ef221 Replace env. variables in config by localhost for .deb and .rpm
The env. variables are used such that the same configuration can be used
for Docker images, .deb and .rpm packages. However, if installing .deb
or .rpm packages, this can be confusing as executing 'chirpstack -c
/etc/chirpstack' will fail because these environment variables are only
available when using systemctl to start the ChirpStack process
(configured in the .service configuration file).
2022-08-21 21:44:36 +01:00
Orne Brocaar
e917f8ea49 Remove default CA and MQTT cert gen. on install.
In case of mult-server deployments, this can be confusing as each VM
generates different certificate files by default, where all instances
must share the same certificate (or at least CA certificate + key).
The other issue is that the MQTT broker certificate must contain the
correct hostname, which can (most of the times) not automatically be
retrieved. Documentation to generate these certificates can be found
here:

https://www.chirpstack.io/docs/guides/mosquitto-tls-configuration.html
2022-08-21 19:56:49 +01:00
Orne Brocaar
424306ab41 Update cpufeatures crate. This fixes an incorrect avx2 check.
In some scenarios, this check returned true while the avx2 extension was
not available (e.g. QEMU emulated CPU).

See for more details: https://github.com/RustCrypto/hashes/pull/386.
2022-08-18 11:37:03 +01:00
Orne Brocaar
613f4562a2 Add config option to allow unknown gateways. 2022-08-18 10:27:55 +01:00
Orne Brocaar
bf6df9c845 Fix shadowing of rx_info and setting location.
The rx_info value was shadowed, and because of this the location was set
on the cloned value, not the original value, making the location set
useless.
2022-08-14 13:49:00 +01:00
Orne Brocaar
d4337b10ab Bump version to 4.0.0-rc.2 2022-08-11 12:04:21 +01:00
Orne Brocaar
77dc247f66 Fix mac_version -> mac_version().
The first returns the Protobuf integer, the second the generated enum
type. The big difference is that the first .to_string() would convert
the Protobuf integer to the same but then as String type, where the
latter returns something like '1.0.3' which is provided by the
fmt::Display trait implementation by ChirpStack.
2022-08-11 11:38:43 +01:00
Orne Brocaar
ca567ca562 Bump version to 4.0.0-rc.1 2022-08-10 12:36:43 +01:00
Orne Brocaar
1a68080ac0 Fix configfile template. 2022-08-10 11:34:52 +01:00
Orne Brocaar
ba7fc75ee6 Fix clippy warnings. 2022-08-10 11:34:33 +01:00
Orne Brocaar
7868629533 Fix LoRaWAN 1.1 downlink fopts encryption. 2022-08-09 16:33:58 +01:00
Orne Brocaar
2b1bf3b96f Only decode mac-commands for logging if in plaintext.
Please note that for LoRaWAN 1.1.x, mac-commands in the f_opts field are
encrypted. Within the context of the device we can decrypt these, but
within the context of a gateway we can only show these as raw bytes.
2022-08-09 15:29:22 +01:00
Orne Brocaar
fd62076e02 Add plaintext_mac_commands field to up/down frame-log. 2022-08-09 15:28:37 +01:00
Orne Brocaar
cfb4290334 Add missing isDisabled and setSkipFcntCheck switches (UI). 2022-08-09 11:07:32 +01:00
Orne Brocaar
6d62cdb27c Fix generating gRPC documentation (md). 2022-08-08 15:56:01 +01:00
Orne Brocaar
92a710fd1e Fix NewChannelReq for LoRaWAN 2.4GHz freqs. 2022-08-08 11:49:47 +01:00
Orne Brocaar
d31113d61c Include cargo-bitbake in Dockerfile-devel. 2022-08-07 13:39:36 +01:00
Orne Brocaar
e680db3be0 Bump version to 4.0.0-test.18 2022-08-04 17:11:45 +01:00
Orne Brocaar
620ff1a8f9 Add missing channel and rf_chain fields.
This is not used by ChirpStack, but the chirpstack-udp-bridge expects to
receive this information from the ChirpStack Concentratord.
2022-08-04 16:52:01 +01:00
Orne Brocaar
a14adfe20b Bump version to 4.0.0-test.17 2022-08-04 10:27:03 +01:00
Orne Brocaar
672511c696 Implement support for JSON for GW<>NS.
This auto-detects the encoding used by the gateway and stores this
setting such that the commands will be encoded using the same setting.

Closes #2.
2022-08-03 15:19:51 +01:00
Orne Brocaar
3348ccf67d Fix async receiver for passive-roaming HomeNSReq + add debug logs. 2022-08-03 15:18:31 +01:00
Orne Brocaar
7890dc7539 Also match 1.0 and 1.1 strings for MacVersion. 2022-08-01 14:45:43 +01:00
Orne Brocaar
341ac828b0 Bump version to 4.0.0-test.16 2022-08-01 12:59:57 +01:00
Orne Brocaar
d7a4334b77 Fix missing GatewayStats v4_migrate.
This is needed as the gateway_id field has changed from bytes to string
(as the Protobuf JSON mapping encodes bytes to base64).
2022-08-01 12:08:08 +01:00
Orne Brocaar
54d582504f Fix clippy warnings. 2022-08-01 10:24:15 +01:00
Orne Brocaar
edff985ad8 Bump version to 4.0.0-test.15 2022-08-01 10:20:57 +01:00
Orne Brocaar
10d75a1744 Set MQTT persistence to TMP dir instead of CWD. 2022-07-31 13:11:55 +01:00
Orne Brocaar
eee1c4b4b0 Show counter value as rate per aggregation interval. 2022-07-31 13:10:16 +01:00
Orne Brocaar
3ab830f5a0 Change clean_session default + fix re-subscribe.
This changes the clean_session default to false, as only in case of a
persistent session, qos > 0 would be effective. If the client_id is not
set, then ChirpStack will generate a random client_id, which stays the
same during the lifetime of the chirpstack process.

This also implements a subscribe loop, as the client re-connect feature
does not re-subscribe. Even in case of a persistent session there is no
guarantee that the subscription is recovered, as it might have been a
MQTT broker restart. In case the broker stores the sessions in-memory,
the client would re-connect, but without subscriptions.

The (re)subscribe logic is placed outside the on-connected callback, as
the callback function must not block, thus can not wait for the
subscribe result. No the (re)subscribe happens async from the
on-connected.
2022-07-30 13:23:54 +01:00
Orne Brocaar
f58e39e503 Bump version to 4.0.0-test.14 2022-07-28 09:02:54 +01:00
Orne Brocaar
ffa8aa9518 Fix clippy warning. 2022-07-28 08:58:31 +01:00
Orne Brocaar
a53a90b646 Make deduplication_delay configurable. Handle duplicated acks. 2022-07-27 20:19:02 +01:00
Orne Brocaar
35b2f4112d Remove version fix for (lib)clang.
Clang is used by bindgen to generate the quickjs bindings at compile
time.
2022-07-27 12:00:11 +01:00
Orne Brocaar
7a7d3dbd4e Add missing LoRa 2.4 gHz code-rates to enum. 2022-07-27 10:06:14 +01:00
Orne Brocaar
73d581fc4c Update version. 2022-07-26 15:29:01 +01:00
Orne Brocaar
3bfb7d577f Fix coding_rate string in test.
The CodeRate type (in Rust) will decode both "1/3" and "2/6" as
CodeRate::Cr26. To string, this type is always encoded to "2/6".
2022-07-25 10:29:46 +01:00
Orne Brocaar
d10551bce1 Change command exec_id to uint32. 2022-07-22 20:29:07 +01:00
Orne Brocaar
f7f2fa82f2 Update diesel_cli to 2.0.0-rc.1. 2022-07-22 14:44:14 +01:00
Orne Brocaar
85cd5e0b80 Fix formatting after clippy fixes. 2022-07-22 13:06:52 +01:00
Orne Brocaar
4612f84045 Update to diesel 2.0.0-rc.1. 2022-07-22 13:05:45 +01:00
Orne Brocaar
b187efe84c Cleanup clippy warnings. 2022-07-22 13:00:30 +01:00
Orne Brocaar
4d665d3ded Remove update, change apt to apt-get to avoid warnings. 2022-07-22 12:20:20 +01:00
Orne Brocaar
c0a450c8f8 Change LR-FHSS code_rate to CodeRate type. 2022-07-22 12:19:36 +01:00