diff --git a/mesh_bot.py b/mesh_bot.py index 054aeff..28c2128 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1461,6 +1461,7 @@ def onReceive(packet, interface): simulator_flag = False isDM = False channel_name = "unknown" + session_passkey = None playingGame = False if DEBUGpacket: @@ -1492,9 +1493,11 @@ def onReceive(packet, interface): if globals().get(f'interface{i}_type', '') == 'ble'),0) if rxNode is None: - logger.warning(f"System: Received packet on unknown interface packet, dropped. Packet: {packet}") - return - + # default to interface 1 ## FIXME needs better like a default interface setting or hash lookup + if 'decoded' in packet and packet['decoded']['portnum'] in ['ADMIN_APP', 'SIMULATOR_APP']: + session_passkey = packet.get('decoded', {}).get('admin', {}).get('sessionPasskey', None) + rxNode = 1 + # check if the packet has a channel flag use it ## FIXME needs to be channel hash lookup if packet.get('channel'): channel_number = packet.get('channel') diff --git a/pong_bot.py b/pong_bot.py index 8ebedfa..6738c5c 100755 --- a/pong_bot.py +++ b/pong_bot.py @@ -225,6 +225,7 @@ def onReceive(packet, interface): simulator_flag = False isDM = False channel_name = "unknown" + session_passkey = None playingGame = False if DEBUGpacket: @@ -256,8 +257,10 @@ def onReceive(packet, interface): if globals().get(f'interface{i}_type', '') == 'ble'),0) if rxNode is None: - logger.warning(f"System: Received packet on unknown interface packet, dropped. Packet: {packet}") - return + # default to interface 1 ## FIXME needs better like a default interface setting or hash lookup + if 'decoded' in packet and packet['decoded']['portnum'] in ['ADMIN_APP', 'SIMULATOR_APP']: + session_passkey = packet.get('decoded', {}).get('admin', {}).get('sessionPasskey', None) + rxNode = 1 # check if the packet has a channel flag use it ## FIXME needs to be channel hash lookup if packet.get('channel'):