Page 1 of 1

More than 8 WSPR(-RX) bands by switching Day & Night bands?

Posted: Tue Jun 07, 2016 4:49 pm
by ph2m
I 'am not sure if this wish/suggestion has been mentioned before :?: ,
but maybe Pavel (or someone else) who is busy with the development of (the) multiband WSPR-RX/TX can make it work and switch bands depending it is night of day or even more with other bands during grey line period, see the example wich is used with the WSJT-X software...
Example:
8 band RX during daytime: 6, 10, 12, 15, 17, 20, 30, 40M
8 band RX during greyline period: 12, 15, 17, 20, 30, 40, 60, 80M
8 band RX during nighttime: 17, 20, 30, 40, 60, 80, 160, 600, 2200M
This will give up to 12 HAM-bands during 24 hours! :D
Maybe an Idea, sorry I 'am not a programmer, only a very enthusiastic future Red Pitaya user (ordered and waiting for delivery) ;)

73 de Frank PH2M / JO22HC

Re: More than 8 WSPR(-RX) bands by switching Day & Night ban

Posted: Tue Jun 07, 2016 7:23 pm
by pavel
Hello Frank,

This functionality is already available. I know that several radio amateurs (LA3JJ, DK5HH, M0NKA) are already running the multi-band WSPR receiver this way.

The idea is to have several configuration files:
  • write-c2-files.cfg
  • write-c2-files-daytime.cfg
  • write-c2-files-greyline.cfg
  • write-c2-files-nighttime.cfg
Then crontab can be configured to replace write-c2-files.cfg with the correct configuration file at the correct time:

Code: Select all

00 05 * * * /bin/cp /root/write-c2-files-greyline.cfg /root/write-c2-files.cfg
00 07 * * * /bin/cp /root/write-c2-files-daytime.cfg /root/write-c2-files.cfg
00 20 * * * /bin/cp /root/write-c2-files-greyline.cfg /root/write-c2-files.cfg
00 22 * * * /bin/cp /root/write-c2-files-nighttime.cfg /root/write-c2-files.cfg
It's write-c2-files.cfg that is always used by the write-c2-files program. For example to switch to the daytime configuration write-c2-files-daytime.cfg should be copied to write-c2-files.cfg.

Best regards,

Pavel

Re: More than 8 WSPR(-RX) bands by switching Day & Night ban

Posted: Tue Jun 07, 2016 9:45 pm
by ph2m
Hello Pavel,

Looks good, I have to figure that out when I received my RP ;) , I understand that the times are now fixed in the 'crontab' , it would be nice that the correct times (vary thru the year/seasons) can be adjusted & calculated automatically by the global position of the RX-station :) )

73 de Frank PH2M

Re: More than 8 WSPR(-RX) bands by switching Day & Night ban

Posted: Thu Jun 23, 2016 5:10 pm
by ph2m
Hello Pavel,

Where do I execute 'crontab -e' ? and where will/should it be written?

73 de Frank PH2M

Re: More than 8 WSPR(-RX) bands by switching Day & Night ban

Posted: Thu Jun 23, 2016 7:46 pm
by pavel
ph2m wrote: Where do I execute 'crontab -e' ? and where will/should it be written?
'crontab -e' should be run from the Red Pitaya command line.

Re: More than 8 WSPR(-RX) bands by switching Day & Night ban

Posted: Thu Jun 23, 2016 8:20 pm
by ph2m
TNX Pavel,

Lets have a look if bands are 'switching' at 20:00 UTC :)

73 de Frank PH2M

Re: More than 8 WSPR(-RX) bands by switching Day & Night bands?

Posted: Fri Jan 05, 2018 10:20 pm
by w9pds
Hi,

I just saw this thread. I put together a python script to help automate this process and make it a bit more intelligent.

This script uses the GEOIP database to determine your coordinates from your public source IP. and then submit those coordinates to a service to calculate the current sunset & sunrise times for your location.

It will then copy your appropriate day & nighttime band config files if it is approaching the appropriate sunset/sunrise timeframe.

This can be run via an hourly cron job and when the hour of sunset/sunrise hits, it will update your file. It will adjust that time appropriately as the season progresses and the days get longer/shorter.


I hope someone finds this useful, I think it is pretty neat :)

THanks - W9PDS

Re: More than 8 WSPR(-RX) bands by switching Day & Night bands?

Posted: Fri Jan 05, 2018 10:29 pm
by w9pds

Code: Select all


#!/usr/local/bin/python



# Logging In
import requests
import datetime
import json
import os

ip_server = "ipinfo.io"
sun_server = "api.sunrise-sunset.org"

now = datetime.datetime.utcnow()



try:

	ip_response = requests.get('H T T P S ://' + ip_server, timeout=5)
	ip_json_data = json.loads(ip_response.text)
	latlng = ip_json_data["loc"]
	#print latlng
	latlng_list = latlng.split(",")
	ip_lng = latlng_list[1]
	ip_lat = latlng_list[0]


except requests.exceptions.RequestException as e:
	print ('FAILED CALL %s %s' % (e, now))

sun_payload = {'lat': ip_lat, 'lng': ip_lng, 'formatted': '0'}

try:
	sun_response = requests.get('H T T P S ://' + sun_server + '/json?',params=sun_payload, timeout=5)
	#print (sun_response.url)
	sun_json_data = json.loads(sun_response.text)
	raw_sunrise = sun_json_data["results"]["sunrise"]
	raw_sunset = sun_json_data["results"]["sunset"]
	sunrise_list = raw_sunrise.split("T")
	sunset_list = raw_sunset.split("T")
	sunrise = sunrise_list[1]
	sunset = sunset_list[1]
	sunrise_h = sunrise.split(":")
	sunset_h = sunset.split(":")
	sunrise = sunrise_h[0] + ":" + sunrise_h[1]
	sunset = sunset_h[0] + ":" + sunset_h[1]



except requests.exceptions.RequestException as e:
	print ('FAILED CALL %s %s' % (e, now))



if (now.hour == sunrise_h[0]):
	os.system('cp /media/mmcblk0p1/apps/sdr_transceiver_wspr/day-write-c2-files.cfg /media/mmcblk0p1/apps/sdr_transceiver_wspr/write-c2-files.cfg')
	print "Sunrise"

if (now.hour == sunset_h[0]):
	os.system('cp /media/mmcblk0p1/apps/sdr_transceiver_wspr/night-write-c2-files.cfg /media/mmcblk0p1/apps/sdr_transceiver_wspr/write-c2-files.cfg')
	print "Sunset"


Re: More than 8 WSPR(-RX) bands by switching Day & Night bands?

Posted: Fri Jan 05, 2018 10:30 pm
by w9pds
Note - Please change lines 20 & 35 from H T T P S, to the proper https


This forum won't allow me to post as it thinks I'm linking a URL otherwise.


-W9PDS

Re: More than 8 WSPR(-RX) bands by switching Day & Night bands?

Posted: Fri Jan 04, 2019 10:07 pm
by ph2m
I know I started this topic, but only as a user not as a programmer ;)
I hope that some time Pavel will integrate this in the Multiband WSPR RX + Multiband FT8 RX (wich I presently use :D with my Red Pitaya!) at this moment I have not yet bandswitching between Daytime/Greyzone/Nighttime for my Multiband FT8 RX operational :( !

73 de Frank PH2M - JO22HC 8-) (FT8 Red Pitaya RX: 160/80/60/40/30/20/17/15M)