This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CONNECT_REQ not shown in Python but WireShark

Hi,

I managed to sniff some communcation in WireShark, ADV_INT, CONNECT_REQ, Empty PDU.

If I try to rebuild the functionality in Python, no CONNECT_REQ ist shown in the packets.

if packet.blePacket is not None:
    if packet.blePacket.advType == 5:
        print("this never happend before!!!!")
        exit(0)
    continue

Also extracting the PDU Type from the blePackets Payloads doesn't work out either. Just recently confirmed it's the same as packet.blePacket.advType :-D

It seems that it's never send from the phone (unusal, app and wireshark proves as it's working fine) or it gets lost some how. Restarted the code over and over again so interference or wrong channel can be excluded as an option.

Any idea what i'm doing wrong?

Running Win7 and Python 2 with nrfsniffer200beta312oct20181c2a221

 
Parents
  • This should be possible 

    Additionallycheck "if packet.blePacket.accessAddress == ADV_ACCESS_ADDRESS" before accessing advType since that attribute won't be there for connected packets.

    ADV_ACCESS_ADDRESS can be imported from Packet.py or hardcoded as [0xD6, 0xBE, 0x89, 0x8E]

    Additionally you can check the log files in %APPDATA%\Nordic Semiconductor\Sniffer and see if there are exceptions being thrown.

  • Thanks,

    thats not what i'm trying to accomplish.

    ADV_IND is send out with ACCESS_ADDRESS from my advertising device.
    In the code I'm checking all packages to fit desired Advertising Address, if so, Access Address is stored. (I just learned it's static Packet.ADV_ACCESS_ADDRESS)


    The captured Access Address used to find filter packages.
    If Access Address fitsand PDU_Typ is CONNECT_REQ it's send by central, which tries to connect to the advertisind device.
    That CONNECT_REQ package contains the new ACCESS ADDRESS. (Thats what I'm missing as I newer see one of those packages!!!)

    ACCESS ADDRESS is used to identify packages sent between central and the advertising device

    Any clue what got wrong?

    adv_access_address = None
    access_address = None
    
    # Takes list of packets
    def processPackets(packets):
        for packet in packets:
            # packet is of type Packet
            # packet.blePacket is of type BlePacket
            if packet.blePacket is not None:
    			global adv_access_address
    			global access_address
    
    			# 3. print payload
    			if access_address == packet.blePacket.accessAddress:
    				print(packet.blePacket.payload)
    
    			# 2. change access_address to CONNECT_REQs access address
    			if adv_access_address == packet.blePacket.accessAddress:
    				if packet.blePacket.advType == PDU_Typ.CONNECT_REQ: #5
    					access_address = extract_access_address(packet.blePacket.payload)
    			
    			# 1. get access_address
    			if adv_access_address is None and is_drifter_mac(packet.blePacket.advAddress):
    				adv_access_address = packet.blePacket.accessAddress
    				print("adv_access_address is ", adv_access_address)

    kind regards,

    Michael

Reply
  • Thanks,

    thats not what i'm trying to accomplish.

    ADV_IND is send out with ACCESS_ADDRESS from my advertising device.
    In the code I'm checking all packages to fit desired Advertising Address, if so, Access Address is stored. (I just learned it's static Packet.ADV_ACCESS_ADDRESS)


    The captured Access Address used to find filter packages.
    If Access Address fitsand PDU_Typ is CONNECT_REQ it's send by central, which tries to connect to the advertisind device.
    That CONNECT_REQ package contains the new ACCESS ADDRESS. (Thats what I'm missing as I newer see one of those packages!!!)

    ACCESS ADDRESS is used to identify packages sent between central and the advertising device

    Any clue what got wrong?

    adv_access_address = None
    access_address = None
    
    # Takes list of packets
    def processPackets(packets):
        for packet in packets:
            # packet is of type Packet
            # packet.blePacket is of type BlePacket
            if packet.blePacket is not None:
    			global adv_access_address
    			global access_address
    
    			# 3. print payload
    			if access_address == packet.blePacket.accessAddress:
    				print(packet.blePacket.payload)
    
    			# 2. change access_address to CONNECT_REQs access address
    			if adv_access_address == packet.blePacket.accessAddress:
    				if packet.blePacket.advType == PDU_Typ.CONNECT_REQ: #5
    					access_address = extract_access_address(packet.blePacket.payload)
    			
    			# 1. get access_address
    			if adv_access_address is None and is_drifter_mac(packet.blePacket.advAddress):
    				adv_access_address = packet.blePacket.accessAddress
    				print("adv_access_address is ", adv_access_address)

    kind regards,

    Michael

Children
Related