ZoneMinder / mlapi

An easy to use/extend object recognition API you can locally install. Python+Flask. Also works with ZMES!
Other
58 stars 34 forks source link

Issue with "Get an Access Token" #43

Closed FormBurden closed 3 years ago

FormBurden commented 3 years ago

I've followed your instructions up until the "Get an Access Token", and where I'm stuck is the whole example of "locahost:5000"

What do you mean by that? What should I put there? My ZoneMinder https url? or something else?

Sorry for the confusion.

baudneo commented 3 years ago

Use the zm IP address and :5000

Localhost:5000 will work if you are using a shell connected to your zm/es host.

FormBurden commented 3 years ago

Ah ok. Well, now I get a "curl: (7) Failed to connect to localhost port 5000" error. I'm guessing I should be running mlapi or something when I try to do this? But of course when I do the "python3 ./mlapi.py -c mlapiconfig.ini" command in the mlapi folder, in the ZoneMinder logs and if I run the --debug it states secret token not found MLAPI_SECRET_KEY which I assume you get from running the 'Get an Access Token" command, but that isn't working cause of connection port 5000 error.

What would I do?

baudneo commented 3 years ago

That's a seperate thing. The secret key it is referring to is inside mlapiconfig.ini, you can put anything you want there it's just a "seed" to create access tokens with. You set it once and never have to worry about it again.

baudneo commented 3 years ago

I would focus on getting zmes setup and running first before setting mlapi up though.

baudneo commented 3 years ago

If you can sanitize the passwords and stuff from your config file you can post it as a github gist and then post the link here. I can look over the file and see if I can help you config it properly.

FormBurden commented 3 years ago

Hey, don't worry about it. I got it working correctly. When you told me about just creating your own log string of text/characters for the secret key-pass, I did just that. And everything works correctly. I really appreciate it.