Cron Jobs

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

Re: Cron Jobs

Post by KN2TOD »

A quick look at the logic:

Code: Select all

[email protected](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: 4
Joined: Sat Feb 22, 2020 1:12 pm

Re: Cron Jobs

Post by iv3bvk »

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

Code: Select all

[email protected](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:
[email protected](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:

[email protected](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
KN2TOD
Posts: 144
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: 4
Joined: Sat Feb 22, 2020 1:12 pm

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:
[email protected](ro):~$ sudo pistar-bmapi apikey

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

and command:
[email protected](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
Post Reply