-- Leo's gemini proxy
-- Connecting to m0yng.uk:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini;lang=en
Created 2020-05-17
Code
Amateur Radio
Recently I managed to have some success with FT8, which was great! But I didn't want to have to log contact manually. I've also started using CloudLog[1] (which you can view at https://log.m0yng.uk[2])
I looked around and didn't find anything simple and native for Linux to do this log uploading (I'm sure there are things I didn't find, but ๐คท)
Previously I've (ab)used a handy Python script by Giampaolo Rodola' which find and watches log files watch_log.py[3], and I knew that WSJT-X generates an adi file, and that CloudLog had an API that can accept adi lines.
#!/usr/bin/env python3 # Imports for stuff import configparser import watch_log import requests # read in the config config = configparser.ConfigParser() config.read('config.ini') # Some fixed common things qsourl = '/index.php/api/qso' # What to do when we find a new contact def pushContact(filename, lines): for line in lines: r = requests.post( config['cloudlog']['host'] + qsourl, json={"key": config['cloudlog']['key'], "type": "adif", "string": line } ) if r.status_code == 201: print('๐ log created!') else: print('๐ Something went wrong') print(r.text) # tell it what to watch l = watch_log.LogWatcher(config['cloudlog']['filepath'], pushContact) # start the watching l.loop()
I've used a config file, which looks like this
[cloudlog] host = https://yourlog.server key = yourkeyhere filepath = /home/pi/.local/share/WSJT-X
I needed to change line 29 of `watch_log.py` to monitor `.adi` files, not just `.log`:
def __init__(self, folder, callback, extensions=["log"], tail_lines=0): def __init__(self, folder, callback, extensions=["adi"], tail_lines=0):
I'm sure there are better ways of doing this, but it was quick, simple, and it works.
Sure, I have to remember to start the script first, but it's not too big of an issue, and I *could* make it start automatically on boot...
It would be nice to show on the CLI some info about the contact, e.g. `๐ contact with G5BK created!`, but that would require parsing the adi text and it's just not that important to me (for now.)
-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-
๐ค Black Lives Matter
๐๐ค๐ Trans Rights are Human Rights
โค๏ธ๐งก๐๐๐๐ Love is Love
Copyright ยฉ 2024 Christopher M0YNG - It is forbidden to use any part of this site for crypto/NFT/AI related projects.
Page generated 2024-03-24 by Complex 19
-- Response ended
-- Page fetched on Sat May 18 21:23:43 2024