Page 1 of 2

Linux and Python CPS transfer program

Posted: Sat Aug 21, 2021 10:38 pm
by pnspotts
Hi folks,

I'm building my code plug for my week-old OpenGD77, first using Windows 10 and now trying to use the python script for uploading and downloading CPSs on Manjaro Linux. During the first try uploarding, I got an error message saying that Python's serial module was missing. I installed the module from Manjaro's repository and ran the script again (as SUDO). All seemed to go well until the script stopped at with the following error message. I have no clue how to translate it. Can someone please turn this into passable English and point me toward a solution?
20210821_162358.jpg
20210821_162358.jpg (55.28 KiB) Viewed 3887 times
Thanks in advance for any help you can give. And if images of error messages (cropped to meet file-size limits) are bad form, please set me straight.

With best regards,

Pete
NM5PS

Re: Linux and Python CPS transfer program

Posted: Sun Aug 22, 2021 7:02 am
by oh1fss
Hi!

The actual error is the last message, an input/output error.

Earlier in the error messages I can see that GD77transfer.py caught the error while it was waiting for a response from the radio (line 257).

Is your radio on normally? When uploading a codeplug your radio must not be in firmware upgrade mode, it must be on (such as on an idle FM channel).

Also my cable was tight, I had to press it tightly before the connection worked. But if you have upgraded your firmware successfully, I assume that your cable works.

GL and 73, OH1FSS

Re: Linux and Python CPS transfer program

Posted: Sun Aug 22, 2021 7:08 am
by oh1fss
Another problem might be wrong serial device parameter (the -d parameter for GD77transfer). In my Fedora 34, the parameter is typically /dev/ttyUSB0. You can check the correct device name with the dmesg command right after you plug in and power up your radio.

Re: Linux and Python CPS transfer program

Posted: Sun Aug 22, 2021 11:05 pm
by pnspotts
Thank you, Juhani. The cable was plugged in all the way, and the HT was powered on but not in firmware mode. However, in looking through the Python code for an indication of what /dev/tty???? the script wanted to see, it was /dev/ttyACM0. I presume that when I turn on the HT and identify the /dev/tty???? that the dmesg command shows, I should edit that one entery in the script to use what the laptop shows?

With best regards,

Pete - NM5PS

Re: Linux and Python CPS transfer program

Posted: Mon Aug 23, 2021 5:01 am
by oh1fss
Hi!

You don't have to edit the Python program, you can use the -d command line parameter. So, plug in and power up your radio and issue the dmesg command. Look up the tty name and then issue the GD77transfer.py command:

Code: Select all

$ dmesg
...
usb 5-2: Product: MCU VIRTUAL COM DEMO
usb 5-2: Manufacturer: NXP SEMICONDUCTORS
cdc_acm 5-2:1.0: ttyACM2: USB ACM device
...
$ sudo ./GD77transfer.py -w -f MYCODEPLUGFILENAME -d /dev/ttyACM2
Note that if dmesg shows ttyACM2, you have to use the full path /dev/ttyACM2.

By the way, I use Fedora 34 distribution, and if I add my user ID to the dialout group, I don't have to use the sudo command.

73, OH1FSS

Re: Linux and Python CPS transfer program

Posted: Mon Aug 23, 2021 8:45 am
by pnspotts
Here is what dmesg returned after attaching the HT and turning it on:

[11211.738333] audit: type=1104 audit(1629682430.658:119): pid=3300 uid=1000 auid=1000 ses=2 subj==unconfined msg='op=PAM:setcred grantors=pam_faillock,pam_permit,pam_faillock acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
[11287.275238] usb 1-2: new full-speed USB device number 10 using xhci_hcd
[11287.398593] usb 1-2: device descriptor read/64, error -71
[11287.628609] usb 1-2: device descriptor read/64, error -71
[11287.858573] usb 1-2: new full-speed USB device number 11 using xhci_hcd
[11287.981913] usb 1-2: device descriptor read/64, error -71
[11288.211940] usb 1-2: device descriptor read/64, error -71
[11288.318663] usb usb1-port2: attempt power cycle
[11288.961915] usb 1-2: new full-speed USB device number 12 using xhci_hcd
[11288.962211] usb 1-2: Device not responding to setup address.
[11289.168941] usb 1-2: Device not responding to setup address.
[11289.375162] usb 1-2: device not accepting address 12, error -71
[11289.498606] usb 1-2: new full-speed USB device number 13 using xhci_hcd
[11289.498890] usb 1-2: Device not responding to setup address.
[11289.705610] usb 1-2: Device not responding to setup address.
[11289.911905] usb 1-2: device not accepting address 13, error -71
[11289.912024] usb usb1-port2: unable to enumerate USB device
[11294.176847] audit: type=1101 audit(1629682513.098:120): pid=3314 uid=1000 auid=1000 ses=2 subj==unconfined msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="pspotts" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'

Re: Linux and Python CPS transfer program

Posted: Mon Aug 23, 2021 9:06 am
by F1RMB
Hi,

Are you sure you're using the right cable ?


Cheers.
---
Daniel

Re: Linux and Python CPS transfer program

Posted: Mon Aug 23, 2021 1:40 pm
by pnspotts
I use the cable that came with the radio, Daniel.

With best regards,

Pete
NM5PS

Re: Linux and Python CPS transfer program

Posted: Mon Aug 23, 2021 3:00 pm
by F1RMB
pnspotts wrote:
Mon Aug 23, 2021 1:40 pm
I use the cable that came with the radio, Daniel.

With best regards,

Pete
NM5PS
Okay....

Here is what you get, plugging a GD-77 with a DM-1801/RD-5R cable:

Code: Select all

[407520.629243] usb 3-1: new low-speed USB device number 41 using xhci_hcd
[407520.765275] usb 3-1: device descriptor read/64, error -71
[407521.001271] usb 3-1: device descriptor read/64, error -71
[407521.245225] usb 3-1: new low-speed USB device number 42 using xhci_hcd
[407521.373255] usb 3-1: device descriptor read/64, error -71
[407521.613267] usb 3-1: device descriptor read/64, error -71
[407521.721384] usb usb3-port1: attempt power cycle
[407522.137212] usb 3-1: new low-speed USB device number 43 using xhci_hcd
[407522.137631] usb 3-1: Device not responding to setup address.
[407522.345722] usb 3-1: Device not responding to setup address.
[407522.557235] usb 3-1: device not accepting address 43, error -71
[407522.689234] usb 3-1: new low-speed USB device number 44 using xhci_hcd
[407522.689760] usb 3-1: Device not responding to setup address.
[407522.897739] usb 3-1: Device not responding to setup address.
[407523.105187] usb 3-1: device not accepting address 44, error -71
[407523.105255] usb usb3-port1: unable to enumerate USB device
and a DM-1801 with the GD-77 cable

Code: Select all

[407685.824646] usb 3-1: new low-speed USB device number 45 using xhci_hcd
[407685.952633] usb 3-1: device descriptor read/64, error -71
[407686.188678] usb 3-1: device descriptor read/64, error -71
[407686.424575] usb 3-1: new low-speed USB device number 46 using xhci_hcd
[407686.552684] usb 3-1: device descriptor read/64, error -71
[407686.788628] usb 3-1: device descriptor read/64, error -71
[407686.896660] usb usb3-port1: attempt power cycle
[407687.308616] usb 3-1: new low-speed USB device number 47 using xhci_hcd
[407687.309141] usb 3-1: Device not responding to setup address.
[407687.517026] usb 3-1: Device not responding to setup address.
[407687.724634] usb 3-1: device not accepting address 47, error -71
[407687.852658] usb 3-1: new low-speed USB device number 48 using xhci_hcd
[407687.853111] usb 3-1: Device not responding to setup address.
[407688.061101] usb 3-1: Device not responding to setup address.
[407688.268635] usb 3-1: device not accepting address 48, error -71
[407688.268756] usb usb3-port1: unable to enumerate USB device

EDIT: maybe a bad connection on the Kenwood connecteur side, or a defect cable (you can probe it, there is no electronic inside).


Cheers.
---
Daniel

Re: Linux and Python CPS transfer program

Posted: Mon Aug 23, 2021 4:27 pm
by pnspotts
Thank you, Daniel. Very interesting. The cable I'm using came with the GD-77 and has Radioddity on the USB connector housing. Did they include the wrong Radioddity model's cable in the box? The cable works on a spare laptop (Windows 10) I used to set up my code plug and update it as I try to puzzle through this issue with Linux and the Python script. Is there a solution to this? If not, life and building code plugs for my OpenGD77 will go on, just without a Linux solution, at least for now. :)

With best regards,

Pete

P.S. Just saw the edit at the bottom of your most recent post. I'll take a look. Buy a replacement cable from Kenwood if needed? Thanks again!