RPi Apache server & Node.js
- This topic has 4 replies, 1 voice, and was last updated 9 years ago by michiels.thomas.
-
AuthorPosts
-
March 24, 2014 at 12:54 PM #973michiels.thomasParticipant
Hi there,
Great piece of coding!
I have a quick question regarding a project I’m working on.
I’m designing a toy based on moving images. It captures the surroundings via a camera and displays the feed to a projector.
For my prototype I configured a raspberry pi type B with a camera module to display a stream of MJPEGs to a local website on the RPi via an Apache server (http://elinux.org/RPi-Cam-Web-Interface). The idea is to interface the website via physical buttons connected to an arduino.
I succesfully installed the node server of Breakout on the RPi and can succesfully run the hello_world example and interface with the arduino.
I’m now trying to embed the hello_world code in the webcam website, which is run on locally on the RPi on a fix ip (192.168.0.178).
I configured the Apache server per this post to connect to the node.js on localhost:8887 (http://thatextramile.be/blog/2012/01/hosting-a-node-js-site-through-apache).
I copied the libs and dist folder to the location of the index.html file of the webcam interface (/var/www/). I updated the script source code in the html file
> socket.io.js refers to the original Breakout folder where the node server files are located
> dist & libs refer to /var/www/I updated the server.js file to accept multiple connections and the path of the application refers also to /var/www/.
However, so far no luck. Do you have a moment to look into it?
Kind regards
Thomas
March 25, 2014 at 4:07 AM #974michiels.thomasParticipantHi,
Just got it to work, but only if I explicitly direct tot 192.168.0.178:8887/examples/getting_started/hello_world.html.
I copied the complete examples folder to /var/www/ just to be sure.
Oddly, the index.html file in /var/www/ which is a copy of hello_world.html, won’t result in a connection to the node server. Not on 192.168.0.178 nor on 192.168.0.178:8887/.
Any thoughts?
Thanks
March 25, 2014 at 8:13 AM #975michiels.thomasParticipantI got the example working on 192.168.0.178:8887/ by updating the .html file on line 86 by replacing host by “localhost”.
Would it be possible to get it also working on 192.168.0.178/ without explicitly stating the port number?
My guess is the config file of the apache server should handle this…
March 25, 2014 at 10:51 AM #976michiels.thomasParticipantFunny thing, I’m also not able to run the hello world example from the breakoutjs.com site with the node server on the raspberry pi…
March 25, 2014 at 6:15 PM #977michiels.thomasParticipantI’ve found a tutorial to implement the camera feed via node.js, which also solves my problem…
-
AuthorPosts
- The forum ‘Forum’ is closed to new topics and replies.
