ReMorten v0.1 – Part 1 – Remote camera

The ReMorten Project: A telepresence robot platform using nodejs running on the Raspberry Pi. Because why not.

Part 1: Snapping pictures using the Raspberry Pi, and exposing them outside your local network. A minimalist Peeping Tom system. It will also let me spy on my cat.

(Prerequsites: You’ve already got the Pi and the pi camera module up and running with Nodejs and npm installed. I use VNC viewer to connect to the Pi). You can purchase the camera module via eBay. This is the cheapest rpi2 I could find on eBay today

Make and enter a dir for your project and install node-raspistill:

npm install node-raspistill

make a file called interval.js and add this (taken straight from the node-raspistill example folder on Github):

const Raspistill = require('node-raspistill').Raspistill;
const raspistill = new Raspistill();
setInterval(function() {
        .then((photo) => {
            console.log('took photo', photo);
        .catch((error) => {
            console.error('something bad happened', error);
}, 15000);

Run it by typing

node interval.js

Node-raspistill will create a subdirectory called photos, and start taking and adding pictures. Visit that dir to confirm that the pictures are showing up.

The easist way to serve the content of that directory as a webpage using http-server

sudo npm install -g http-server

Enter the photos directory and type:


You should see something like

Starting up http-server, serving ./
Available on:

Now to the fun part.
To see the content of that folder from a machine outside your firewall/local network:

Go to and download the Linux Arm version of ngrok. Unpack the zip and type this in the terminal:

./ngrok http 8080

In the output from ngrok, find the Forwarding line, it looks something like this:


where the 1234567 part will be unique every time you run ngrok (unless you make an account and pay them to get a permanent subdomain, which you should).

Visit that url on a remote machine outside your network to verify that it works. Refresh the page to see a list of newly added files.


This is of course an insecure method that would leave your Pi and your network vulnerable, but it works well enough for testing purposes. Also: Leaving interval.js running willfill up your Pi until it dies, I suppose.

Storing the images on Google Photo or another service with unlimited storage, and delete older images from the Pi to prevent it running full.
Streaming video in realtime

Av Morten Skogly

Creator of Things

Legg igjen en kommentar

Din e-postadresse vil ikke bli publisert.