RPi Apache server & Node.js

About Forums Forum RPi Apache server & Node.js

This topic contains 4 replies, has 1 voice, and was last updated by  michiels.thomas 5 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #973

    michiels.thomas
    Participant

    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

    #974

    michiels.thomas
    Participant

    Hi,

    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

    #975

    michiels.thomas
    Participant

    I 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…

    #976

    michiels.thomas
    Participant

    Funny 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…

    #977

    michiels.thomas
    Participant

    I’ve found a tutorial to implement the camera feed via node.js, which also solves my problem…

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Forum’ is closed to new topics and replies.