DMR-MARC DSDPlus.radios File For DSD+

Status
Not open for further replies.

CanesFan95

Active Member
Joined
Feb 14, 2008
Messages
3,134
Location
FL
I have created a DSDPlus.radios file for DSD+ that has all the DMR-MARC radio IDs with text descriptions. This is a current file with all the users as-of Saturday, December 10, 2016. I thought I would pass this along for anyone who would like to use it. This will allow you to automatically see the callsign, name, and location of whoever keys up.

Zippyshare.com - DSDPlus.radios



 

elraval

Member
Joined
Jan 4, 2014
Messages
23
Location
Barcelona, Spain
I have created a DSDPlus.radios file for DSD+ that has all the DMR-MARC radio IDs with text descriptions.

Thank you very much for this. Good job. I hope you haven't done al this by hand...

At least with me, one thing happens though; after a minute or so of having DSDplus running, when the program updates and stores the .radios file, most of the text in every line gets shortened to the same 31 character size.

Here's an example (6 first line after DSDplus 1.storing)

DMR, 0, 721, 1106001, 50, Normal, 0, 1211/20/16 20:35, "KK6YLW - Robert L Garvin in Chu"
DMR, 0, 721, 1106002, 50, Normal, 0, 1211/20/16 20:35, "K6FED - Frank E Decuire in Ranc"
DMR, 0, 721, 1106003, 50, Normal, 0, 1211/20/16 20:35, "K6IJ - Frederic K Honnold in Pi"
DMR, 0, 721, 1106005, 50, Normal, 0, 1211/20/16 20:35, "KI6NRR - Brian Kunkel in Santa "
DMR, 0, 721, 1106006, 50, Normal, 0, 1211/20/16 20:35, "KI6NRR - Brian Kunkel in Santa "
DMR, 0, 721, 1106007, 50, Normal, 0, 1211/20/16 20:35, "KE6CQV - Gareth Harris in South"

Is it happening to someone else also?

Is there a way to fix this anyone knows about?

Thanks

D
 

CanesFan95

Active Member
Joined
Feb 14, 2008
Messages
3,134
Location
FL
No, not by hand, but with Excel formulas. Try widening the Event Log window. My text also gets chopped off at the end, but not as short as that.
 

tanilolli

Newbie
Joined
Feb 14, 2017
Messages
2
Location
Montreal, Canada

slicerwizard

Member
Joined
Sep 19, 2002
Messages
7,662
Location
Toronto, Ontario
Does that script create a brand new DSDPlus.radios file? Because that would be a very bad thing. I doubt most users want to lose all of their non-DMR-MARC radio records.
 

slicerwizard

Member
Joined
Sep 19, 2002
Messages
7,662
Location
Toronto, Ontario
The script doesn't handle empty fields very well:

"PD0FEB: Dirk in , , Netherlands"


If $data[3] or $data[4] are empty, they and their following comma shouldn't be written.


BTW, for anyone who doesn't know how to run a script:

powershell -ExecutionPolicy Bypass .\DMR-MARC.ps1

(I named the script DMR-MARC.ps1 and changed the output file in the script from DSDPlus.radios to DMR-MARC.radios; that output file can be copy/pasted into DSDPlus.radios)

You can enter that command text at a command prompt or stick it in a .bat file.


Modified the script to deal with empty strings:

Code:
$database = "http://www.dmr-marc.net/cgi-bin/trbo-database/datadump.cgi?table=users&format=csv&header=0"
$csv = "datadump.csv"
Write-Host "Downloading database dump from DMR-Marc..."
Invoke-WebRequest $database -OutFile $csv

If (Test-Path $csv){
	$reader = [System.IO.File]::OpenText($csv)
	$writer = New-Object System.IO.StreamWriter 'DMR-MARC.radios'
	Write-Host "Converting database dump to DMR-MARC.radios"
	for(;;) {
	    $line = $reader.ReadLine()
	    if ($null -eq $line) {
	        break
	    }
	    $data = $line.Split(",")
	    $protocol = "DMR"
	    $id = $data[0]
	    $networkID = 0
	    $group = 712
	    $radio = $data[0]
	    $priority = 50
	    $override = "Normal"
	    *****s = 0
	    $timestamp = $(get-date).ToString("yyyy/MM/dd HH:mm");
	    $data[2] = $data[2].Trim();
	    $remark =  '"' + $data[1] + ': ' + $data[2] + ' in '

	    if ($data[3].length)
	    	{$remark = $remark + $data[3] + ', '}

	    if ($data[4].length)
	    	{$remark = $remark + $data[4] + ', '}

	    $remark = $remark + $data[5] + '"'
	    $writer.WriteLine('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}', $protocol, $networkID, $group, $id, $priority, $override, *****s, $timestamp, $remark)
	}
	$reader.Close()
	$writer.Close()

	Write-Host "Cleaning up..."
	If (Test-Path $csv){
	    Remove-Item $csv
	}
}
Else{
	Write-Host "Error: Could not download database dump from DMR-Marc."
}
 
Last edited:

tanilolli

Newbie
Joined
Feb 14, 2017
Messages
2
Location
Montreal, Canada
Thanks for fixing the empty values! I updated the gist in case anyone tries to download from my link. (Also the profanity filter blocked the hits variable haha)
 

natedawg1604

Member
Premium Subscriber
Joined
Jun 29, 2013
Messages
2,728
Location
Colorado
The script doesn't handle empty fields very well:

"PD0FEB: Dirk in , , Netherlands"


If $data[3] or $data[4] are empty, they and their following comma shouldn't be written.


BTW, for anyone who doesn't know how to run a script:

powershell -ExecutionPolicy Bypass .\DMR-MARC.ps1

(I named the script DMR-MARC.ps1 and changed the output file in the script from DSDPlus.radios to DMR-MARC.radios; that output file can be copy/pasted into DSDPlus.radios)

You can enter that command text at a command prompt or stick it in a .bat file.


Modified the script to deal with empty strings:

Code:
$database = "http://www.dmr-marc.net/cgi-bin/trbo-database/datadump.cgi?table=users&format=csv&header=0"
$csv = "datadump.csv"
Write-Host "Downloading database dump from DMR-Marc..."
Invoke-WebRequest $database -OutFile $csv

If (Test-Path $csv){
	$reader = [System.IO.File]::OpenText($csv)
	$writer = New-Object System.IO.StreamWriter 'DMR-MARC.radios'
	Write-Host "Converting database dump to DMR-MARC.radios"
	for(;;) {
	    $line = $reader.ReadLine()
	    if ($null -eq $line) {
	        break
	    }
	    $data = $line.Split(",")
	    $protocol = "DMR"
	    $id = $data[0]
	    $networkID = 0
	    $group = 712
	    $radio = $data[0]
	    $priority = 50
	    $override = "Normal"
	    *****s = 0
	    $timestamp = $(get-date).ToString("yyyy/MM/dd HH:mm");
	    $data[2] = $data[2].Trim();
	    $remark =  '"' + $data[1] + ': ' + $data[2] + ' in '

	    if ($data[3].length)
	    	{$remark = $remark + $data[3] + ', '}

	    if ($data[4].length)
	    	{$remark = $remark + $data[4] + ', '}

	    $remark = $remark + $data[5] + '"'
	    $writer.WriteLine('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}', $protocol, $networkID, $group, $id, $priority, $override, *****s, $timestamp, $remark)
	}
	$reader.Close()
	$writer.Close()

	Write-Host "Cleaning up..."
	If (Test-Path $csv){
	    Remove-Item $csv
	}
}
Else{
	Write-Host "Error: Could not download database dump from DMR-Marc."
}

I tried the script and got the following error message:


Missing expression after ','.
At ...\DMR-MARC.ps1:35 char:128
+ $writer.WriteLine('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}', $pro
tocol, $networkID, $group, $id, $priority, $override, <<<< $*****s, $timestamp
, $remark)
+ CategoryInfo : ParserError: (,:String) [], ParseException
+ FullyQualifiedErrorId : MissingExpressionAfterToken
 

slicerwizard

Member
Joined
Sep 19, 2002
Messages
7,662
Location
Toronto, Ontario
Oh ****, RR is censoring *****s ("<dollar sign><hits>"). So much for not mangling code fragments.

I've changed *****s to $poops...

Code:
$database = "http://www.dmr-marc.net/cgi-bin/trbo-database/datadump.cgi?table=users&format=csv&header=0"
$csv = "datadump.csv"
Write-Host "Downloading database dump from DMR-Marc..."
Invoke-WebRequest $database -OutFile $csv

If (Test-Path $csv){
    $reader = [System.IO.File]::OpenText($csv)
    $writer = New-Object System.IO.StreamWriter 'DMR-MARC.radios'
    Write-Host "Converting database dump to DMR-MARC.radios"
    for(;;) {
        $line = $reader.ReadLine()
        if ($null -eq $line) {
            break
        }
        $data = $line.Split(",")
        $protocol = "DMR"
        $id = $data[0]
        $networkID = 0
        $group = 712
        $radio = $data[0]
        $priority = 50
        $override = "Normal"
        $poops = 0
        $timestamp = $(get-date).ToString("yyyy/MM/dd HH:mm");
        $data[2] = $data[2].Trim();
        $remark =  '"' + $data[1] + ': ' + $data[2] + ' in '

        if ($data[3].length)
            {$remark = $remark + $data[3] + ', '}

        if ($data[4].length)
            {$remark = $remark + $data[4] + ', '}

        $remark = $remark + $data[5] + '"'
        $writer.WriteLine('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}', $protocol, $networkID, $group, $id, $priority, $override, $poops, $timestamp, $remark)
    }
    $reader.Close()
    $writer.Close()

    Write-Host "Cleaning up..."
    If (Test-Path $csv){
        Remove-Item $csv
    }
}
Else{
    Write-Host "Error: Could not download database dump from DMR-Marc."
}
 

natedawg1604

Member
Premium Subscriber
Joined
Jun 29, 2013
Messages
2,728
Location
Colorado
Oh ****, RR is censoring *****s ("<dollar sign><hits>"). So much for not mangling code fragments.

I've changed *****s to $poops...

Code:
$database = "http://www.dmr-marc.net/cgi-bin/trbo-database/datadump.cgi?table=users&format=csv&header=0"
$csv = "datadump.csv"
Write-Host "Downloading database dump from DMR-Marc..."
Invoke-WebRequest $database -OutFile $csv

If (Test-Path $csv){
    $reader = [System.IO.File]::OpenText($csv)
    $writer = New-Object System.IO.StreamWriter 'DMR-MARC.radios'
    Write-Host "Converting database dump to DMR-MARC.radios"
    for(;;) {
        $line = $reader.ReadLine()
        if ($null -eq $line) {
            break
        }
        $data = $line.Split(",")
        $protocol = "DMR"
        $id = $data[0]
        $networkID = 0
        $group = 712
        $radio = $data[0]
        $priority = 50
        $override = "Normal"
        $poops = 0
        $timestamp = $(get-date).ToString("yyyy/MM/dd HH:mm");
        $data[2] = $data[2].Trim();
        $remark =  '"' + $data[1] + ': ' + $data[2] + ' in '

        if ($data[3].length)
            {$remark = $remark + $data[3] + ', '}

        if ($data[4].length)
            {$remark = $remark + $data[4] + ', '}

        $remark = $remark + $data[5] + '"'
        $writer.WriteLine('{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}', $protocol, $networkID, $group, $id, $priority, $override, $poops, $timestamp, $remark)
    }
    $reader.Close()
    $writer.Close()

    Write-Host "Cleaning up..."
    If (Test-Path $csv){
        Remove-Item $csv
    }
}
Else{
    Write-Host "Error: Could not download database dump from DMR-Marc."
}

Awesome, it worked! Incidentally, on my Windows 7 machine I had to upgrade from Powershell 2 to Version 4. Version 2 apparently won't support Invoke-WebRequest.
 

dave3825

* * * * * * * * * * * *
Premium Subscriber
Joined
Feb 17, 2003
Messages
8,170
Location
Suffolk County NY
I noticed that in Homeboys-Scanna screenshot that the target \ talk group is 3100. And in the file from tanilolli, the target \ talk group is 712. If I add these to my dsdradios file, will it display the users rid if he is not on tg 712 and say 3109? I thought I read somewhere that the dump file has about 70000 rids. Is there a dsdradio file that contains the 70000 rids?

Thanks
 

CanesFan95

Active Member
Joined
Feb 14, 2008
Messages
3,134
Location
FL
Aw man, I need to do another update on this file and post it for everyone. I can't remember how I did it, but I think I did some concatenating in Excel.

I noticed that in Homeboys-Scanna screenshot that the target \ talk group is 3100. And in the file from tanilolli, the target \ talk group is 712. If I add these to my dsdradios file, will it display the users rid if he is not on tg 712 and say 3109? I thought I read somewhere that the dump file has about 70000 rids. Is there a dsdradio file that contains the 70000 rids?

Thanks

I believe the way it works is the radio ID alias will show no matter what conventional TG ID someone keys up on. If it's in the DSDPlus.radios file, then it'll be displayed.
 

CanesFan95

Active Member
Joined
Feb 14, 2008
Messages
3,134
Location
FL
Okay, figured it out and got it working.

39206313311_728438909b_o.png


New DMR-MARC database file as-of 12/21/2017, Download it here, homies:

TinyUpload.com - best file hosting solution, with no limits, totaly free

You don't have to replace your whole DSDPlus.radios file. Just copy and paste the rows into it.
 

dave3825

* * * * * * * * * * * *
Premium Subscriber
Joined
Feb 17, 2003
Messages
8,170
Location
Suffolk County NY
Aw man, I need to do another update on this file and post it for everyone.

I believe the way it works is the radio ID alias will show no matter what conventional TG ID someone keys up on. If it's in the DSDPlus.radios file, then it'll be displayed.

It seems to be working as I see names associated with talk groups other than what was entered into dsdradio file.

New DMR-MARC database file as-of 12/21/2017, Download it here, homies:

Homeboys-Scanna DSDPlus.radios file download, totaly free, totally awesome...

You don't have to replace your whole DSDPlus.radios file. Just copy and paste the rows into it.

Worked great. Thank you for the time and effort you took to do this..
 

CanesFan95

Active Member
Joined
Feb 14, 2008
Messages
3,134
Location
FL
No problem. It is unfortunate that the DMR database is poorly designed as far as normalization and data integrity goes. Man, they did a crappy job and it's too late now to go back now and fix it.
 

TomDX

Newbie
Joined
Jan 21, 2016
Messages
4
Location
Hamburg, Germany
Hii
I found somewhere a new working download link instead the DMR-MARC database:

$database = "https://ham-digital.org/status/users.csv"

greetings, Tom
 
Status
Not open for further replies.
Top