|
@@ -23,6 +23,41 @@ IDE's like ST's STM32CubeIDE which is only available in binary form |
|
|
was not a choice, as that would preclude building on an operating |
|
|
was not a choice, as that would preclude building on an operating |
|
|
system other than Windows/MaxOS/Linux. |
|
|
system other than Windows/MaxOS/Linux. |
|
|
|
|
|
|
|
|
|
|
|
Architecture |
|
|
|
|
|
------------ |
|
|
|
|
|
|
|
|
|
|
|
There are a number of components to make this system work. The overall |
|
|
|
|
|
flow is: |
|
|
|
|
|
************************************************************************************************ |
|
|
|
|
|
* * |
|
|
|
|
|
* +---------+ +-------------+ +-------------+ +--------------+ * |
|
|
|
|
|
* | lora.py | multicast | loraserv.py | USB VCP | lora.gw.elf | LoRa | lora.irr.elf | * |
|
|
|
|
|
* | +--------------+ +------------+ main.c +---------+ irr_main.c | * |
|
|
|
|
|
* +---------+ +-------------+ +-------------+ +--------------+ * |
|
|
|
|
|
* * |
|
|
|
|
|
************************************************************************************************ |
|
|
|
|
|
|
|
|
|
|
|
The `lora.py` component is the front end/UI that is used to send commands |
|
|
|
|
|
to controller. This program establishes a secure communications channel |
|
|
|
|
|
to the controller. It's firmware is in `lora.irr.elf`, and the main |
|
|
|
|
|
source file is `irr_main.c`. |
|
|
|
|
|
|
|
|
|
|
|
The middle to components, `loraserv.py` and `lora.gw.elf` are used to |
|
|
|
|
|
pass messages between the former two. The `loraserv.py` program takes |
|
|
|
|
|
multicast datagrams that are received on 239.192.76.111:21089, which |
|
|
|
|
|
are with out any framing, prepends `pkt:`, hex encodes the data and |
|
|
|
|
|
terminated w/ the new line character, and sends them via the USB VCP |
|
|
|
|
|
provided by `lora.gw.elf`. The gateway firmware then decodes the |
|
|
|
|
|
packet and transmits it via the LoRa radio to the irrigation |
|
|
|
|
|
controller. The received packet is returned similarly, but this time |
|
|
|
|
|
with `data:` prepended, for `loraserv.py` to multicast back to |
|
|
|
|
|
`lora.py`. |
|
|
|
|
|
|
|
|
|
|
|
The reason no particular framing is required for addressing or |
|
|
|
|
|
destination is that the protocol is secure, and only the party that |
|
|
|
|
|
is able to encrypt or decrypt the proper packets will be accepted, |
|
|
|
|
|
and any invalid packets will be ignored. |
|
|
|
|
|
|
|
|
Building |
|
|
Building |
|
|
-------- |
|
|
-------- |
|
|
|
|
|
|
|
@@ -84,6 +119,25 @@ should be grounded. |
|
|
Deploying |
|
|
Deploying |
|
|
--------- |
|
|
--------- |
|
|
|
|
|
|
|
|
|
|
|
Here is a diagram of the connections: |
|
|
|
|
|
|
|
|
|
|
|
******************************************************************************************* |
|
|
|
|
|
* * |
|
|
|
|
|
* GND * |
|
|
|
|
|
* +--------------------------------------------------+ * |
|
|
|
|
|
* | | * |
|
|
|
|
|
* +--------+ ~/~ +-+-----------+ GND +---------+ GPIO +-+--------------+ * |
|
|
|
|
|
* | 24V AC +--------+ +----------------+ Node151 +---------+ Relay | * |
|
|
|
|
|
* +--------+ | | +-+-------+ +-+--------------+ * |
|
|
|
|
|
* | | +5V -> VUSB | | * |
|
|
|
|
|
* | AC-DC PS 5V +------------------+ | +5V -> JD-VCC * |
|
|
|
|
|
* | | | * |
|
|
|
|
|
* | | | * |
|
|
|
|
|
* | +--------------------------------------+ * |
|
|
|
|
|
* +-------------+ * |
|
|
|
|
|
* * |
|
|
|
|
|
******************************************************************************************* |
|
|
|
|
|
|
|
|
The noral supply used for irrigation values is 24V AC. This means |
|
|
The noral supply used for irrigation values is 24V AC. This means |
|
|
an additional power supply is needed to convert to the 5V supply that |
|
|
an additional power supply is needed to convert to the 5V supply that |
|
|
is used by the Node151. Make sure this is well filtered as both the |
|
|
is used by the Node151. Make sure this is well filtered as both the |
|
@@ -105,3 +159,5 @@ NOT for the VCC->INx pins, despite them being next to each other. The |
|
|
GND and JD-VCC should be connected to the 5V power supply, while VCC |
|
|
GND and JD-VCC should be connected to the 5V power supply, while VCC |
|
|
is connected to VDD on the Node151, and INx pins to the respective |
|
|
is connected to VDD on the Node151, and INx pins to the respective |
|
|
GPIO pins. |
|
|
GPIO pins. |
|
|
|
|
|
|
|
|
|
|
|
<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://casual-effects.com/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script> |