Exemplo n.º 1
0
	def dbus_Connect(self):
		self._logger.debug(
			"%s@Connect: Connect INIT", self._full_path)
		if self._getConnected():
			self._logger.debug(
				"%s@Connect: Module is already connected", self._full_path)
			raise self.IOError("Module is already connected.")
		
		self._logger.debug(
			"%s@Connect: MODE=%s", self._full_path, self._setup["MODEM_CONFIG"])
		self._rfm69 = rfm69.RFM69(25, 24, 0, rfm69.RFM69Configuration(), True)
		self._rfm69.set_channel(self._setup["channel"])
		self._rfm69.set_address(1)
		
		self._logger.debug("Class initialized")
		self._logger.debug("Calibrating RSSI")
		# self._rfm69.calibrate_rssi_threshold()
		self._logger.debug("Checking temperature")
		self._logger.debug(self._rfm69.read_temperature())
		
		# Make sure settings are correct to talk to other radios
		self._setModemConfig()
		self._setModemKey()
		
		self._logger.debug("reading all registers")
		for result in self._rfm69.read_registers():
			self._logger.debug(result)
		
		# Won't get here if something went wrong reading temps etc.
		self._setConnected(True)
		self._logger.debug("%s@Connect: Connect OK", self._full_path)
Exemplo n.º 2
0
def init_rfm():
    myconf = rfm69.RFM69Configuration()
    rfm_unit = rfm69.RFM69(dio0_pin=24,
                           reset_pin=22,
                           spi_channel=0,
                           config=myconf)
    # setting RSSI treshold
    rfm_unit.set_rssi_threshold(-114)
    #rfm_unit.config.packet_config_1.variable_length = False
    return rfm_unit
Exemplo n.º 3
0
def init_rfm():
    myconf = rfm69.RFM69Configuration()
    rfm_unit = rfm69.RFM69(
                            dio0_pin=24,
                            reset_pin=22,
                            spi_channel=0,
                            config=myconf)
    # setting RSSI treshold
    rfm_unit.set_rssi_threshold(-114)
    return rfm_unit
Exemplo n.º 4
0
 def rfm_init(self):
     """
         Инициализация RFM69
         На выходе объект класса rfm69
     """
     myconf = rfm69.RFM69Configuration()
     rfm_unit = rfm69.RFM69(dio0_pin=24,
                            reset_pin=22,
                            spi_channel=0,
                            config=myconf)
     # setting RSSI treshold
     rfm_unit.set_rssi_threshold(-114)
     return rfm_unit