I’ve been attempting to get some of the simple webserver examples working and it looks like bonescript has gone through some changes over time so most don’t actually work. I grabbed an interactive LED example from this site and I’ve gotten it to at least not crash and it does have interactive buttons but I can’t figure out how to actually call the functions that do the LED work.
The original code
Here is a tutorial and sample code for a web server, using Node.js, BoneScript and Socket.IO: https://github.com/lgxlogic/BoneScript-SocketIO
This should help you get started.
The instructions for pulling from git don’t work. The path is all lower case in the instructions while the real path is mixed. Also it has .git at the end which git didn’t like.
All I get is “Error loading index.html”
I changed that to HtmlLedDemo.html to make sure it was the .js sending the message - so it is running the program properly like Cloud9 reports. Probably its an ownership issue? trying to figure out how to extract the actual error from the err variable.
I should also mention - the error shows on firefox from the windows machine connected through ethernet or usb. Locally it works fine in both epiphany and chromium.
Again, it sounds like some sort of permissions thing - remote not allowed to load while local root can.
I figured it out (how to extract actuall error and the cant show file error).
When run locally the path to HtmlLedDemo.html is relative to the js but when called remotely the path is something else. I hard coded the path to the html and it works fine.
guess I have to figure out where node.js looks for web pages.
Thanks for the feedback. The git URL in the description is now fixed.
I am trying to get the simple web server example you gave a link to to work on my BBB. I get 3 errors
Uncaught ReferenceError: io is not defined
Failed to load resource: the server responded with a status of 404 (Not Found)
GET http://code.jquery.com/jquery.min.map 404 (Not Found)
and when I move the slide or click a button I get this error
Uncaught TypeError: Cannot read property ‘emit’ of undefined
I have tried at least 2 other examples I found online or in the book Proramming with the Beaglebone Black by Simon Monk all with about the same results. I went through the line my line step by step setup you and others gave a few times and did not get an error during the install/setup and that still did not change anything. Any suggestions?