Ubuntu+wine, USB COM port issue. Simbolic link question
Good afternoon AskUbuntu community. I'm here to ask for a little help to better understand this great environment that i found out Ubuntu to be :)
So let's start from the beginning. I have a old Panasonic Toughbook CF-19 where I decided to try Ubuntu instead of Win to get more speed out of this old machine. It's the first time i've ever used ubuntu.
I want to use this computer as a navigation assistant by running a GPS mapping software called OziExplorer. This software is not avalaible for Linux but works good with Wine. So I installed OziExplorer using Wine and everything went good. To establish my current position i use a USB GPS "mouse" bought on Ebay that worked great on Windows and Oziexplorer. And here begins the problem. The GPS "mouse" is connected through USB, but actually speaks serial. In Win i had to install the famous CP210x drivers to have a virtual USB COM port. Luckily it happears that those drivers are already in the kernel of Ubuntu, in fact if i run dmesg after plugging my USB GPS receiver i get that it's has been recognized by the computer and has been assigned to the virtual com port "ttyUSB2". Next thing i've learned is that i have to make a simbolic link between the virtual com port and Wine to trick Oziexplorer to see the GPS receiver on COM1. So i ran the dmesg command again to check were the GPS receiver was assigned ( it's ttyUSB2) and run another command to create the simbolic link:
sudo ln -s /dev/ttyUSB2 com1I noticed that this command created a file, named "com1" inside .wine/dosdevices But still Oziexplorer refused to open the COM port and communicate with the GPS receiver, no matter wich com port i was linking the result was the same, FAIL! :( After trying and trying i came across a russian blog speaking about using OZIexplorer with wine where i found 2 more commands that i never saw in other discussions:
cd ~/.wine/dosdevices
sudo ln -s /dev/ttyUSB2 com1
sudo chmod 666 com1And by running this finally OziExplorer made connection with the GPS receiver on COM1 !! :D Now my problem is that everytime i put the laptop to sleep and/or I unplug/replug the GPS receiver, Oziexplorer refuse to open the COM port. And the only way to solve is to delete the "com1" file in /.wine/dosdevices and redo the
cd ~/.wine/dosdevices
sudo ln -s /dev/ttyUSB2 com1
sudo chmod 666 com1So i'm asking is there any way to make the setting permanent? can i create a shortcut on the desktop so i can just click once and run those commands automatically? if yes, please explain me how :)
Thank you for your patience. Alessio
22 Answers
- Open a terminal
- Run
nano fixCom1.sh Paste this into Nano:
#!/bin/sh ehco "Removing com1..." sudo rm ~/.wine/dosdevices/com1 echo "Linking ttyUSB2 to com1..." sudo ln -s /dev/ttyUSB2 ~/.wine/dosdevices/com1 echo "Setting permissions for com1..." sudo chmod 666 ~/.wine/dosdevices/com1 sleep 1Now, press CTRL+X, then Y and then Enter to write the file to disk
Next, do
chmod +x fixCom1.shRun nano again with
nano ~/Desktop/fixCOM1.desktopPaste this into Nano:
[Desktop Entry] Name="Fix COM 1" Exec=~/fixCom1.sh Terminal=true Type=Application
Now you will have an icon on your desktop!
Better solution is to use wine regedit.
$ wine regedit- Go to
HKLM/SOFTWARE/WINE/PORTS - Add key
com1with value/dev/ttyUSB2