Page 1 of 1

Issue with pistar-bmapi script

Posted: Mon Nov 29, 2021 11:42 am
by VU3BOJ
Hi

I have setup the BM api key on the Pistar and have the additional BM panel available on the admin page. And the buttons work fine too.

However, when I invoke the following command, it returns an error.

Code: Select all

$sudo pistar-bmapi dropdyn 0
 Request to BrandMeister API: Drop all Dynamic TG on TimeSlot 0 for DMR ID 4040xxx
Answer from BrandMeister API: Missing role {REPEATER_WRITE} for repeater 4040xxx
Mine is a simplex hotspot and the BM Network ESSID is 4040xxx11. What could be the issue?

Thanks,
Bejoy

Re: Issue with pistar-bmapi script

Posted: Mon Nov 29, 2021 3:37 pm
by AF6VN
While the help text for the command does state timeslot 0 for simplex, most such hotspots put all traffic on TS 2 -- have you tried the command using TS 2 instead of 0?

Though TS 0 is apparently working for me.

Code: Select all

pi-star@pi-star-3b(rw):~$ sudo pistar-bmapi dropdyn 0
 Request to BrandMesiter API: Drop all Dynamic TG on TimeSlot 0 for DMR ID 1126104
Answer from BrandMesiter API: Dropped dynamic groups on slot: 0

pi-star@pi-star-3b(rw):~$ sudo pistar-bmapi dropdyn 2
 Request to BrandMesiter API: Drop all Dynamic TG on TimeSlot 2 for DMR ID 1126104
Answer from BrandMesiter API: Dropped dynamic groups on slot: 2

pi-star@pi-star-3b(rw):~$
{Apparently time to reboot -- to clear the RW state}

Hmmm, I would note that BM is responding with text indicating it thinks you are a repeater (is the 4040xxx really what it returns or are you obscuring the last three digits? A four digit number starting with 4 indicates a reflector [which BM USA hasn't supported in years, and I think the other masters may be dropping reflector usage too).

Re: Issue with pistar-bmapi script

Posted: Mon Nov 29, 2021 4:44 pm
by VU3BOJ
I tried with 2, 0 and also with no arguments, but the result is same.

yes, xxx is the last 3 digits of the DMR ID.

Re: Issue with pistar-bmapi script

Posted: Mon Nov 29, 2021 4:52 pm
by VU3BOJ
Ok, with my rusty skill on bash scripts and commands, I looked into the pistar-bmapi script and I was able to reproduce the error. Issue happens when the BM API is expecting 7 digit DMR ID, but the script is sending 9 digit DMR ID, that includes the ESSID.

Turns out the following command in the script is returning 2 lines which is not expected for DMR Gateway configuration. This is causing the DMRID to be set incorrectly.

Code: Select all

pi-star@pi-star(ro):~$ sed -n -e '/\[DMR Network\]/,/\[System Fusion Network\]/p' /etc/mmdvmhost | grep "Address=" | awk -F "=" '/Address=/ {print $2}'
127.0.0.1
127.0.0.1
From /etc/mmdvmhost

Code: Select all

[DMR Network]
Enable=1
Address=127.0.0.1
Port=62031
Jitter=360
Password="none"
Slot1=0
Slot2=1
Debug=0
ModeHang=20
Type=Gateway
Local=62032
RemoteAddress=127.0.0.1
RemotePort=62031
LocalPort=62032
The two lines will match for "Address", causing the incorrect setting of DMRID.

Re: Issue with pistar-bmapi script

Posted: Tue Nov 30, 2021 9:58 am
by VU3BOJ
This is fixed https://github.com/AndyTaylorTweet/Pi-S ... /issues/48

Confirmed working.

Thanks Andy for quickly fixing this.

Re: Issue with pistar-bmapi script

Posted: Wed Dec 01, 2021 9:13 am
by MW0MWZ
VU3BOJ wrote: Tue Nov 30, 2021 9:58 am This is fixed https://github.com/AndyTaylorTweet/Pi-S ... /issues/48

Confirmed working.

Thanks Andy for quickly fixing this.
You're welcome :)