Archived
1
0
Fork
You've already forked USB-LoRa
0
Some scripts to push a gopher article over LoRa
This repository has been archived on 2024年10月15日. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Perl 94.3%
  • Shell 5.7%
2024年10月15日 13:11:23 +00:00
auto_create_phlog_entry.sh First commit 2024年09月13日 21:45:09 +02:00
LICENSE Initial commit 2024年09月13日 19:42:19 +00:00
lora_get.pl First commit 2024年09月13日 21:45:09 +02:00
lora_receive.pl First commit 2024年09月13日 21:45:09 +02:00
lora_send.pl First commit 2024年09月13日 21:45:09 +02:00
lora_set.pl First commit 2024年09月13日 21:45:09 +02:00
README.md README.md aktualisiert 2024年10月15日 13:11:23 +00:00
sh_test.pl First commit 2024年09月13日 21:45:09 +02:00

This repo was archived, because it will be rewritten in Python3 (Perl has some issues with Device::SerialPort)

USB-LoRa Transmission Scripts

Here are the scripts I wrote to transmit my #ROOPHLOCH'24 post over LoRa. The post is accessible on my Gopher Hole:

gopher://redterminal.org:70/0/phlog/2024-09-13-ROOPHLOCH_2024_Post_2_-_LoRa_transmission.txt

These scripts are just some hack to get going with my first steps in LoRa and LoRaWAN. You can't use them unmodified because I use some hardcoded paths and some scripts are missing, namely the ones to generate the gophermap and rss feed (phlog.sh) and the rsync upload script (upload_gopher.sh).

Send and Receive

At first I had to start the receiving script on my Raspberry Pi 3 at home, which waits for the 'START' command:

$ ./lora_receive /dev/ttyACM0 Passw0rd

Then I have to send the file from my laptop:

$ ./lora_send /dev/ttyACM0 Passw0rd file_to_send.txt

If all goes well (I needed 3 attempts to fully send the post), the file is sent to the home station Raspberry Pi, gunzipped and decoded (openssl). After that it's prepared for Gopher and uploaded with the 'auto_create_phlog_entry.sh' script.

file_to_send.txt format

The files I want to send have a special format. The first line is the Gopher title, which is used in the filename and in the title in the prepared gopher file:

<Title of the file for file name and title in gopher txt file>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero
eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
DECODE OK

The last line has to be 'DECODE OK' on its own, last line. This is to check if there was a decryption error.

The first and the last line aren't part of the resulting Gopher post.

My first steps

The scripts are very hacky and amateurish but they did work for me. I just post them so you can peek at them to get a clue how I did it. This is nothing professional and was mainly trial and error.