Ejemplo n.º 1
0
 async def send_updf(self) -> None:
     try:
         await asyncio.sleep(3)
         while True:
             logger.debug('LGWSIM - UPDF FCnt=%d' % (self.fcnt, ))
             if self.fcnt < 5:
                 # First we're sending on 10% band and expect a reply for every frame
                 freq = 869.525
                 port = 1
             elif self.fcnt < 10:
                 # Send on a .1% band - only 1st reply, other blocked by DC
                 freq = 867.100
                 port = 2
             else:
                 freq = 869.525
                 port = 3 if cups.qcnt >= 2 else 4  # signal termination
             if 0 not in self.units:
                 return
             lgwsim = self.units[0]
             await lgwsim.send_rx(rps=(7, 125),
                                  freq=freq,
                                  frame=su.makeDF(fcnt=self.fcnt,
                                                  port=port))
             self.fcnt += 1
             await asyncio.sleep(1.0)
     except asyncio.CancelledError as err:
         logger.warning('send_updf task canceled.')
     except Exception as exc:
         logger.error('send_updf failed!', exc_info=True)
Ejemplo n.º 2
0
 async def send_updf(self) -> None:
     try:
         await asyncio.sleep(1.0)
         lgwsim = self.units[0]
         await lgwsim.send_rx(rps=(7, 125),
                              freq=869.525,
                              frame=su.makeDF(fcnt=0, port=1))
         self.updf_task = None
     except Exception as exc:
         logger.error('send_updf failed!', exc_info=True)
Ejemplo n.º 3
0
 async def send_updf(self) -> None:
     '''Send uplinks periodically'''
     try:
         while True:
             freq = tu.router_config_EU863_6ch['upchannels'][random.randint(0,5)][0] / 1e6
             logger.debug('> LGWSIM RX - FCnt=%d Freq=%.3fMHz', self.fcnt, freq)
             if 0 not in self.units:
                 return
             lgwsim = self.units[0]
             await lgwsim.send_rx(rps=(7,125), freq=freq, frame=su.makeDF(fcnt=self.fcnt, port=1))
             self.fcnt += 1
             await asyncio.sleep(UPLINK_SEND_INTERVAL)
     except asyncio.CancelledError:
         pass
     except Exception as exc:
         logger.error("Exception during send_updf: %s", exc, exc_info=True)
Ejemplo n.º 4
0
 async def send_updf(self) -> None:
     try:
         await asyncio.sleep(1)
         while True:
             freq = tu.router_config_EU863_6ch['upchannels'][random.randint(0,5)][0] / 1e6
             logger.debug('> LGWSIM RX - FCnt=%d Freq=%.3fMHz', self.fcnt, freq)
             if 0 not in self.units:
                 return
             lgwsim = self.units[0]
             await lgwsim.send_rx(rps=(7,125), freq=freq, frame=su.makeDF(fcnt=self.fcnt, port=1))
             self.fcnt += 1
             await asyncio.sleep(5.0)
     except asyncio.CancelledError:
         pass
     except Exception as exc:
         logger.error('send_updf failed!', exc_info=True)
Ejemplo n.º 5
0
 async def send_updf(self) -> None:
     '''Send uplinks periodically'''
     try:
         while True:
             freq = tu.router_config_EU863_6ch['upchannels'][random.randint(
                 0, 5)][0] / 1e6
             print('> LGWSIM RX - FCnt=%d Freq=%.3fMHz' % (self.fcnt, freq))
             if 0 not in self.units:
                 return
             lgwsim = self.units[0]
             await lgwsim.send_rx(rps=(7, 125),
                                  freq=freq,
                                  frame=su.makeDF(fcnt=self.fcnt, port=1))
             self.fcnt += 1
             await asyncio.sleep(10.0)
     except Exception as exc:
         pass