Cron Jobs

Post your tips and tricks here
KN2TOD
Posts: 262
Joined: Sun Nov 11, 2018 6:36 pm

Re: Cron Jobs

Post by KN2TOD »

A quick look at the logic:

Code: Select all

pi-star@pi-star(ro):sbin$ grep APIVer pistar-bmapi
                APIVer="2"
                APIVer="1.0"
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
if [[ ${APIVer} -ge 2 ]]; then
would suggest you are right; try changing the APIVer="1.0" statement to APIVer="1" and see if that fixes the problem.
IV3BVK
Posts: 7
Joined: Sat Feb 22, 2020 1:12 pm
Location: Trieste
Contact:

Re: Cron Jobs

Post by IV3BVK »

KN2TOD wrote: Tue Sep 06, 2022 12:59 am A quick look at the logic:

Code: Select all

pi-star@pi-star(ro):sbin$ grep APIVer pistar-bmapi
                APIVer="2"
                APIVer="1.0"
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
        if [[ ${APIVer} -ge 2 ]]; then
if [[ ${APIVer} -ge 2 ]]; then
would suggest you are right; try changing the APIVer="1.0" statement to APIVer="1" and see if that fixes the problem.
Hi,
I made the change, as recommended, by changing the variable "1.0" to "1".

Still the command does not work.

The odd thing is that I entered BM's API key v2, but it looks like Key v1. For what reason?

The command:
pi-star@pi-star2(rw):~$ sudo pistar-bmapi apikey

returns the following information:
Using BM API v1.0
Your BrandMeister API Key is: ecc ecc ecc... code


Now the message that appears after the command is the following:

pi-star@pi-star2(rw):~$ sudo pistar-bmapi addtg 2237 0

Using BM API v1.0
Request to BrandMesiter API: Add TG 2237 to TimeSlot 0 for DMR ID 222448316
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: 'NoneType' object is not subscriptable
Answer from BrandMesiter API:


Evidently there is still something wrong and the static TG is not added.

I haven't changed any other lines of the code, so I'm wondering how to fix the problem.

'73 de Paolo IV3BVK
-
Paolo IV3BVK

WW LOC JN65GX - 33074 Fontanafredda (PN)
web: www.paolettopn.it
KN2TOD
Posts: 262
Joined: Sun Nov 11, 2018 6:36 pm

Re: Cron Jobs

Post by KN2TOD »

Looks like you didn't complete the update to the V2 key or the key is corrupted. Try updating it again. Get a fresh key if need be.
IV3BVK
Posts: 7
Joined: Sat Feb 22, 2020 1:12 pm
Location: Trieste
Contact:

Re: Cron Jobs

Post by IV3BVK »

KN2TOD wrote: Tue Sep 06, 2022 6:15 pm Looks like you didn't complete the update to the V2 key or the key is corrupted. Try updating it again. Get a fresh key if need be.
Perfect, now I try with a new v2 key.

Incredible! Now the command to add the TG works regularly. Yet even in the past few days I had been using a new API v2 key.

Well, better that way.

Now the command:
pi-star@pi-star2(ro):~$ sudo pistar-bmapi apikey

returns the correct information:
Using BM API v2
Your BrandMeister API Key is: ecc, ecc. code....

and command:
pi-star@pi-star2(ro):~$ sudo pistar-bmapi addtg 2241 0

correctly returns:
Using BM API v2
Request to BrandMesiter API: Add TG 2241 to TimeSlot 0 for DMR ID 222448316
Answer from BrandMesiter API: OK


Many thanks for your support and solving my problem.
I didn't think I still had the old API key v1

'73 de Paolo IV3BVK
-
Paolo IV3BVK

WW LOC JN65GX - 33074 Fontanafredda (PN)
web: www.paolettopn.it
Post Reply