| pico | ||
| src | ||
| CMakeLists.txt | ||
| LICENSE | ||
| README.md | ||
hortitel
Horti(culture)Tel(emetry)
Allotment Telemetry Project
Project Goal: Gather various sensor data from our allotment so we can observe present data and compare to past measurements.
This is implemented using the Melopero Perpetuo LoRa boards as documented in their project here: Melopero Perpetuo LoRa
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.
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.
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:
- 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) - Check out the Melopero Perpetuo LoRa project.
- Check out this project and
cdto the project root - Edit the
CMakeList.txtto point to the correct Melopero Perpetuo LoRasrcpath! cdto thesrcdirectory.mkdir buildcd buildcmake ../.. -DPICO_PLATFORM=rp2350make
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...
- 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:
sudo mount /dev/sdb1 /mnt/tmpsudo cp src/receiver.uf2 /mnt/tmp/syncsudo 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.
Disclaimer
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.