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

Second button example #1

Open
natesrobot opened this issue Mar 29, 2018 · 3 comments
Open

Second button example #1

natesrobot opened this issue Mar 29, 2018 · 3 comments

Comments

@natesrobot
Copy link

First off - this is the best example i could find yet!

Question -
When i try to add a second button with an additional method, I get an error saying:
TypeError: undefined is not a function (evaluating 'client.hi_nate())

I have added the function in the client.js file, but still get this error...
Could you provide an example with 2 buttons to show what code needs to be duplicated for each button? I would appreciate any help.

Thanks,

Nate

@patrickfuller
Copy link
Owner

Did you follow the pattern for toggle_led? And are you using a javascript linter like ESLint to make sure there are no typos in your code?

@natesrobot
Copy link
Author

Thanks! Turns out I was missing the comma after the toggle_led function where I added my second function...
Second issue i'm having is I cannot access the web page from any other device. (I know my network is ok since I'm connected to my raspberry pi through VNC Viewer)
The page that opens automatically from server.py works great, but not when I try through a different browser on the pi, or on another device.

Here's the console log when I run server.py (last two lines are when I try to connect from another device):

pi@raspberrypi:~/pi-websocket $ sudo python3 server.py

(epiphany-browser:10339): GLib-CRITICAL **: Source ID 215 was not found when attempting to remove it

** (epiphany-browser:10744): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

(epiphany-browser:10744): Gtk-WARNING **: Theme parsing error: :8:29: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(epiphany-browser:10744): Gtk-WARNING **: Theme parsing error: :9:37: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(epiphany-browser:10744): Gtk-WARNING **: Theme parsing error: :10:27: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(epiphany-browser:10744): Gtk-WARNING **: Theme parsing error: :11:28: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version

(epiphany-browser:10744): Gtk-WARNING **: Theme parsing error: :12:31: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version
** Message: Remote error from secret service: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files

** (epiphany-browser:10744): WARNING **: Error caching form data: The name org.freedesktop.secrets was not provided by any .service files
** Message: console message: http://localhost:8000/static/client.js @17: Connected!

WARNING:tornado.access:404 GET /index.html (192.168.0.14) 3.57ms
WARNING:tornado.access:404 GET /favicon.ico (192.168.0.14) 1.98ms

@patrickfuller
Copy link
Owner

Network issues are outside of the scope of this code, so I can't help much. My only guess is to make sure you're entering everything in right, ie: http://my.pi.ip.addr:8000/.

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