added Nemaxx_WL10 Smoke Detector(static code-crap product)

master
cheetah 5 years ago
parent 69810ed6c6
commit 59a56accaf

@ -412,7 +412,7 @@
</param>
<param>
<key>_enabled</key>
<value>True</value>
<value>1</value>
</param>
<param>
<key>fft_size</key>
@ -507,7 +507,7 @@
</param>
<param>
<key>_enabled</key>
<value>True</value>
<value>1</value>
</param>
<param>
<key>_coordinate</key>

@ -3,7 +3,7 @@
##################################################
# GNU Radio Python Flow Graph
# Title: IQ Transmitter
# Generated: Sat Jan 18 21:31:42 2020
# Generated: Mon Jan 27 16:30:38 2020
##################################################

@ -4,16 +4,12 @@ import SoapySDR
from SoapySDR import * #SOAPY_SDR_* constants
# Protocol part
import protocols.Nexus
nexus = protocols.Nexus.Nexus_TempHumidity()
with open('output.complex', 'wb') as f:
for bt_id in range(0,255):
for bt_channel in range(0,4):
samples = nexus.generateSamples(baseband_samplerate=2e6, id=bt_id, channel=bt_channel, temp=-50, humidity=100)
samples.tofile(f)
print("Generated Sensor ID %d Nexus Samples" % bt_id)
#
import protocols.Nemaxx_WL10_SmokeDetector
nemaxx = protocols.Nemaxx_WL10_SmokeDetector.Nemaxx_WL10_SmokeDetector()
with open('nemaxx.complex', 'wb') as f:
samples = nemaxx.generateSamples(repeatNum=20)
samples.tofile(f)
"""

@ -0,0 +1,23 @@
from modulators.OOKModulator import OOKModulator
import numpy as np
"""
Nemaxx WL10 Smokedetectors
"""
class Nemaxx_WL10_SmokeDetector:
def __init__(self, baseband_samplerate=2e6):
self.modulator = OOKModulator(baseband_samplerate=baseband_samplerate, am_frequency=22.471e3)
def test(self):
print("Nemaxx WL10 Smokedetector (433MHz)")
def generateSamples(self, repeatNum=20, numpyType=np.complex64):
for i in range(repeatNum):
bits = [0,1,0,0,0,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,1,0]
print(bits)
self.modulator.addModulation(8120)
self.modulator.addPadding(912)
for j in bits:
self.modulator.addModulation(795)
self.modulator.addPadding(1400 if int(j) == 0 else 2750)
self.modulator.addModulation(795)
self.modulator.addPadding(1337) # Packet Sync
return self.modulator.getSamplesAndReset(numpyType)

@ -0,0 +1,15 @@
#!/bin/bash
while true; do
python iq_transmitter.py &
sleep 10
killall -9 python
python /home/user/SDR/txstop.py &
sleep 5
killall -9 python
sleep 15
done

@ -118,12 +118,7 @@ for i in range(4):
1,0,0,0,
1,0,0,1
]
bits = bitsStart + [
0,0,
1,0,1,0,
1,0,1,0,
1,1,1,0
]
bits = bitsStart + bits_43_4
#bits = data2
print(bits)
print(len(bits))

Loading…
Cancel
Save