Hi, John. I've had some problems with your patch (jks-v0.1): For some SDR devices, I get this run time error: "IndexError, tuple index out of range " at "kiwiclient.py", line 238. That line is "samples = [ complex(data[i+0], data[i+1]) for i in xrange(0, count, 2) ] ".
The particular SDR that gave this response is (but not limited to this one): "szsdr.ddns.net:8073". Can you take a look in your spare time? Thanks!
Sorry about that. My kiwiclient jks-v0.1 only works with Kiwis that have been updated to v1.151 that has the new GPS timestamps in the IQ stream. I just tried it with the Shenzhen Kiwi and it worked (he's running v1.151 now)
File "/home/ron/kiwiclient-jks-v0.1/kiwirecorder.py", line 174, in main
recorder.run()
File "/home/ron/kiwiclient-jks-v0.1/kiwiclient.py", line 266, in run
self._process_ws_message(received)
File "/home/ron/kiwiclient-jks-v0.1/kiwiclient.py", line 146, in _process_ws_message
self._process_message(tag, body)
File "/home/ron/kiwiclient-jks-v0.1/kiwiclient.py", line 219, in _process_message
self._process_aud(body)
File "/home/ron/kiwiclient-jks-v0.1/kiwiclient.py", line 238, in _process_aud
samples = [ complex(data[i+0], data[i+1]) for i in xrange(0, count, 2) ]
IndexError: tuple index out of range
ron@linux-4cdz:~>
The new version found at https://github.com/jks-prv/kiwiclient produces an audio wav file but it produces a continuous stream in the terminal of this type of line:
You can't run the old kiwirecorder with v1.151 Use the current one. And you can't use the latest one from my branch on Kiwis running earlier than v1.151 See the comments above. I haven't tested the latest one with the GPS timestamp support with DRM -- and there are no DRM transmissions on right now..
3965 came back on and I tested the latest kiwirecorder using southwest.ddns.net:8073 which is running v1.151 Dream worked fine for me using data played back from the recorded file.
It dumps the print and places the python in the background, returning use of the terminal in the foreground. You are causing me to think about bash. Hi Hi
Please bear with my stupidity: I try to record 2 IQ streams from 2 kiwi Servers in this fashion: while True: recorder = KiwiRecorder(options) options.server_host = options.server_host2 # second server options.server_port = options.server_port2 recorder2 = KiwiRecorder(options)
And I DO get 2 files, but it turn out that both are the IQ data from ONLY the 2nd connection. I'm really at my wit's end, and I really don't want to use multi-threading here. Anyone can give my a clue/hint? Thanks!
Okay, please try my latest jks-v0.1 branch. A lots of changes were necessary for two server recording to work. Look at the new Makefile to see an example of the command arguments I added.
Check those flags. You're using -s a second time when I think you meant to say -2 and using -p a second time instead of -p2. Use "make help" as a shortcut to see the "--help" info.
You needed to say "--f2" instead of "-f2" ("-f2" is interpreted as "--f 2" by the OptionParser module I think)
But it incorrectly uses the same filename when only a single frequency is specified. So my latest branch now appends "_serverN" (N=0,1) to the filename. Please give that a try.
Hi, John. When 2 servers are on the same frequency, It only generates one single file. Is this your intention? I'm a little baffled by the inconsistent behavior.
When you include the --kiwi-wav flag the GPS timestamps will also be added to the files when recording in IQ mode. This will allow post-processing the data for the very interesting projects now ongoing: Christoph's HFDF work and zfyoung's diversity reception.
The number of servers determines the number of data streams. Other options (port, frequency, station name, agc setting) can be comma separated lists where a value at a given position refers to the server at the same position.
Let me know if this is useful and I will make a pull request.
Comments
".
The particular SDR that gave this response is (but not limited to this one): "szsdr.ddns.net:8073". Can you take a look in your spare time? Thanks!
while True:
recorder = KiwiRecorder(options)
options.server_host = options.server_host2 # second server
options.server_port = options.server_port2
recorder2 = KiwiRecorder(options)
# Connect
try:
recorder.connect(options.server_host, options.server_port)
recorder2.connect(options.server_host, options.server_port)
except KeyboardInterrupt:
break
except:
print "Failed to connect, sleeping and reconnecting"
time.sleep(15)
continue
# Record
try:
run(recorder, recorder2)
break
.....
def run(rec1, rec2):
"""Run the client."""
try:
rec1._set_auth('kiwi', '')
rec2._set_auth('kiwi', '')
print "enter run"
# Loop forever
while True:
try:
received = rec1._stream.receive_message()
rec1._process_ws_message(received)
received2 = rec2._stream.receive_message()
rec2._process_ws_message(received2)
except KeyboardInterrupt:
break
rec1._stream.close_connection()
rec2._stream.close_connection()
finally:
rec1._socket.close()
rec2._socket.close()
And I DO get 2 files, but it turn out that both are the IQ data from ONLY the 2nd connection. I'm really at my wit's end, and I really don't want to use multi-threading here. Anyone can give my a clue/hint? Thanks!
zfyoung
recorder2.connect(options.server_host, options.server_port)
\My Documents\Downloads\kiwiclient-jks-v0.1>python kiw
irecorder.py -s hallmann.selfhost.eu -p 80 -2 --s2 222.7.151.84 --p2 8073 -f 39
65 -f2 5965 -m iq -L -5000 -H 5000
client_public_ip: 111.58.242.19
client_public_ip: 111.58.242.19
rx_chans: 4
rx_chans: 4
chan_no_pwd: 0
chan_no_pwd: 0
badp: 0
badp: 0
version_maj: 1
version_min: 151
version_maj: 1
version_min: 151
load_cfg: (cfg info not printed)
load_cfg: (cfg info not printed)
center_freq: 15000000
bandwidth: 30000000
adc_clk_nom: 66666600
center_freq: 15000000
bandwidth: 30000000
adc_clk_nom: 66666600
audio_init: 0
audio_rate: 12000
sample_rate: 12001.062
audio_init: 0
audio_rate: 12000
sample_rate: 12001.123
Started a new file: 20171128T011642Z_2000_iq.wav
Started a new file: 20171128T011642Z_2000_iq.wav
^C
zfyoung
-rw-r--r-- 1 jks staff 2.1M Nov 28 14:43 20171128T014216Z_4567000_iq_server0.wav
-rw-r--r-- 1 jks staff 2.1M Nov 28 14:43 20171128T014216Z_4567000_iq_server1.wav
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo}
span.s1 {font-variant-ligatures: no-common-ligatures}
python kiwirecorder.py -s kiwisdr.local,kiwisdr.local,kiwisdr.local,kiwisdr.local -f 30,80,100,200 -m iq -L -5900 -H 5900 -w -g 30,35,40,45
The number of servers determines the number of data streams. Other options (port, frequency, station name, agc setting) can be comma separated lists where a value at a given position refers to the server at the same position.
Let me know if this is useful and I will make a pull request.