Page 1 of 3

SM-land codeplug (Sweden)

Posted: Tue Dec 26, 2023 8:03 pm
by SA0ASM
Hi!

I'm working on my codeplug for Sweden, hopefully to be shared in this thread soon, and whipped up a quick python script to import the repeater database from www.ssa.se. The program, along with example output is available on Github here: https://github.com/SA0ASM/rptconvert

If there is interest from neighbours in LA/OZ/OH-lands then I may support them in the future as well. Feedback is welcome in this thread or by email!

73 de SA0ASM

Re: SM-land codeplug (Sweden)

Posted: Thu Jan 25, 2024 10:16 pm
by LB8VK
Hello, very good news! Can you also prepare a DMR and FM codeplug for LA? :D

Re: SM-land codeplug (Sweden)

Posted: Fri Jan 26, 2024 8:50 pm
by SA0ASM
Sure, try importing these CSV files which include all the LA repeaters in the SK6BA database.

73 de SA0ASM

Re: SM-land codeplug (Sweden)

Posted: Wed Jan 31, 2024 10:47 pm
by LB8VK
Thank you, I have downloaded, I will test.

Re: SM-land codeplug (Sweden)

Posted: Sat Feb 24, 2024 10:40 am
by SM0IKR
Hi Olle,
Sorry to say the script do not work for me.
See attached errors:
PS C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main> python .\rpt2ogd77.py
C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main\rpt2ogd77.py:134: SyntaxWarning: invalid escape sequence '\.'
tone_pattern = re.compile('([0-9]+\.[0-9])')
Traceback (most recent call last):
File "C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main\rpt2ogd77.py", line 3, in <module>
from curses.ascii import isalnum
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\curses\__init__.py", line 13, in <module>
from _curses import *
ModuleNotFoundError: No module named '_curses'
PS C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main>

Is it win10 or wrong Python version.
73 Göran SM0IKR

Re: SM-land codeplug (Sweden)

Posted: Sat Feb 24, 2024 11:24 am
by SA0BUX
SM0IKR wrote:
Sat Feb 24, 2024 10:40 am
Hi Olle,
Sorry to say the script do not work for me.
See attached errors:
PS C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main> python .\rpt2ogd77.py
C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main\rpt2ogd77.py:134: SyntaxWarning: invalid escape sequence '\.'
tone_pattern = re.compile('([0-9]+\.[0-9])')
Traceback (most recent call last):
File "C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main\rpt2ogd77.py", line 3, in <module>
from curses.ascii import isalnum
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\curses\__init__.py", line 13, in <module>
from _curses import *
ModuleNotFoundError: No module named '_curses'
PS C:\Users\Göran\Downloads\rptconvert-main\rptconvert-main>

Is it win10 or wrong Python version.
73 Göran SM0IKR
It works better on Linux, but I tested on Windows and you need to install windows-curses as it complains about missing module '_curses'

Code: Select all

C:\Users\lan\Downloads>..\AppData\Local\Programs\Python\Python312\Scripts\pip.exe install windows-curses
Collecting windows-curses
  Downloading windows_curses-2.3.2-cp312-cp312-win_amd64.whl.metadata (2.7 kB)
Downloading windows_curses-2.3.2-cp312-cp312-win_amd64.whl (80 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.5/80.5 kB 901.3 kB/s eta 0:00:00
Installing collected packages: windows-curses
Successfully installed windows-curses-2.3.2

Getting many warnings that seems related to characters coding but it makes the CSV files

Code: Select all

C:\Users\lan\Downloads>..\AppData\Local\Programs\Python\Python312\python rpt2ogd77.py "repeaters (1).csv"
C:\Users\lan\Downloads\rpt2ogd77.py:134: SyntaxWarning: invalid escape sequence '\.'
  tone_pattern = re.compile('([0-9]+\.[0-9])')
Warning: district number à in "SKØNN Haninge 7" is not valid!
Warning: district number à in "SLØZS Västberg" is not valid!
Warning: district number à in "SLØZS Västberg" is not valid!
Warning: district number à in "SKØPQ Kista 2m" is not valid!
Warning: district number à in "SMØOFV Solna 2m" is not valid!
Warning: district number à in "SKØZA Solna 70c" is not valid!
Warning: district number à in "SKØRDZ Brottby" is not valid!
Warning: district number à in "SAØAZT Brottby" is not valid!

Re: SM-land codeplug (Sweden)

Posted: Thu Mar 21, 2024 6:22 pm
by SA0ASM
Hej!

The curses module is actually not needed and you can remove the import statement.
Your other issue seem to be related to the file not being correctly detected as UTF-8 encoded, I'll see if that can be hinted to allow it to work on Windows.

73 de SA0ASM

Re: SM-land codeplug (Sweden)

Posted: Sat Mar 30, 2024 8:53 am
by SA0BUX
SA0ASM wrote:
Thu Mar 21, 2024 6:22 pm
Hej!

The curses module is actually not needed and you can remove the import statement.
Your other issue seem to be related to the file not being correctly detected as UTF-8 encoded, I'll see if that can be hinted to allow it to work on Windows.

73 de SA0ASM
What character coding should the output be ?

Looks like it's in UTF-8 , to my knowledge the CPS and Radio only support plain ASCII ?

I can probably convert the files with "iconv -t ASCII//TRANSLIT" before they are imported into the CPS.

Re: SM-land codeplug (Sweden)

Posted: Sat Mar 30, 2024 12:51 pm
by SA0BUX
SA0BUX wrote:
Sat Mar 30, 2024 8:53 am
SA0ASM wrote:
Thu Mar 21, 2024 6:22 pm
Hej!

The curses module is actually not needed and you can remove the import statement.
Your other issue seem to be related to the file not being correctly detected as UTF-8 encoded, I'll see if that can be hinted to allow it to work on Windows.

73 de SA0ASM
What character coding should the output be ?

Looks like it's in UTF-8 , to my knowledge the CPS and Radio only support plain ASCII ?

I can probably convert the files with "iconv -t ASCII//TRANSLIT" before they are imported into the CPS.
An update.

I tried importing the CSV files as is ( with UTF-8 chars ) and it looks like gibberish in the CPS with Chinese characters but "åäö ÅÄÖ" is displayed correctly in the radio.
But as we can see that frequency and location data is corrupt even if they are correct in the Channnels.csv so the coding confuse the CPS import.
Screenshot 2024-03-30 134111.jpg
Screenshot 2024-03-30 134111.jpg (242.03 KiB) Viewed 1545 times
Screen1.png
Screen1.png (3.18 KiB) Viewed 1545 times

Re: SM-land codeplug (Sweden)

Posted: Wed Apr 03, 2024 4:08 pm
by SA0ASM
Yes, this is a known issue in the OpenGD77 CPS. The label texts are converted to a chinese character set in the GUI, however importing UTF-8 from CSV works fine as you have witnessed. I have reported this bug here: viewtopic.php?f=11&t=3625&p=28295 Please feel free to chime in to that thread!

73 de SA0ASM