Tag: winehq

  • AP Divesight on linux (wine)

    TL;DR

    Stop ModemManager, ensure the rfcomm port is properly linked to wine (symlinks). Pair and trust the MAC address of the handset each time you connect. Expect some download failures. Success??

    The easy way:

    I as able to get AP Divesight to work on virtual box OSE without too much difficulty. after following the instructions for USB forwarding I was able to connect without any difficulty, I was even able to monitor the traffic in wireshark on the host machine. But I would prefer to run the program using wine, as it is much lighter and feels better integrated.

    Initial Attempts

    By default, Wine will try to use software rendering, which makes the main application window invisible or completely unresponsive to mouse clicks. (At least that’s what I encountered, when I revisited this program, I initially had it working fine without this workaround). Also make sure you are using a version of wine that includes the required DLLs currently winehq-staging provides this (>= 11.5).

    Using wine

    AP Divesite requires the icuuc.dll libraries. Luckily versions of wine since 11.5 include these, so at the time of writing this is as easy as installing the staging version of wine from the official repo. alternatively there are a couple sources for DLLs that work (github discussion link).

    sudo dpkg --add-architecture i386
    sudo mkdir -pm755 /etc/apts/keyrings
    
    wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key
    
    sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
    
    sudo apt update

    Presumable the next step will change once a version greater than 11.5 becomes stable, but for now this worked for me:

    sudo apt install winehq-staging

    For a previous attempt at this project I used: https://github.com/FaithLife-Community/icu, there is a stack exchange answer here with a bash script and instructions to download and install the libraries to the wine prefix.

    1. Open your terminal and run:
      winecfg
    2. Navigate to the Graphics tab.
    3. Make sure “Allow the window manager to control the windows” is checked.
    4. Make sure “Allow the window manager to decorate the windows” is unchecked (this prevents the splash screen from trapping mouse focus).
    5. Click Apply and then OK.

    2. Launch with NVIDIA Hardware Acceleration

    To bypass the display server issues and force Pop!_OS to map the window layers correctly, you must launch the application by routing it directly through your dedicated NVIDIA graphics card.

    __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia wine ~/.wine/drive_c/Program\ Files\ \(x86\)/AP/AP\ DiveSight/AP\ DiveSight.exe
    

    Use code with caution.

    3. Create a Permanent Quick-Launch Shortcut (Optional)

    To avoid typing that long command every time, you can create a simple one-word shortcut (an alias).

    1. Open your terminal config file:
      nano ~/.bashrc
    2. Scroll to the very bottom of the file and paste this line exactly:
      alias divesight='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia wine ~/.wine/drive_c/Program\ Files\ \(x86\)/AP/AP\ DiveSight/AP\ DiveSight.exe'
    3. Save and exit
    4. Reload your terminal settings:
      source ~/.bashrc

    Now running divesight should get you a useable window. although I still cannot get it to connect on Bluetooth.

    It Works!…Then doesnt

    Update as of 14th september 2026. I have succesfully managed to download a dive using ap divesight and wine.

    • Put the handset in bluetooth mode.
    • ensure that your bluetooth is plugged in, then run the following
    bluetoothctl
    
    [bluetooth]# remove 00:06:##:##:##:##
    [bluetooth]# pair 00:06:##:##:##:##
    [bluetooth]# trust 00:06:##:##:##:##
    [bluetooth]# exit
    • Run the following in a terminal and leave it running:
      The first line ensures that any existing rfcomm processes are closed down, the second opens and maintains a serial connection that we can use.
    sudo rfcomm release all 2>/dev/null 
    sudo rfcomm connect 0 00:06:##:##:##:## 1
    • The next command links the rfcomm0 port with COM3 inside wine. (run it in a new terminal)
    ln -s /dev/rfcomm0 ~/.wine/dosdevices/com3
    • This command pre-sets the BAUD rate and options and esnures that the buffers are flushed immediately
    sudo stty -F /dev/rfcomm0 57600 cs8 -cstopb -parenb clocal -crtscts

    Honestly I am not sure what worked in the end, but I think that some of the permissions relating to /dev/rfcomm0 were messed up and after I fix this (sudo chmod 666 /dev/rfcomm0) I was able to communicate with the handset using a python script. and then when I tested Divesight it then showed an attempt to connect with the handset going through PC link 0,1,2,3 on the screen and the button in divesight changing to verifying. I still did not get further than this and the verifying timed out or failed eventually. I had been running divesight with every QT trace option imaginable.

    Lo and behold when I ran it without logging I was able to get communication established.

    When trying to download from multiple computers you must pair and trust when switching back to a previously trusted and connected platform.

    Repeatability

    After recording a ton of downloads through virtual box and storing the bluetooth packet captures. I was able to point the finger at modem manager and other Linux services interfering interrupting the transfer. While I would occasionally be able to download data it would be unreliable and would frequently leave divesight in an unresponsive state (if you click the download button in the connect dialog but the device disconnects before the display is properly loaded). The close button doesn’t work if this happens.

    Stopping Modem manager for the duration of the download was the easiest and most reliable way of avoiding interference. still occasionally times out or fails to verify.

    To be continued