Coder Social home page Coder Social logo

Comments (9)

rakuco avatar rakuco commented on June 29, 2024

Are you serving the pages over HTTPS? The sensor APIs are only available over secure connections.

from generic-sensor-demos.

albrasic avatar albrasic commented on June 29, 2024

Yes! The command: polymer serve build/bundled --hostname 0.0.0.0 --protocol https/1.1 serves the application over https. It looks like the Chrome flag #allow-insecure-localhost yields a better view of the pages when it is enabled. Thanks again!

from generic-sensor-demos.

albrasic avatar albrasic commented on June 29, 2024

One more point is that the port to be accessed is 8081 and not 8000, as suggested by the response to the command. And the browser flag about allowing insecure localhost does not really matter.

from generic-sensor-demos.

rakuco avatar rakuco commented on June 29, 2024

Right, do you mean everything's working now or is there anything left to solve?

from generic-sensor-demos.

albrasic avatar albrasic commented on June 29, 2024

Sorry again, it stopped working once more: the web page takes forever (same as before when it was served over http) and is shown right away only when the raspberry is turned off or when the demo is accessed remotely from my PC (which is USB-connected to the Android phone). The log console then complains about "Subject Alternative Name missing" and then reports "ERR_CERT_AUTHORITY_INVALID", while saying that "the connection is secure" and "the resources are served securely". Thanks in advance.

from generic-sensor-demos.

rakuco avatar rakuco commented on June 29, 2024

@kenchris does this ring any bells based on how Polymer serves pages via https?

from generic-sensor-demos.

albrasic avatar albrasic commented on June 29, 2024

I re-installed everything and it works now, although a bit slow. Before closing this thread, can you tell me whether the Security Certificates, key.pem and cert.pem, are generated simply by the command "polymer serve --protocol https/1.1" and whether they are referred to by any of the js files in the sensor-info folder (I'm trying to modify the demo in order to record and display sensor data over time)? Thanks again for your help.

from generic-sensor-demos.

rakuco avatar rakuco commented on June 29, 2024

can you tell me whether the Security Certificates, key.pem and cert.pem, are generated simply by the command "polymer serve --protocol https/1.1"

I don't think they are, as they're supposed to be actual certificates for your web server (I recently had to generate some self-signed ones via openssl to serve those files to another machine for testing too).

and whether they are referred to by any of the js files in the sensor-info folder (I'm trying to modify the demo in order to record and display sensor data over time)?

They are not. The code doesn't assume anything about the environment it runs in as far as I can see (as they're supposed to work without polymer-cli too).

from generic-sensor-demos.

rakuco avatar rakuco commented on June 29, 2024

Sorry it took so long to respond to this one! I guess we can close it now.

from generic-sensor-demos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.