- A Voyager's Companion

Page 4 of 5

Author:  Atmo [ 29 Apr 2014, 22:32 ]
Post subject:  Re: Pactor

Great, thanx, just managed and got

cd /
# assign wine com ports
rm -f /home/$USER/.wine/dosdevices/com*
for line in $(ls /dev/com*); do
port=$(echo $line|awk -F'/' '{print $3}')
ln -s $line /home/$USER/.wine/dosdevices/$port

# latitude
lata=$(cat /etc/|awk -F'.' '{print $1}')
if [ $(echo $lata|grep -c -) -eq 1 ]; then
lata=$(echo $lata|grep -om1 "[[:digit:]]\{1,3\}")
latb=$(printf %.0f $(echo 0.$(cat /etc/|awk -F'.' '{print $2}')*60|bc))
lat=$(echo -e "$lata\xb0$latb.00'$latc")

# longitude
lona=$(cat /etc/nx.lon|awk -F'.' '{print $1}')
if [ $(echo $lona|grep -c -) -eq 1 ]; then
lona=$(echo $lona|grep -om1 "[[:digit:]]\{1,3\}")
lonb=$(printf %.0f $(echo 0.$(cat /etc/nx.lon|awk -F'.' '{print $2}')*60|bc))
lon=$(echo -e "$lona\xb0$lonb.00'$lonc")

# airmail.ini setup
cfg=/home/$USER/.wine/drive_c/users/Public/Application\ Data/Airmail/Airmail.ini
sed -e 's/'"$(cat "$cfg"|grep -i "Current Latitude")"'/Current Latitude='$lat'/g' <"${cfg}" >"${cfg}.new"
mv "${cfg}.new" "${cfg}"
sed -e 's/'"$(cat "$cfg"|grep -m1 "Latitude")"'/Latitude='$lat'/g' <"${cfg}" >"${cfg}.new"
mv "${cfg}.new" "${cfg}"
sed -e 's/'"$(cat "$cfg"|grep -i "Current Longitude")"'/Current Longitude='$lon'/g' <"${cfg}" >"${cfg}.new"
mv "${cfg}.new" "${cfg}"
sed -e 's/'"$(cat "$cfg"|grep -m1 "Longitude")"'/Longitude='$lon'/g' <"${cfg}" >"${cfg}.new"
mv "${cfg}.new" "${cfg}"

# save attachment watchdog

# start airmail
cd $HOME/.wine/dosdevices/c:/Program\\ Files/Airmail/
ln -s $HOME/.wine/drive_c/users/Public/ $HOME/.wine/drive_c/users/$USER
env WINEPREFIX="$HOME/.wine"
wine $HOME/.wine/drive_c/Program\ Files/Airmail/Airmail3.exe

Greetings from Petra too!

Author:  Atmo [ 29 Apr 2014, 22:40 ]
Post subject:  Re: Pactor

I wasn't sure how to save stuff in Terminal, so I just hit the save button.
After opening Terminal again and putting the sudo line in Airmail opened automatically and I got:
nx@c:~$ !/bin/bash
bash: !/bin/bash: event not found
nx@c:~$ cd /
nx@c:/$ # assign wine com ports
nx@c:/$ comports
/dev/com1 -> /dev/ttyS0
/dev/com2 -> /dev/ttyS1
nx@c:/$ rm -f /home/$USER/.wine/dosdevices/com*
nx@c:/$ for line in $(ls /dev/com*); do
> port=$(echo $line|awk -F'/' '{print $3}')
> ln -s $line /home/$USER/.wine/dosdevices/$port
> done
nx@c:/$ # latitude
nx@c:/$ lata=$(cat /etc/|awk -F'.' '{print $1}')
nx@c:/$ latc=N
nx@c:/$ if [ $(echo $lata|grep -c -) -eq 1 ]; then
> latc=S
> fi
nx@c:/$ lata=$(echo $lata|grep -om1 "[[:digit:]]\{1,3\}")
nx@c:/$ latb=$(printf %.0f $(echo 0.$(cat /etc/|awk -F'.' '{print $2}')*60|bc))
nx@c:/$ lat=$(echo -e "$lata\xb0$latb.00'$latc")
nx@c:/$ # longitude
nx@c:/$ lona=$(cat /etc/nx.lon|awk -F'.' '{print $1}')
nx@c:/$ lonc=E
nx@c:/$ if [ $(echo $lona|grep -c -) -eq 1 ]; then
> lonc=W
> fi
nx@c:/$ lona=$(echo $lona|grep -om1 "[[:digit:]]\{1,3\}")
nx@c:/$ lonb=$(printf %.0f $(echo 0.$(cat /etc/nx.lon|awk -F'.' '{print $2}')*60|bc))
nx@c:/$ lon=$(echo -e "$lona\xb0$lonb.00'$lonc")
nx@c:/$ # airmail.ini setup
nx@c:/$ cfg=/home/$USER/.wine/drive_c/users/Public/Application\ Data/Airmail/Airmail.ini
nx@c:/$ sed -e 's/'"$(cat "$cfg"|grep -i "Current Latitude")"'/Current Latitude='$lat'/g' <"${cfg}" >"${cfg}.new"
nx@c:/$ mv "${cfg}.new" "${cfg}"
nx@c:/$ sed -e 's/'"$(cat "$cfg"|grep -m1 "Latitude")"'/Latitude='$lat'/g' <"${cfg}" >"${cfg}.new"
nx@c:/$ mv "${cfg}.new" "${cfg}"
nx@c:/$ sed -e 's/'"$(cat "$cfg"|grep -i "Current Longitude")"'/Current Longitude='$lon'/g' <"${cfg}" >"${cfg}.new"
nx@c:/$ mv "${cfg}.new" "${cfg}"
nx@c:/$ sed -e 's/'"$(cat "$cfg"|grep -m1 "Longitude")"'/Longitude='$lon'/g' <"${cfg}" >"${cfg}.new"
nx@c:/$ mv "${cfg}.new" "${cfg}"
nx@c:/$ # save attachment watchdog
nx@c:/$ airsave&
[1] 4713
nx@c:/$ # start airmail
nx@c:/$ cd $HOME/.wine/dosdevices/c:/Program\\ Files/Airmail/
bash: cd: /home/nx/.wine/dosdevices/c:/Program\: No such file or directory
nx@c:/$ ln -s $HOME/.wine/drive_c/users/Public/ $HOME/.wine/drive_c/users/$USER
ln: failed to create symbolic link ‘/home/nx/.wine/drive_c/users/nx/Public’: File exists
nx@c:/$ env WINEPREFIX="$HOME/.wine"
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
nx@c:/$ wine $HOME/.wine/drive_c/Program\ Files/Airmail/Airmail3.exe
err:menubuilder:init_xdg error looking up the desktop directory
WARNING: gnome-keyring:: couldn't connect to: /run/user/nx/keyring-N6Nz1d/pkcs11: No such file or directory
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}

I go to Elfrun now and seee if the magic worked!



Author:  Moe [ 29 Apr 2014, 22:58 ]
Post subject:  Re: Pactor

For the magic to work you need to flick your wand the other direction.

sudo medit /usr/local/bin/airmail
opens a text editor (medit) with the file airmail already in it.

You would then go to the fourth line of this text file
and add an -s
comports -s
Then you save the file and exit the text editor.

That it. ...oh, and greetings to Petra.

Author:  Atmo [ 30 Apr 2014, 01:52 ]
Post subject:  Re: Pactor

O.k., there seemed have to be some server maintenance going on.....,
that's it what I got: (after restarting a few times just to make sure...)

cd /
# assign wine com ports
comports -s
rm -f /home/$USER/.wine/dosdevices/com*
for line in $(ls /dev/com*); do
port=$(echo $line|awk -F'/' '{print $3}')
ln -s $line /home/$USER/.wine/dosdevices/$port

Still, usb serial attached to 0, airmail can't find a comport.
We'll see, will sort out the other stuff you asked me to try weeks ago...



Author:  Moe [ 30 Apr 2014, 02:57 ]
Post subject:  Re: Pactor

I think there were two issues going on.

1) this bug in the airmail script.
2) your usb/serial converter is not being recognised, or is being recognised-wrongly.

I don't think we have fixed the second problem.

(The server issue is with the hosting company. They did some modification a few months ago that made everything fragile. They think the problem is somewhere else and...we are not in charge.)

Author:  iv3xhr [ 30 Oct 2014, 02:45 ]
Post subject:  Re: Pactor

David wrote:
Just found a bug in the comport assignment of some navigatrix version... To fix it do the following:

sudo medit /usr/local/bin/airmail

and then change the line where it says "comports" to "comports -s"

Otherwise you may have trouble accessing the comports within airmail.

I think my problem is this
I use the 0.5 version
my airmail cannot work with com3 even if a comport -l command shows that on com3 is linked to rfcomm0 (my bluetooth port to pactor ptc)
but if in a terminal I say
comport -s
all works perfectly
but if i can try to modify
I don't found comport line
I found this at the beginning
# comport links are now created by udevd
# latitude
udevd ?
what can I do now ?

Author:  David [ 02 Nov 2014, 23:35 ]
Post subject:  Re: Pactor

The latest 0.5 (august) has an updated version of the comports script. Its now all done with udev as soon as you plug in a usb to serial adapter. I hope this works for you. You can use the files from the zip file to update your system with these. Afterward updating the files you need to restart udev with sudo service udev restart

Attachments: [2.45 KiB]
Downloaded 256 times

Author:  iv3xhr [ 04 Nov 2014, 17:58 ]
Post subject:  Re: Pactor

David wrote:
The latest 0.5 (august) has an updated version of the comports script. Its now all done with udev as soon as you plug in a usb to serial adapter. I hope this works for you. You can use the files from the zip file to update your system with these. Afterward updating the files you need to restart udev with sudo service udev restart

my problem is this:
I connect ptc trought a usb-bluetooth converter
the ptc has its bluetooth port
if I open my airmail and try connection with com3 it says that no ptc there is on com3
if in a terminal window I say to the sistem
comports -s
immediately after airmail connects the ptc on com3
to fix it now I've added a line in
with the comand
comports -s
and all works perfectly now
is there any other more elegant way to do this ?

Author:  David [ 04 Nov 2014, 22:25 ]
Post subject:  Re: Pactor

more elegant would be to do it using the systems udev service (like done in the from the previous post). than comports get updated at all times when you plugin the device.... not only when you start airmail. but if it works, leave it like this for now, indeed the missing parameter for the comports script was an error in a previous version. i did not test blue-tooth since i do not have it, eventually it would be necessary to adapt the udev rule if you like to use the udev method.

Author:  jens [ 17 Apr 2015, 14:54 ]
Post subject:  Re: Pactor

I have a similar problem - my usb port is correctly re-directed to com 3 and recognized by AirMail but for reasons unknown the initialization of the DR7400 pactor modem fails.
It doesn't seem to actually be talking to the outside world even though the port is recognized.
I have been messing around with this for a few days now but no joy :( .... any help would be greatly appreciated!
Oh, the same hardware under windoze works fine, same settings as well.

Author:  David [ 17 Apr 2015, 21:32 ]
Post subject:  Re: Pactor

Did you use the comports scripts with the udev rules from the previous post ? What is the output when you execute the command "version" ?

Author:  jens [ 17 Apr 2015, 21:55 ]
Post subject:  Re: Pactor

An interesting development ...... after several days messing with things, I somehow managed to connect to the modem via bluetooth ! I have no idea what if anything I did different but magically it works so who am I to argue with that!
I have not yet tried to see if I can also connect with a cable connection to the modem now.

My version of Navigatrix was downloaded maybe a week ago so it is fairly current version but I did not run any specific scripts.

I will hopefully have a chance to verify cabled operation tomorrow afternoon.

Thanks for your reply !

Author:  jens [ 18 Apr 2015, 19:42 ]
Post subject:  Re: Pactor

I had some more time for tests today ....
First I opened a terminal window so I could frequently do a comports -l to keep tabs on what the computer thought was attached.
I learned that plugging in a USB cable while bluetooth was configured kills the bluetooth connection. This was likely a big issue for me in my early attempts to get things going.
If bluetooth is activated, if the bluetooth connection has been established and no serial USB cable is hooked up, everything works.
If I turn off bluetooth and connect the serial USB cable, nothing works.
I have tried rebooting the modem (sometimes it can lock up the session) and have shut down AirMail and re-started it - no joy :(
I run version 0.5 of NX.
comports -s does not make a difference.

Author:  David [ 18 Apr 2015, 21:40 ]
Post subject:  Re: Pactor

Would you like to have a cable connection or a bluetooth connection ? I think we can figure out a solution. Can you give me the output of the command "version" there are different nx0.5 versions....the month tells wich is the latest.

Author:  jens [ 18 Apr 2015, 23:53 ]
Post subject:  Re: Pactor

I will be using bluetooth (which is why I bought the bluetooth enabled modem) but I have a tough time leaving questions unanswered so I would really like to figure out why a straight USB serial cable doesn't work. Especially since it works just fine under windoze.
The version 0.5 was from the start up screen. I will run the 'version' command and report on the result next time I am at the boat, probably tomorrow.

Author:  David [ 19 Apr 2015, 02:01 ]
Post subject:  Re: Pactor

This should work:

1. Disconnect from Bluetooth
2. Connect the USB Cable
3. Go to the Terminal and enter command: comports -s
4. You should see the USB to serial on com3 if there is no other com port
5. Now start Airmail and configure it like you do in Windows but use
the comport that was printed out on the terminal (most likely com3)

There is an older nx 0.5 version which had a bug with the user rights for the
com ports. If you have the current Version 0.5 (August 2014) then it should work fine.

Author:  jens [ 19 Apr 2015, 03:15 ]
Post subject:  Re: Pactor

Thanks for the detailed steps David. I will go through that procedure later today but as far as I know, this is exactly what I have done with no joy.
In any case, I will get the exact version number and will go through the steps as you laid them out and will report back.

Author:  jens [ 19 Apr 2015, 12:52 ]
Post subject:  Re: Pactor

Ok, my version is 0.5 from 14 August 2014
Following the steps to the letter will give me /dev/com3 => /dev/ttyUSB0 but there is no communication to the DR7400 :(

Author:  David [ 19 Apr 2015, 13:15 ]
Post subject:  Re: Pactor

After doing all the steps, but before running Airmail enter this command into the terminal and let me know if this helped....

sudo chmod ugo+rw /dev/ttyUSB*

Author:  jens [ 19 Apr 2015, 13:33 ]
Post subject:  Re: Pactor

Unfortunately no change ...

btw, I powered the modem down and back up just for the heck of it and did see some gibberish on the screen.
It's almost as if the serial parameters somehow are wrong. I am set for 115 k baud, just like in windoze.

Page 4 of 5 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group