Plot WSPR data on a map

The Weak Signal Propagation Reporter Network (WSPR) is a group of amateur radio operators using K1JT's MEPT_JT digital mode to probe radio frequency propagation conditions using very low power (QRP/QRPp) transmissions.

http://wsprnet.org/drupal/

This flow plots the contents of an ALL_WSPR.TXT log file on a map. This is a log of all WSPR spots logged by your local computer/radio.

There are mapping tools online, but this flow creates a map locally.

This flow expects to connect to a network service on the WSPR server and retrieve the ALL_WSPR.TXT log file in CSV format.

In my example I configured inetd on my Raspberry Pi WSPR server to listen for a connection and then forward the output of the following command:

tr -s '[:blank:]' ',' < /home/pi/.local/share/WSJT-X/ALL_WSPR.TXT

But all this is doing is collecting a CSV file to feed to the next node. There are probably better ways to do this...

[{"id":"46a1a90b.c4d848","type":"tab","label":"Map WSPR log","disabled":false,"info":""},{"id":"bc578cad.bc8bc8","type":"tcp in","z":"46a1a90b.c4d848","name":"Get WSPR log","server":"client","host":"10.1.1.100","port":"1836","datamode":"stream","datatype":"utf8","newline":"\\n","topic":"","base64":false,"x":140,"y":80,"wires":[["f989d155.0664f8","7bc94647.95fd58"]],"info":"This node expects to connect to a network service on the WSPR server and retrieve the ALL_WSPR.TXT log file in CSV format.\n\nIn my example I configured inetd on my Raspberry Pi WSPR server to listen for a connection and then forward the output of the following command:\n\ntr -s '[:blank:]' ',' < /home/pi/.local/share/WSJT-X/ALL_WSPR.TXT\n\nBut all this is doing is collecting a CSV file to feed to the next node. There are probably better ways to do this..."},{"id":"f989d155.0664f8","type":"debug","z":"46a1a90b.c4d848","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":80,"wires":[]},{"id":"7bc94647.95fd58","type":"csv","z":"46a1a90b.c4d848","name":"Convert CSV to JSON","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":160,"y":200,"wires":[["53958444.ccd054","c5921099.163818"]]},{"id":"53958444.ccd054","type":"debug","z":"46a1a90b.c4d848","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":200,"wires":[]},{"id":"c5921099.163818","type":"change","z":"46a1a90b.c4d848","name":"Apply WSPR labels","rules":[{"t":"move","p":"payload.col1","pt":"msg","to":"paylog.date","tot":"msg"},{"t":"move","p":"payload.col2","pt":"msg","to":"payload.utc","tot":"msg"},{"t":"move","p":"payload.col3","pt":"msg","to":"payload.db","tot":"msg"},{"t":"delete","p":"payload.col4","pt":"msg"},{"t":"move","p":"payload.col5","pt":"msg","to":"payload.freq","tot":"msg"},{"t":"move","p":"payload.col6","pt":"msg","to":"payload.name","tot":"msg"},{"t":"move","p":"payload.col7","pt":"msg","to":"payload.maidenhead","tot":"msg"},{"t":"delete","p":"payload.col8","pt":"msg"},{"t":"delete","p":"payload.col9","pt":"msg"},{"t":"delete","p":"payload.col10","pt":"msg"},{"t":"delete","p":"payload.col11","pt":"msg"},{"t":"delete","p":"payload.col12","pt":"msg"},{"t":"delete","p":"payload.col13","pt":"msg"},{"t":"delete","p":"payload.col14","pt":"msg"},{"t":"delete","p":"payload.col15","pt":"msg"},{"t":"delete","p":"payload.col16","pt":"msg"},{"t":"move","p":"payload.col17","pt":"msg","to":"payload.miles","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":150,"y":320,"wires":[["ade7115a.4a4198","6493bdb1.7e21b4"]]},{"id":"ade7115a.4a4198","type":"debug","z":"46a1a90b.c4d848","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":320,"wires":[]},{"id":"6493bdb1.7e21b4","type":"function","z":"46a1a90b.c4d848","name":"Maidenhead to Lat/Lon","func":"mh = msg.payload.maidenhead\n\nlat1 = mh.charCodeAt(1);\nlat2 = mh.charCodeAt(3);\nlon1 = mh.charCodeAt(0);\nlon2 = mh.charCodeAt(2);\n\nmsg.payload.lat = (lat1-65)*10-90+(lat2-48);\nmsg.payload.lon = (lon1-65)*20-180+(lon2-48)*2;\n\nif (mh.length > 4) {\n    lat3 = mh.charCodeAt(5);\n    lon3 = mh.charCodeAt(4);\n    msg.payload.lat = msg.payload.lat + (lat3-65) / 24 + 1/48;\n    msg.payload.lon = msg.payload.lon + (lon3-65) / 12 + 1/24;\n} \n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":160,"y":420,"wires":[["84b34ade.b2f41","c1e55bba.638798"]],"info":"// fe user_loc = \"KO03ka\"\r\n\r\n$loc = $user_data['user_loc'];\r\n\r\n$lat= \r\n(ord(substr($loc, 1, 1))-65) * 10 - 90 +\r\n(ord(substr($loc, 3, 1))-48) +\r\n(ord(substr($loc, 5, 1))-65) / 24 + 1/48;\r\n$lng= \r\n(ord(substr($loc, 0, 1))-65) * 20 - 180 +\r\n(ord(substr($loc, 2, 1))-48) * 2 +\r\n(ord(substr($loc, 4, 1))-65) / 12 + 1/24;"},{"id":"84b34ade.b2f41","type":"debug","z":"46a1a90b.c4d848","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":410,"y":420,"wires":[]},{"id":"c1e55bba.638798","type":"worldmap","z":"46a1a90b.c4d848","name":"","lat":"-38.235","lon":"145.036","zoom":"7","layer":"OSM grey","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"deg","showgrid":"true","path":"/wsprmap","x":410,"y":520,"wires":[]},{"id":"fad91017.3b3c48","type":"inject","z":"46a1a90b.c4d848","name":"My QTH","props":[{"p":"payload.name","v":"QTH","vt":"str"},{"p":"payload.lat","v":"-38.211533","vt":"num"},{"p":"payload.lon","v":"145.035143","vt":"num"},{"p":"payload.iconColor","v":"blue","vt":"str"}],"repeat":"10","crontab":"","once":true,"onceDelay":"1","topic":"","x":240,"y":600,"wires":[["c1e55bba.638798"]]}]

Flow Info

Created 4 years, 3 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • csv (x1)
  • debug (x4)
  • function (x1)
  • inject (x1)
  • tcp in (x1)
Other
  • tab (x1)
  • worldmap (x1)

Tags

  • WSPR
  • HAM
  • Maidenhead
  • Propagation
  • Map
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option