hortitel/README.md

63 lines
2.9 KiB
Markdown
Raw Permalink Normal View History

2025-07-20 18:37:17 +01:00
# hortitel
2025-07-20 19:10:39 +01:00
## Horti(culture)Tel(emetry)
### Allotment Telemetry Project
2025-07-20 18:49:20 +01:00
2025-07-20 19:10:39 +01:00
**Project Goal:** Gather various sensor data from our allotment so we can observe present data and compare to past measurements.
2025-07-20 18:49:20 +01:00
2025-07-20 19:10:39 +01:00
This is implemented using the Melopero Perpetuo LoRa boards as documented in their project here: [Melopero Perpetuo LoRa](https://github.com/melopero/Melopero_Perpetuo_Lora)
2025-07-20 18:49:20 +01:00
The code is derived from their initial examples.
At present this reads some data from the 'sender' board and sends it via the
LoRaEMB protocol to the 'receiver board. The data sent is the Pico's internal
temperature sensor as well as voltage readings from the battery circuit and the
board input voltage (i.e. USB or solar). Note that the voltage measurement uses
an external voltage divider circuit, the resistances of this are essentially
documented in the code.
The data is sent and received by serialisation and deserialisation of some
structs. It could well be neater to use a text format for, but I'm a bit
old-school like this.
2025-07-20 19:10:39 +01:00
This project is very far from being a working thing... but I'm getting it
uploaded as perhaps the more involved examples of sending and receiving data
will be useful to someone.
2025-07-20 18:49:20 +01:00
Eventually I plan to build this out by adding more sensors, a proper enclosure,
and an external solar/battery power-source.
### Build Instructions
Note I'm new to `cmake` so have really just kludged this together for the moment, however this seems to work for me:
1. Install/setup the Pico SDK and ensure the PICO environment vars are set up: `PICO_SDK_PATH`, `PICO_EXAMPLES_PATH`, `PICO_EXTRAS_PATH`, `PICO_PLAYGROUND_PATH` (I don't know if they're all needed)
2. Check out the [Melopero Perpetuo LoRa](https://github.com/melopero/Melopero_Perpetuo_Lora) project.
3. Check out this project and `cd` to the project root
4. Edit the `CMakeList.txt` to point to the correct Melopero Perpetuo LoRa `src` path!
5. `cd` to the `src` directory.
6. `mkdir build`
7. `cd build`
8. `cmake ../.. -DPICO_PLATFORM=rp2350`
9. `make`
There should now be the files `sender.uf2` and `receiver.uf2` in the `src` directory (under the `build` directory you're currently in). Then copy these onto the boards...
1. With no power (i.e. battery unplugged) plug your Melopero Perpetuo LoRa board into your computer via USB whilst holding down the "BT" button, then, for example:
2. `sudo mount /dev/sdb1 /mnt/tmp`
3. `sudo cp src/receiver.uf2 /mnt/tmp/`
4. `sync`
5. `sudo umount /mnt/tmp`
In your case you may well have a different device than `/dev/sdb1` and `/mnt/tmp` is just my choice of path, this can be whatever you want.
After this is run you should be able to attach to the USBTTY to view the serial output, in my case:
* `minicom -D /dev/ttyACM1 -b 115200`
In terms of finding the correct devices above `dmesg` is your friend.
2025-07-20 19:10:39 +01:00
### Disclaimer
2025-07-20 18:49:20 +01:00
The code is in no way warranted to be fit for any purpose at all. In fact it is
almost certainly "buggy as hell". You have been warned.