Sniffer on OSX - revisited

It looks like the last discussion of Sniffer on Devzone was 2-3 yrs ago.

I’ve ordered the nRF Dongle and will download the Windows-based nRF Sniffer app.

i can run this with WireShark on a Windows VM on my Mac, though I would like a Mac OSX option.

- Any news on that front?

- Any way the Bluetooth hardware built into the MacBook could serve a Mac Sniffer app?

thanks!

Parents
  • Still looking for a solution here.  I think a few others are having the same trouble.

    , what is the next steps?

  • Can you summarize your versions so I can look at it.

    OS Version:
    Wireshark version:
    Python version:
    Pyserial version:

    Segger jlink version on PC:
    Segger jlink version or build date on the jlink emulator on nRF5x-DK:

    nRF Sniffer version:

    PCA board number: 

    =

    Python 32 bit or 64 bit:

    Use: 

    import ctypes
    ctypes.sizeof(ctypes.c_void_p)

    8 -> 64 bit
    4 -> 32 bit

  • Thanks for working on this, David Edwin!

    I've copied the contents of your new code into the ...\extcap folder
    no change in visibility of the interface in WireShark.

    I ran through the "Troubleshooting" steps in nRF_Sniffer_User_Guide_v2.1.
    All steps gave appropriate success results, except "screen port 460800" (same blank, unresponsive screen) and WireShark - with no evidence of the interface.

    I'm still open for a screen-share - 24/7.

    Thanks again!

    Dave

  • Can you try the screen option on all the the DKs that you have, I see that a PCA10031 and a PCA10040 were mentioned.

  • OK.  I'll try that tomorrow (Tuesday US Central time) with:
    Python 2.7.14
    pyserial (3.2.1)
    - SEGGER J-Link Commander V6.16c (Compiled Jun 16 2017 18:19:39)
       DLL version V6.16c, compiled Jun 16 2017 18:19:20
    - WireShark Mac OS 
    Version 2.4.5

    In separate sessions, I'll use each device (nRF dongle-PCA10031 and DK-PCA10040) and flash them using the appropriate parameters in JLINKEXE to "erase..." as in the Sniffer 2.1 User Guide.

    Then in OSX Terminal, I'll run "screen <port> 460800" 
    and report the results.

    Have I got it?

    Thanks

     

  • OK, I've run the above with no luck on either board.

    I'm wondering where to go next.

    I've been through the steps many times.

    Are others experiencing this problem?
    Is so, what is your environment?

  • I was having issues with Wireshark not showing the extcap interface in it's UI on Mac OS X 10.13.5, even though the files were in the correct location, inside the .app /Applications/Wireshark.app/Contents/MacOS/extcap/

    While trying to debug the issue, i decided to run wireshark directly from my shell to see any possible output via /Applications/Wireshark.app/Contents/MacOS/Wireshark

    Turns out, this was enough to get nrf_sniffer.py to load, so if you've been having trouble getting it to load, it might be worth running the executable directly from Terminal.app 

    I suspect it has something to do with environment variables that Wireshark inherits from the shell, but haven't debugged further. 

    EDIT: Turns out, the best way to fix this so regular app launches work was to change the shebang at the top of nrf_sniffer.py to point directly to your local python2 instance. For me, this was #!/usr/local/bin/python2

Reply
  • I was having issues with Wireshark not showing the extcap interface in it's UI on Mac OS X 10.13.5, even though the files were in the correct location, inside the .app /Applications/Wireshark.app/Contents/MacOS/extcap/

    While trying to debug the issue, i decided to run wireshark directly from my shell to see any possible output via /Applications/Wireshark.app/Contents/MacOS/Wireshark

    Turns out, this was enough to get nrf_sniffer.py to load, so if you've been having trouble getting it to load, it might be worth running the executable directly from Terminal.app 

    I suspect it has something to do with environment variables that Wireshark inherits from the shell, but haven't debugged further. 

    EDIT: Turns out, the best way to fix this so regular app launches work was to change the shebang at the top of nrf_sniffer.py to point directly to your local python2 instance. For me, this was #!/usr/local/bin/python2

Children
  • Wow!  This appears to be the magic bullet.  With that one change to the nrf_sniffer.py file, I now see this when launching Wireshark.

    I'll check this more thoroughly tomorrow, end-to-end, and with the otherwise-default installation options.

    Thanks a million!  I'll validate the answer after that checking.

  • Would this have been caught if the the "python --version" as requested in nRF Sniffer User guide v2.1 was verified ?

    Install nRF Sniffer Step 6.

    C:>python --version
    Python 2.7.x

  • My python version is (and has been throughout) 2.7.14 as display now below:

    Davids-MacBook-Pro-2:~ davidelvig$ python --version
    Python 2.7.14

    I posted that step way back ups in this thread.

    The only change I made recently, based on the post by @Richard was to edit the top of nrf_sniffer.py

    I've been delayed in my end-to-end testing, but still plan to do that in the coming days

    Thanks, all for your posts!

  • Can you also provide the output of "which python" ?

  • Python version

    Davids-MacBook-Pro-2:~ davidelvig$ python --version
    Python 2.7.14

    Which
    Davids-MacBook-Pro-2:~ davidelvig$ which python
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python

    In that ...\bin directory is:

    lrwxr-xr-x  1 root        admin     6B Mar 15 12:41 2to3 -> 2to3-2
    lrwxr-xr-x  1 root        admin     8B Mar 15 12:41 2to3-2 -> 2to3-2.7
    -rwxrwxr-x  1 root        admin   140B Sep 16  2017 2to3-2.7
    -rwxrwxr-x  1 root        admin   310B Mar 15 12:42 easy_install
    -rwxrwxr-x  1 root        admin   310B Mar 15 12:42 easy_install-2.7
    lrwxr-xr-x  1 root        admin     5B Mar 15 12:41 idle -> idle2
    lrwxr-xr-x  1 root        admin     7B Mar 15 12:41 idle2 -> idle2.7
    -rwxrwxr-x  1 root        admin   138B Sep 16  2017 idle2.7
    -rwxr-xr-x  1 davidelvig  admin    33K Mar 23 21:57 miniterm.py
    -rw-r--r--  1 davidelvig  admin    37K Mar 23 21:57 miniterm.pyc
    -rwxr-xr-x  1 davidelvig  admin   282B Mar 23 21:57 pip
    -rwxr-xr-x  1 davidelvig  admin   282B Mar 23 21:57 pip2
    -rwxr-xr-x  1 davidelvig  admin   282B Mar 23 21:57 pip2.7
    lrwxr-xr-x  1 root        admin     6B Mar 15 12:41 pydoc -> pydoc2
    lrwxr-xr-x  1 root        admin     8B Mar 15 12:41 pydoc2 -> pydoc2.7
    -rwxrwxr-x  1 root        admin   123B Sep 16  2017 pydoc2.7
    lrwxr-xr-x  1 root        admin     7B Mar 15 12:41 python -> python2
    lrwxr-xr-x  1 root        admin    10B Mar 15 12:41 python-32 -> python2-32
    lrwxr-xr-x  1 root        admin    14B Mar 15 12:41 python-config -> python2-config
    lrwxr-xr-x  1 root        admin     9B Mar 15 12:41 python2 -> python2.7
    lrwxr-xr-x  1 root        admin    12B Mar 15 12:41 python2-32 -> python2.7-32
    lrwxr-xr-x  1 root        admin    16B Mar 15 12:41 python2-config -> python2.7-config
    -rwxrwxr-x  1 root        admin    25K Sep 16  2017 python2.7
    -rwxrwxr-x  1 root        admin    14K Sep 16  2017 python2.7-32
    -rwxrwxr-x  1 root        admin   1.7K Sep 16  2017 python2.7-config
    lrwxr-xr-x  1 root        admin     8B Mar 15 12:41 pythonw -> pythonw2
    lrwxr-xr-x  1 root        admin    11B Mar 15 12:41 pythonw-32 -> pythonw2-32
    lrwxr-xr-x  1 root        admin    10B Mar 15 12:41 pythonw2 -> pythonw2.7
    lrwxr-xr-x  1 root        admin    13B Mar 15 12:41 pythonw2-32 -> pythonw2.7-32
    -rwxrwxr-x  1 root        admin    25K Sep 16  2017 pythonw2.7
    -rwxrwxr-x  1 root        admin    14K Sep 16  2017 pythonw2.7-32
    lrwxr-xr-x  1 root        admin     9B Mar 15 12:41 smtpd.py -> smtpd2.py
    -rwxrwxr-x  1 root        admin    18K Sep 16  2017 smtpd2.7.py
    lrwxr-xr-x  1 root        admin    11B Mar 15 12:41 smtpd2.py -> smtpd2.7.py

    After my latest edit, the top of the nrf_sniffer.py looks like this

    #!/usr/local/bin/python2
    #####!/usr/bin/env python
    
    # Copyright (c) 2017, Nordic Semiconductor ASA
    #
    # All rights reserved.
    #
    # Redistribution and use in source and binary forms, with or without
    

    A listing of /usr/local/bin is as follows:

    lrwxr-xr-x  1 root        wheel    66B Mar 15 12:41 2to3 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/2to3
    lrwxr-xr-x  1 root        wheel    68B Mar 15 12:41 2to3-2 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/2to3-2
    lrwxr-xr-x  1 root        wheel    70B Mar 15 12:41 2to3-2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/2to3-2.7
    lrwxr-xr-x  1 root        wheel    47B Apr  2 09:59 JFlashLite -> /Applications/SEGGER/JLink_V630j/JFlashLite.app
    lrwxr-xr-x  1 root        wheel    47B Apr  2 09:59 JFlashLite.app -> /Applications/SEGGER/JLink_V630j/JFlashLite.app
    lrwxr-xr-x  1 root        wheel    42B Apr  6 12:47 JFlashSPI -> /Applications/SEGGER/JLink_V616c/JFlashSPI
    lrwxr-xr-x  1 root        wheel    41B Apr  6 12:47 JLinkExe -> /Applications/SEGGER/JLink_V616c/JLinkExe
    lrwxr-xr-x  1 root        wheel    47B Apr  6 12:47 JLinkGDBServer -> /Applications/SEGGER/JLink_V616c/JLinkGDBServer
    lrwxr-xr-x  1 root        wheel    51B Apr  2 09:59 JLinkGDBServer.app -> /Applications/SEGGER/JLink_V630j/JLinkGDBServer.app
    lrwxr-xr-x  1 root        wheel    52B Apr  2 09:59 JLinkGDBServerCL -> /Applications/SEGGER/JLink_V630j/JLinkGDBServerCLExe
    lrwxr-xr-x  1 root        wheel    56B Apr  6 12:47 JLinkLicenseManager.app -> /Applications/SEGGER/JLink_V616c/JLinkLicenseManager.app
    lrwxr-xr-x  1 root        wheel    47B Apr  6 12:47 JLinkRTTClient -> /Applications/SEGGER/JLink_V616c/JLinkRTTClient
    lrwxr-xr-x  1 root        wheel    47B Apr  6 12:47 JLinkRTTLogger -> /Applications/SEGGER/JLink_V616c/JLinkRTTLogger
    lrwxr-xr-x  1 root        wheel    54B Apr  6 12:47 JLinkRegistration.app -> /Applications/SEGGER/JLink_V616c/JLinkRegistration.app
    lrwxr-xr-x  1 root        wheel    50B Apr  6 12:47 JLinkRemoteServer -> /Applications/SEGGER/JLink_V616c/JLinkRemoteServer
    lrwxr-xr-x  1 root        wheel    54B Apr  2 09:59 JLinkRemoteServer.app -> /Applications/SEGGER/JLink_V630j/JLinkRemoteServer.app
    lrwxr-xr-x  1 root        wheel    55B Apr  2 09:59 JLinkRemoteServerCLExe -> /Applications/SEGGER/JLink_V630j/JLinkRemoteServerCLExe
    lrwxr-xr-x  1 root        wheel    43B Apr  6 12:47 JLinkSTM32 -> /Applications/SEGGER/JLink_V616c/JLinkSTM32
    lrwxr-xr-x  1 root        wheel    47B Apr  6 12:47 JLinkSWOViewer -> /Applications/SEGGER/JLink_V616c/JLinkSWOViewer
    lrwxr-xr-x  1 root        wheel    44B Apr  6 12:47 JTAGLoadExe -> /Applications/SEGGER/JLink_V616c/JTAGLoadExe
    lrwxr-xr-x  1 davidelvig  admin    28B Feb 22 20:20 brew -> /usr/local/Homebrew/bin/brew
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 capinfos -> ./wireshark
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 dftest -> ./wireshark
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 dumpcap -> ./wireshark
    lrwxrwxr-x  1 root        admin    74B Mar 15 12:42 easy_install -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install
    lrwxrwxr-x  1 root        admin    78B Mar 15 12:42 easy_install-2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install-2.7
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 editcap -> ./wireshark
    lrwxr-xr-x  1 davidelvig  admin    33B Feb 22 20:42 ffmpeg -> ../Cellar/ffmpeg/3.4.2/bin/ffmpeg
    lrwxr-xr-x  1 davidelvig  admin    34B Feb 22 20:42 ffprobe -> ../Cellar/ffmpeg/3.4.2/bin/ffprobe
    lrwxr-xr-x  1 davidelvig  admin    35B Feb 22 20:42 ffserver -> ../Cellar/ffmpeg/3.4.2/bin/ffserver
    lrwxr-xr-x  1 root        wheel    66B Mar 15 12:41 idle -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/idle
    lrwxr-xr-x  1 root        wheel    67B Mar 15 12:41 idle2 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/idle2
    lrwxr-xr-x  1 root        wheel    69B Mar 15 12:41 idle2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/idle2.7
    lrwxr-xr-x  1 davidelvig  admin    29B Feb 22 20:42 lame -> ../Cellar/lame/3.100/bin/lame
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 mergecap -> ./wireshark
    -rwxrwxr-x  1 davidelvig  admin    29M Aug  1  2017 node
    lrwxr-xr-x  1 502         staff    38B Aug  4  2017 npm -> ../lib/node_modules/npm/bin/npm-cli.js
    lrwxrwxr-x  1 root        admin    65B Mar 15 12:42 pip -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pip
    lrwxrwxr-x  1 root        admin    66B Mar 15 12:42 pip2 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pip2
    lrwxrwxr-x  1 root        admin    68B Mar 15 12:42 pip2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pip2.7
    lrwxr-xr-x  1 root        wheel    67B Mar 15 12:41 pydoc -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc
    lrwxr-xr-x  1 root        wheel    68B Mar 15 12:41 pydoc2 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc2
    lrwxr-xr-x  1 root        wheel    70B Mar 15 12:41 pydoc2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc2.7
    lrwxr-xr-x  1 root        wheel    68B Mar 15 12:41 python -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python
    lrwxr-xr-x  1 root        wheel    71B Mar 15 12:41 python-32 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python-32
    lrwxr-xr-x  1 root        wheel    75B Mar 15 12:41 python-config -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
    lrwxr-xr-x  1 root        wheel    69B Mar 15 12:41 python2 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2
    lrwxr-xr-x  1 root        wheel    72B Mar 15 12:41 python2-32 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2-32
    lrwxr-xr-x  1 root        wheel    76B Mar 15 12:41 python2-config -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
    lrwxr-xr-x  1 root        wheel    71B Mar 15 12:41 python2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
    lrwxr-xr-x  1 root        wheel    74B Mar 15 12:41 python2.7-32 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-32
    lrwxr-xr-x  1 root        wheel    78B Mar 15 12:41 python2.7-config -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
    lrwxr-xr-x  1 root        wheel    69B Mar 15 12:41 pythonw -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw
    lrwxr-xr-x  1 root        wheel    72B Mar 15 12:41 pythonw-32 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw-32
    lrwxr-xr-x  1 root        wheel    70B Mar 15 12:41 pythonw2 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2
    lrwxr-xr-x  1 root        wheel    73B Mar 15 12:41 pythonw2-32 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2-32
    lrwxr-xr-x  1 root        wheel    72B Mar 15 12:41 pythonw2.7 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
    lrwxr-xr-x  1 root        wheel    75B Mar 15 12:41 pythonw2.7-32 -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7-32
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 randpkt -> ./wireshark
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 rawshark -> ./wireshark
    lrwxr-xr-x  1 root        wheel    70B Mar 15 12:41 smtpd.py -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/smtpd.py
    lrwxr-xr-x  1 root        wheel    73B Mar 15 12:41 smtpd2.7.py -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/smtpd2.7.py
    lrwxr-xr-x  1 root        wheel    71B Mar 15 12:41 smtpd2.py -> ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/smtpd2.py
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 text2pcap -> ./wireshark
    lrwxr-xr-x  1 root        admin    11B Mar 23 22:45 tshark -> ./wireshark
    -rwxr-xr-x  1 root        wheel   833B Feb 23 14:00 wireshark
    lrwxr-xr-x  1 davidelvig  admin    29B Feb 22 20:42 x264 -> ../Cellar/x264/r2854/bin/x264

Related