Code: Select all
pistar-bmapi dropdyn 2
One reason could be, that due to editing the configuration files with some editor a stray '\r' is at the end of the line (perhaps editor uses DOS and not UNIX mode).
what happens is, that after the DMRID is extracted from a configuration file a carriage return is left at the end of the shell variable 'DMRID'.
With that variable a URL will be constructed which gets a '%0D' (URL encoded \r) added to the DMR-ID which will not be welcomed by the Brandmeister server and generates an error.
Easy to fix in /usr/local/sbin/pistar-bmapi:
Insert after the 'fi' around line 40 a new line with
Code: Select all
DMRID=${DMRID//$'\r'/}
Code: Select all
echo -n $DMRID|hd
DMRID=${DMRID//$'\r'/}
#echo -n $DMRID|hd
Code: Select all
pistar-bmapi dmrid
________________________________________________________________________________
The error output of pistar-bmapi looks like that:
Request to BrandMesiter API: Drop all Dynamic TG on TimeSlot 0 for DMR ID xxxxxxxxxx
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.7/json/__init__.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Answer from BrandMesiter API: