LoRa Page: Difference between revisions
Line 38: | Line 38: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Make the code the sender. I compiled the two versions and all worked. | Make the code the sender. I compiled the two versions and all worked. | ||
=Let's get Rusty= | |||
Now we need to get rust | |||
<syntaxhighlight lang='bash'> | |||
cargo install espup | |||
espup install | |||
rustup toolchain list | |||
# List should show | |||
stable-x86_64-unknown-linux-gnu (default) | |||
nightly-x86_64-unknown-linux-gnu | |||
esp (override) | |||
</syntaxhighlight> | |||
Now lest make a hello-world | |||
<syntaxhighlight lang='bash'> | |||
cargo install cargo-generate | |||
# Name the project helloworld | |||
cd helloworld | |||
cargo run | |||
</syntaxhighlight> | |||
So it did not run. This is because we used espup install and we need to set up the environment. We do this running | |||
<syntaxhighlight lang='bash'> | |||
. $HOME/export-esp.sh | |||
# And again | |||
cargo run | |||
# could not execute process `espflash flash | |||
</syntaxhighlight> | |||
Still not working. This is the nature of using this environment. I quite like the chase of it and the gaining of knowledge when the solution is explained. So next | |||
<syntaxhighlight lang='bash'> | |||
cargo install espflash | |||
# warning: build failed, waiting for other jobs to finish... | |||
# error: failed to compile `espflash v3.1.1`, intermediate artifacts can be found at `/tmp/cargo-install20pGtu`. | |||
</syntaxhighlight> |
Revision as of 03:26, 24 August 2024
Introduction
I know nothing of LoRa but like putting boxes together and getting them to talk so lets do it.
Equipment
So I thought I would start with two LilyGO Model T3 v1.6.1. I think they were $30 NZD
Environment
Operating System
Been Ubuntu for a while. Mainly because it still supports team and I guess I know the most about it. So for now Ubuntu 24.04
IDE Arduino 2.3.3
Well I dislike the Arduino software with a passion. I know it is free and someone has clearly put a lot of effort into making it and a lot of people use it but it is just horrible to use in a project for me. All my problem not yours.
I did try with both the snap and the apt installs for version 1 but could not get it to work. Then second approach resulted in having to clear the /tmp directory each time I built. So went for the zip file. My preference is apt or snap as you can put the software on and take it off and (hopefully) you are back to where you started
Always a challenge run Arduino for me but the way I did it this time was download it from https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-latest_Linux_64bit.zip
I unzipped it to and set the permission. No idea it this is a good thing or bad so don't do it on something you care about
cd ~/bin
unzip arduino-ide_nightly-20240630_Linux_64bit.zip
cd ~/bin/arduino-ide_nightly-20240630_Linux_64bit
sudo chown root:root chrome-sandbox
sudo chmod 4755 chrome-sandbox
# Put this in your bash profile ~/.bashrc or run here
export PATH=~/bin/arduino-ide_nightly-20240630_Linux_64bit:$PATH
First Attempt
Well the first thing to do is to take something that works and demonstrate it works on you environment/equipment for me I started with https://github.com/Xinyuan-LilyGo/TTGO-LoRa-Series
git clone https://github.com/Xinyuan-LilyGo/TTGO-LoRa-Series
cd LoRa
arduino-ide LoRa.ino
Just adding the line
#define LORA_SENDER 1
Make the code the sender. I compiled the two versions and all worked.
Let's get Rusty
Now we need to get rust
cargo install espup
espup install
rustup toolchain list
# List should show
stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu
esp (override)
Now lest make a hello-world
cargo install cargo-generate
# Name the project helloworld
cd helloworld
cargo run
So it did not run. This is because we used espup install and we need to set up the environment. We do this running
. $HOME/export-esp.sh
# And again
cargo run
# could not execute process `espflash flash
Still not working. This is the nature of using this environment. I quite like the chase of it and the gaining of knowledge when the solution is explained. So next
cargo install espflash
# warning: build failed, waiting for other jobs to finish...
# error: failed to compile `espflash v3.1.1`, intermediate artifacts can be found at `/tmp/cargo-install20pGtu`.