Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot make it work #2

Open
PunkHaz4rd opened this issue Sep 6, 2017 · 6 comments
Open

I cannot make it work #2

PunkHaz4rd opened this issue Sep 6, 2017 · 6 comments

Comments

@PunkHaz4rd
Copy link

After successfully launching python serve.py, giving my robot IP Adresse, the application have errors that shouldn't happen:

GET file:///C:/libs/qimessaging/2/qimessaging.js net::ERR_FILE_NOT_FOUND

So basically, what's the advantage in using the python server and not just using either:

  • http://[pepperIP]/apps/.lastUploadedChoregrapheBehavior/
  • directly the index.html
    ?
@EmileKroeger
Copy link
Contributor

Hi PunkHaz4rd,

I agree this isn't explained well in the doc, sorry about that.

  1. on the FILE NOT FOUND

you should have ?robot=<your robot's IP address> at the end of your URL, so he will know where to fetch the qimessaging.js file (if he doesn't have that, he assumes he's running on the robot and gets it locally, hence your error). Normally with serve.py after giving your robot's IP address you get to a page where that is already filled in.

  1. on the advantage compared to directly opening the file on the robot: well, you this way you don't have to copy your package to the robot each time you want to test it, you can directly edit the live files and just reload the page. But other than that what you describe works fine

  2. on the advantage compared to directly opening the file: most of the time, there isn't any, and you can totally do that! The serve.py thing serves two purposes:

  • making it slightly easier to set the whole thing up ("run that script" is easier than "open with such and such URL")
  • more importantly, sometimes you need an actual server running, for example if you're using Angular JS who needs to do ajax calls to the fetch various files, which won't work if you just open the index.html. serve.py, if you set the USE_SERVER variable in it to True, will run a local server on which all that will work.

Does that help?

Emile

@PunkHaz4rd
Copy link
Author

Ah ok, I though I could simulate my html running on Pepper's tablet and have access to the console.

I did have ?robot=<your robot's IP address> and I tested with something I know works (Text to Speech service) but it doesn't make a sound when using robot-jumpstart, while it did using:

http://[pepperIP]/apps/.lastUploadedChoregrapheBehavior/

Though with the url, everything works, because it is interpreted by my browser, while it doesn't work on Pepper's tablet.

@EmileKroeger
Copy link
Contributor

You can simulate your html running on Pepper's tablet and have access to the console ! (well, as long as you have an actual Pepper; it won't work as-is with a simulated one in Choregraphe - it could be made to do so tho).

If you have the ?robot=, then the text to speech thing should work (the examples I provide by default do when I use them), and if it fails you should have errors in the console.

Which NAOqi version is your Pepper in by the way? (I don't think it should make a difference tho)

@PunkHaz4rd
Copy link
Author

Yes, what you said work, I finally got it to.
I think I missunderstood what it does. To clarify: I had a problem on my web app running on Pepper's tablet that didn't show on my browser, whether I used Robot-Jumpstart, the URL to Pepper's last app, or directly opening the index.html.

The tablet isn't connected to the wifi.
Is there a way to actually run something (not simulate) on Pepper's tablet and have access to a console ?

I think Pepper's NAOqi is up to date.

@EmileKroeger
Copy link
Contributor

"Is there a way to actually run something (not simulate) on Pepper's tablet and have access to a console ?"

Not an easy one. What I did once upon a time was make a simple javascript logger, which would catch errors and log them somewhere visible.

But I haven't used that in ages (since Pepper's first release actually...) because I usually don't need to; the browser preview is good enough 99% of the time (especially when it's in "mobile mode", pretty convenient on Chrome). There are a few CSS things that may not work on the tablet because it runs an older version of chromium, but most stuff should be pretty similar. Though if your tablet doesn't have wifi (even if Pepper does) that could explain some problems.

@EmileKroeger
Copy link
Contributor

(the "some problems" being if you're hotlinking stuff from the tablet then it won't work until you setup the tablet's wifi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants