RaspyRFM/lacrosse.py

29 lines
617 B
Python
Raw Normal View History

2017-03-05 22:42:34 +01:00
#!/usr/bin/env python2.7
from rfm69 import Rfm69
import rfm69
import sensors
from sensors import rawsensor
import sys
import time
rfm = Rfm69()
rfm.SetParams(
2018-02-08 00:06:11 +01:00
Freq = 868.312, #MHz center frequency
2017-03-05 22:42:34 +01:00
Datarate = 9.579, #17.241, #kbit/s baudrate
ModulationType = rfm69.FSK, #modulation
Deviation = 90, #90 kHz frequency deviation
2017-03-05 22:42:34 +01:00
SyncPattern = [0x2d, 0xd4], #syncword
Bandwidth = 200, #kHz bandwidth
RssiThresh = -100 #-100 dB RSSI threshold
2017-03-05 22:42:34 +01:00
)
data = []
2017-11-01 22:18:24 +01:00
print "Waiting for sensors..."
2017-03-05 22:42:34 +01:00
while 1:
data = rfm.ReceivePacket(7)
obj = rawsensor.CreateSensor(data)
print(str(obj))