Read/write GD-77 codeplug in Linux in Python 3 (experimental)
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
Normally the CPS has an existing codeplug it loads.
This is either the default codeplug which is installed with the CPS, or the Users last codeplug that they loaded or saved.
The CPS then just fills in the sections of the codeplug with the data from the radio.
I don't know what happens if the rest of the codeplug is empty, I guess the CPS probably does some checks, but I didnt write the CPS, I just decrypted and decompiled the official CPS (this sounds easy but it was a lot of work)
This is either the default codeplug which is installed with the CPS, or the Users last codeplug that they loaded or saved.
The CPS then just fills in the sections of the codeplug with the data from the radio.
I don't know what happens if the rest of the codeplug is empty, I guess the CPS probably does some checks, but I didnt write the CPS, I just decrypted and decompiled the official CPS (this sounds easy but it was a lot of work)
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
USB HID with python on Windows is a problem, because you have to uninstall the Windows native HID drivers and install some other USB HID drivers instead.
So although you can then communicate with the official firmware, many other things stop working on the Windows PC.
Serial (USB CDCACM) is a much more portable solution, because PySerial does not require special drivers on Windows, or Linux or RPi (and probably not OSX).
The only complication is the that the COM port driver must be loaded, but this is not a problem for 99% of users, as the driver definitely works on W7,W8 and W10.
The only problem I know on Windows is some Windows language versions e.g. Polish, the CPS seems to not detect the driver, but I don't know why this is, because the CPS just looks or a COM port whose name includes "OpenGD77" and when I ask people the name of the COM port it is always "OpenGD77"
Unfortunately the people who have problems with the driver do not seem to seem to be able to help with the technical analysis of the problem.
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
BTW.
I checked ages ago if it would be possible to build both HID for the codeplug upload and CDCACM for Hotspot mode, but the USB stack is too big to fit 2 different USB devices into the MCU ROM
Also, composite USB devices don't work correct on Windows versions below W10.
And. The USB stack source code is not designed for 2 different devices in the same firmware, at the same time, because of clashes in variable names in the core of the USB stack
So basically USB Serial (CDCACM) is the only viable option.
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
In the attached version there are two changes:
- Change delay in serial communications from 0.2 to 0.0
- When reading a codeplug, initialize first 0x0E bytes (which are not read nor written from/to the radio) so that CPS is happy
No changes in usage, see "./GD77transfer -h".
- Change delay in serial communications from 0.2 to 0.0
- When reading a codeplug, initialize first 0x0E bytes (which are not read nor written from/to the radio) so that CPS is happy
No changes in usage, see "./GD77transfer -h".
- Attachments
-
[The extension tgz has been deactivated and can no longer be displayed.]
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
Read working fine now and can be open from cps.
With WINE CPS is bugging alot, there is no menus at all, they are empty. dunno why. but here it is prove to work screenshot
With WINE CPS is bugging alot, there is no menus at all, they are empty. dunno why. but here it is prove to work screenshot
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
CPS works fine with Wine 5.0 in Fedora 30. Menu texts are visible normally.
It's very easy to install Wine and use CPS in Linux:
# dnf install wine
$ wine OpenGD77CPSInstaller.exe
Install as usual, except no USB drivers, because USB does not work in CPS with Wine. Then execute CPS from the Wine menu.
Instead of using the read/write functionality of CPS, open/save your codeplug. Then use GD77transfer to transfer the saved codeplug file to GD-77.
It's very easy to install Wine and use CPS in Linux:
# dnf install wine
$ wine OpenGD77CPSInstaller.exe
Install as usual, except no USB drivers, because USB does not work in CPS with Wine. Then execute CPS from the Wine menu.
Instead of using the read/write functionality of CPS, open/save your codeplug. Then use GD77transfer to transfer the saved codeplug file to GD-77.
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
Finally got time to test this.oh1fss wrote: ↑Sun May 24, 2020 12:31 pmIn the attached version there are two changes:
- Change delay in serial communications from 0.2 to 0.0
- When reading a codeplug, initialize first 0x0E bytes (which are not read nor written from/to the radio) so that CPS is happy
No changes in usage, see "./GD77transfer -h".
Everything works!
Now just read codeplug with Python, save, edit with wine+cps, save again, and finally write with python.
(Fedora 30, Python3)
Nice, thanks!
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
I need a way to read/write/edit codeplugs on Linux, so I started fiddling with this script here:
https://github.com/kzyapkov/opengd77xfer
Ideally, I want to implement parsing the codeplug to/from CSV or some other portable format. I'll probably have to look into the firmware or the CPS tool to figure out the format and semantics of fields. Any pointers are appreciated (except for NULL).
https://github.com/kzyapkov/opengd77xfer
Ideally, I want to implement parsing the codeplug to/from CSV or some other portable format. I'll probably have to look into the firmware or the CPS tool to figure out the format and semantics of fields. Any pointers are appreciated (except for NULL).
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
I'm not aware of any definitive documentation on the codeplug format.
You could look in the OpenGD77 firmware source
https://github.com/rogerclarkmelbourne/ ... codeplug.c
https://github.com/rogerclarkmelbourne/ ... codeplug.h
and the individual files in the CPS
e.g.
https://github.com/rogerclarkmelbourne/ ... #L127-L160
The OpenGD77 firmware only supports a small subset of the full Radioddity codeplug format, and the code in the firmware was written by reverse engineering the raw data and looking at some of the CS files.
You could look in the OpenGD77 firmware source
https://github.com/rogerclarkmelbourne/ ... codeplug.c
https://github.com/rogerclarkmelbourne/ ... codeplug.h
and the individual files in the CPS
e.g.
https://github.com/rogerclarkmelbourne/ ... #L127-L160
The OpenGD77 firmware only supports a small subset of the full Radioddity codeplug format, and the code in the firmware was written by reverse engineering the raw data and looking at some of the CS files.
Re: Read/write GD-77 codeplug in Linux in Python 3 (experimental)
Go to http://members.optuszoo.com.au/jason.re ... 77mods.htm and look for "codeplug map". It's not perfect, and it's based on the stock firmware, but it will get you most of the way there, and you can look at the CPS and firmware code.