joshvillbrandt / GoProController

An http API to control multiple GoPro cameras over wifi.
Apache License 2.0
190 stars 43 forks source link

Cannot add new cameras #3

Closed fusi0nfire closed 9 years ago

fusi0nfire commented 9 years ago

When I click add camera nothing happens. I cannot figure out how to add my gopros to this UI/API. Everything seems to be working otherwise. The webpage/UI appears just like the screenshot and I did not encounter any issues or warnings during the install.

joshvillbrandt commented 9 years ago

Hey @fusi0nfire,

This repository has no user interface. Did you mean to post this issue to the GoProControllerUI repo? Assuming you are talking about GoProControllerUI, I imagine the Angular app is looking for the API in the wrong location. You have to set the api_root value in app/app.js. This step is currently missing from the documentation. Thanks for pointing it out!

By the way, the API itself is built on the Django REST Framework which also includes a browsable interface that you can use without GoProControllerUI. If you go to /api from a web browser, you should also be able to add and remove cameras from there.

Let me know if that works for you!

fusi0nfire commented 9 years ago

Hey Josh,

Thank you for working with me on this. I did indeed post this in the wrong spot.

Should app.value('api_root', 'X') look like '/home/darin/GoProController' or "http://localhost/api'

I currently have '/home/darin/GoProController'. When I go to http://localhost/api I can add a camera it seems, but the main webpage still has a disconnected icon at the top of the webpage. The add camera control still id not work. What am I missing to get the camera UI connected to the api?

joshvillbrandt commented 9 years ago

This is an HTTP API, so the value should be something like http://localhost/api.

fusi0nfire commented 9 years ago

That did not work either. Is their a debugging trick or log I can dump that would be more descriptive?

joshvillbrandt commented 9 years ago

Hmmm. Is http://localhost/apiindeed the location of your API? If it is using some other port besides 80, you'd need to specify that too. (Like http://localhost:8000/api for example.)

You should be able to open your browser's console to see what the actual error message is. If you are using Chrome, click Menu >> More Tools >> Developer Tools.

joshvillbrandt commented 9 years ago

FYI, the GoProControllerUI documentation has been updated to include a note about setting api_root. Thanks agian.

fusi0nfire commented 9 years ago

Here is the message from the console.

GET http://jvillbrandt-ubuntu/api/cameras net::ERR_NAME_NOT_RESOLVEDangular.js:8013

looks like there is still a reference but I'm having trouble locating it

joshvillbrandt commented 9 years ago

Alright, that means api_root hasn't actually been changed yet...

Did you rebuild the website after setting the value? Open GoProControllerUI/app/app.js, editapi_root, and then re-build withnpm startornpm run-script build`.

fusi0nfire commented 9 years ago
I did not rebuild before. Here are the results after rebuild using npm run-script build Now I get the same error with the correct address GET http://localhost/api/cameras net::ERR_ADDRESS_UNREACHABLE angular.js:8013 I am sorry to be a bother. I may be a bit out of my depth on this one.
joshvillbrandt commented 9 years ago

Is http://localhost/api actually the location of your API?

joshvillbrandt commented 9 years ago

Are you trying to run GoProController through Apache or through the development Python server? Are you trying to access from the same machine that you are running GoProController on or a different machine?

fusi0nfire commented 9 years ago

I am trying to access the UI from the local machine.

fusi0nfire commented 9 years ago

I can verify that the API sees the gopro and goproctrl can control the gopro from the command line. I just can't figure out why the UI won't talk to the API. Both were downloaded and installed to my /home/"user"/ folder.

I'm using the apache setup described in the Production setup.

http://localhost/api when entered into a browser will take me to the API where i did add a camera.

fusi0nfire commented 9 years ago

Could I send zip files that would be diagnostic? Node version? Is there a graceful way to start over?

joshvillbrandt commented 9 years ago

Given this information, setting line 28 in app/app.js to app.value('api_root', 'http://localhost/api'); should be the correct address if you only care about using the UI from that machine.

Do you have the latest commits from the master branch on both GoProController and GoProControllerUI? Otherwise, I'm not sure what else I can do to help you with this. Everything else works for me and I am reasonably confident that I have all of my bases covered here.

fusi0nfire commented 9 years ago

I changed the app.value('api_root', 'http://localhost/api'); to the machine nmae and all functioned well.