Open Shiny380 opened 2 months ago
Hi @Shiny380, I went through loraraw and driver-lora codebases and had a question related to making points writable,
WritePollRequired (write_required)
? I saw this on modbus which is by default set to true when writable is enabled. We could simply set this property to true (or false) if this is not being used in loraraw.ObjectType
as analog_input
by default in loraraw. So, I'm assuming we don't need to check ObjectType
to set points as writable or not, and instead make all points in loraraw writable, right?And by,
integer for the point ID
is this something different from point UUID?
And regarding,
Setup a handler for the Write Point endpoint
We already have the endpoint and method implemented for point write https://github.com/NubeIO/module-core-loraraw/blob/d482e2d18b0e8420afa2d41d8ae1a2bf7ee0a7c6/pkg/router.go#L34 Are you referring to something different from this?
WritePollRequired
might only be useful to determine which points have not been successfully written between restart of the module. So let's just set this true
on write for now.ObjectType
is not relevant for LoRaRAW so no need to set. as long as you have other fields for the point ID and data type IDPointID
is different. try and re-use an existing field@Shiny380 Have made points writable. For this, there are a few changes on rubix-ce
and lib-models-go
for which have opened these two PRs,
Also, added functions to encrypt the encoded data and to write the data in the serial port. This needs testing though which will continue after the encoding part. ATM, the device address is added to PointWriter
struct itself and hence can be extracted after unmarshal.
@maharjanaman you can start on the data encoding part too when you're ready.
Rubix-Data-Encoding:
Each point is associated to one data-point. Build the encoder in a way that you can encode multiple data points in multiple calls by passing in the SerialData
object each time. This should be independent to any LoRaRAW protocol stuff (i.e. address, encryption, etc.) which should happen after the encoding.
As we maybe discussed before, we'll need some kind of Queue system to handle the writes, I'll describe in a separate comment
This feature enables LoRaRAW Unique address transmission. i.e. From the gateway to a specific sensor such as a Droplet/MicroEdge Requires: https://github.com/NubeIO/driver-lora/issues/8
Float32
=40
(float32)AAC0BBCC
) but you will need to convert this to decimal (int[4]
) before doing any encryptiondefault_key
secret
so it is not displayed in plain text, like hereData encoding Document
https://docs.google.com/document/d/1DsEAdiUQcmw5YJ9Fi7VrVbzbtGrhEaLDQXoOrtvfW0w/edit#heading=h.lm2l9j87mmll