Hello! It’s my first time here.
Im currently having an issue with the Cariboulite TXRX where I want to transmit binary data, but theirs no documentation or examples which I can follow at all for this in Python.
I have tried so many things at the moment, I just want to put in an array from 0 to 255, convert it to binary and transmit that data to a receiver.
This is currently the script I have, and Ive made sure I’m working in the license exempt band for the uk.
import numpy as np
import wave
from itertools import groupby
import SoapySDR
from SoapySDR import SOAPY_SDR_TX, SOAPY_SDR_CS16, SOAPY_SDR_CS8
import time
arraN = [1,2,4,8,16,32,64,128,255]
# make it one string
BinARray = []
for BinChunk in [format(x, '08b') for x in arraN]:
for digit, group in groupby(BinChunk):
BinARray.append([int(digit), len(list(group))])
print(BinARray)
# Setup SDR
sdr = SoapySDR.Device(dict(driver="Cariboulite", CW="1"))
sdr.setSampleRate(SOAPY_SDR_TX, 0, 1e6)
sdr.setBandwidth(SOAPY_SDR_TX, 0, 1e6)
sdr.setFrequency(SOAPY_SDR_TX, 0, 864.5e6)
sdr.setGain(SOAPY_SDR_TX, 0, 40)
tx_stream = sdr.setupStream(SOAPY_SDR_TX, SOAPY_SDR_CS8, [0], {'CW': '1'})
sdr.activateStream(tx_stream)
for chunk in BinARray:
print(chunk)
if chunk[0] == 1:
#print(f"1: {chunk[1]}")
signal = np.tile(np.array([1]*chunk[1]), (2, 1)).T
iq_signal = signal.astype(np.int16)
#make np array
for sig in iq_signal:
sdr.setGain(SOAPY_SDR_TX, 0, 40)
sdr.writeStream(tx_stream, [sig], len(iq_signal))
time.sleep(0.1)
else:
for i in range(chunk[1]):
sdr.setGain(SOAPY_SDR_TX, 0, 10)
time.sleep(0.1)
sdr.deactivateStream(tx_stream)
sdr.closeStream(tx_stream)
Any help would be amazing.