CQRlog and K3NG Arduino keyer

12 posts / 0 new
Last post
w2xo
CQRlog and K3NG Arduino keyer

Hi All,
I am using CQRlog with the K3NG Arduino keyer.  At one time, there was a problem using the WinKeyer setting on the CW interface but that has been fixed, so CQRlog works with the Ardhino keyere now usiing the winkeyer setting.
One Problem is that the llead in and Tail PTT timing is being reset by CQRlog.  I have an old Henry 2K amplifier and I need about 15ms of lead timing on PTT in order not to miss the first 'dit'.
I'm not sure why the timing is being reset ?  There is no way to set it in the Preferences settings that I can find.
Sending a hex 01 durintg startup in 'Host Mode'  will cause the keyer to read the default settings and fixes the problem.
Thanks and 73
Jim, W2Xo
 

ok2cqr
ok2cqr's picture
Re: CQRlog and K3NG Arduino keyer

Hi Jim,
 
I'm sorry, I don't have access to K3NG keyer right now. I developed support last year when I was on OL7M super station (http://hamqth.com/ol7m) with Dan, OK1HRA and Honza, OK2ZAW from http://RemoteQTH.com. It worked and as far as I know I didn't send any command that should reset previous settings.
Please look at https://github.com/ok2cqr/cqrlog/blob/master/src/uCWKeying.pas, it starts on line 489. Maybe you will find the problem. Thank you for your help!
 
73 Petr
 
 

w2xo
CQRlog and K3NG Arduino Keyer

Hi Petr,
Sorry, I did not explain well.  I have worked with Tony, K3NG as there were some issues with the Winkey emulation mode on his keyer, involving the status byte.   That was fixed .   I am running CQRlog in Winkey keyer mode.  The "K3NG" setting uses the command line mode.  The Winkey mode is working well except the cw PTT lead and tail times are somehow being reset. So, I think that the code I need to work on is at line 174 where you send the 00 04 echo command to test the serial port.  If you could include in "CW Interface reload" a button to send 00 01, that would reset the keyer to the parameters in the ROM, which I have set to the proper PTT timings.
I do not have a K1EL Winkeyer, or I would say you could put the 00 01 reset command at every start, but K1EL's manual says not to issue that command on initialization, so maybe the CW interface reload is a better place ??
73  de Jim, W2XO
 

k3ng
CQRlog and K3NG Arduino Keyer

Jim, would you be able to send me a sniff of the serial port traffic between CQRLog and the Arduino Keyer?  (In the meantime I can probably put something in the Arduino code to hardcode the lead or tail PTT times.)

w2xo
CQRlog and K3NG Arduino Keyer

Hi Petr,
I built CQRlog 1.8.3 and I can not connect to the database, except the first time the program is run. I renamed .config/cqrlog to cqrlog.old and started the program again and after setting all preferences, I was able to connect to the database and all seemed OK, but when I started the program again, it would not connect to the database.
I logged in to the database from the mysql console using port  64000 and I can not see any log tables. 
I'm confused as to what is happening?
73 de Jim, W2XO
 

ok2cqr
ok2cqr's picture
Re: CQRlog and K3NG Arduino Keyer

Hi Jim,
 
please look at ~/.config/cqrlog/database/mysql.err file. There should be more information.
 
73 Petr

w2xo
CQRlog and K3NG Arduino Keyer

I amd building 1.8.3 from source.
I found that killing all instances of mysqld before starting CQRlog fixed the problem.
I have some information on a possible cure for the USB ports changing device numbers.  I will   post that when I'm sure it works. That is reallly annoying and causes CQRlog to hang on start if ttyUSB0 changes to ttyUSB1, which is likes to do.
I also wrote a function to set the PTT tail and lead timings. I copied your speed setting function, but it did not work.  More on that later.
73 de Jim, W2XO

oh1mrr
Why not make via UDEV. OH1KH

Why not make via UDEV. OH1KH have made this possible some while ago.
Find with lsusb what is your cwkeyer,  usb port, then you make dev like  "cwkeyer".
Then you make /usr/lib/udev/rules.d 99-persistent-usb.rules with content like mine 
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403",
ATTRS{idProduct}=="6001", ATTRS{serial}=="AM01XW7A", SYMLINK+="cwkeyer"
Naturally you put Vendor and Product as you see with lsusb command. Then you set in cqrlog preferences winkeyer usb port as /dev/cwkeyer...
Works for me

Jarmo

w2xo
CQRlog and K3NG Arduino keyer

Hi Jarmo,
Yes I am familiar with the UDEV system in Linux.
I problem I had with this approach was that it creates a symlink pointing to a usb device and not a serial device file and is not shown as a choice in some of the software I use , which looks only for serial device files in /dev and there is no way to assign the symlink as a serial device.  I had decided to give up on that and try to find a way to reset the actual device names to what they are after a reboot, as that would work better for me. e. I was  not aware that CQRlog would allow symlinks to be used selected as USB devices . Thank you for that information.
My latest effort to reset the USB system without rebooting failed again. Here is what I tried:
in /etc/udev/rules.d I have this in a file:
SUBSYSTEMS="usb-serial", ATTRS{idProduct}=="2303", ATTRS{idVendor}=="067b", NAME="ttyUSB0"SUBSYSTEMS="usb-serial", ATTRS{idProduct}=="0043", ATTRS{idVendor}=="2341", NAME="ttyACM0"and I have a shell script /usr/bin/ResetUSB, that has these lines:
echo -n "0000:00:1d.2" | tee /sys/bus/pci/drivers/uhci_hcd/unbindecho ""sleep 2echo -n "0000:00:1d.2" | tee /sys/bus/pci/drivers/uhci_hcd/bindecho ""sleep 5udevadm trigger
The udev rules are supposed to unbind the Prolific driver and reset the port device numbers to the same as after reboot.  They do not do this. I added the trigger command also, but no good.
Yes, if CQRlog will allow assigning symlinks, I can do that for CQRlog, but still will have problems with other software.
Thank you!  73 de Jim, W2XO
 
 

w2xo
CQRlog and K3NG Arduino keyer

Hi Petr,
I have what seems to be a partial solution to the 'floating' USB device numbers.  I tried many times to use the udev rules that OH1MRR suggested and on my system (Ubuntu 14.10) they just don't work for me.
What I ended up doing was writing a bash script that scans the /dev directory and looks for *ttyUSB* and *ttyACM* devices.  It then creates a hard link to them called "keyer" and 'rig" and I was able to jus set CQRlog to use those devices and if the device names change, I run the script and all is well as it erases the old hard links and makes new ones pointing to the new device names.   Not elegant, but works.   I don't have a Winkeyer. Making the script work with the Winkeyer would only amount to changing the "ttyACM*" to whatever it uses for device names.
Its a simple script, here it is if anybody is having the same problem.
#!/bin/bashrm /dev/rigrm /dev/keyerrig=`ls /dev/ttyUSB*`keyer=`ls /dev/ttyACM*`ln $rig /dev/rigln $keyer /dev/keyer

oh1mrr
CQRlog and K3NG keyer

Hi
Did you look with udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB1) | grep serial command what's your keyer serial is? It's important to have, like mine, AM01XW7A there. You propably have different?
 udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB1) | grep serial
    SUBSYSTEMS=="usb-serial"
    ATTRS{serial}=="AM01XW7A"
    ATTRS{serial}=="0000:00:14.0"
Jarmo

Jarmo

w2xo
CQRlog and K3NG keyer

Hi Jarmo
Yes. I tried that .  I have tried all the ATTRS that I could find that were different between the two devices.  I suspect it is a problem with Ubuntu 14.10.
I know that the ATTRS between the 'clone' USB to Serial converters are all the same, so I only use one of those.  The Arduino keyer has a good serial number, but the USB to Serial adapter has only 0, so I don't know if the problem is that 0 is not a good number?  The only way I was able to ever get the rules to work wias to use the device and port numbers, but those change, so that's not a good idea.
I have spent too much time on this and just gave up and wrote the shell script that I posted earlier. It looks for my keyer and rig device names in /dev and creates a hard link to 'keyer' and 'rig' and that works, but is certainly not an 'elegant' solution.
One other problem I ran into with the symlinks is that some software uses a function that scans only for serial ports and does not list the symlinks as a choice.
Thanks for the comments.  I will try again. Right now I'm 'burned out' on trying. I understand how it is supposed to work, but it seems that the rules are just getting ignored.
73 de Jim, W2XO