5

I want to send the image captured (and stored on RPi) by 3 webcams from my RPi to any user anywhere in the world. The user just has to type a web address and access the images. How do I do this? I have a dongle, RPi and 3 webcams. I am able to interface multiple cameras to my Pi. I can't do the second part.

I am trying to build a self-driven car using CNN. So initially for training purpose I need images from the car's:

  1. Front camera
  2. Left camera
  3. Right camera

I have captured the images from all the webcams and concatenated it to make a large image. Now I want to publish this image on the any IoT platform (I don't know which platform to use) to store each image in a hard disk so that it is available to me from any where round the world. I will connect the car to the network using a 4G/3G Dongle.

0

2 Answers 2

4

If you use Node.js server (how to setup in 1) on your Raspberry Pi device, serving the file is basically one-liner 1:

res.sendFile('./myImage.gif');

Complete code needed when node.js is setup:

#!/usr/bin/env nodejs
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'image/gif'});
  res.sendFile('./myImage.gif');
}).listen(8080, 'localhost');
console.log('Server running at http://localhost:8080/');
  1. How To Set Up a Node.js Application for Production on Ubuntu 16.04
  2. Node JS return image in rest api response
3
  • can i do it on my raspberry
    – CR7
    Jun 24, 2017 at 19:09
  • Look: thisdavej.com/… yes, it can be done.
    – mico
    Jun 25, 2017 at 4:05
  • It came to my mind that using sockets you could maintain the connection open for concecutive loads (I suppose your car is moving and taking new photos). Even using mqtt over socket would be ideal. I just did not find an example of file serving + socket + mqtt so I did not edit my answer. I think the current stuff is ok for a starting point and you may update more complex thing later.
    – mico
    Jun 25, 2017 at 18:03
2

If it's a webcam it's HTTP/HTTPS (aka the Web). Webhooks is a term being used more and more for a triggering of an event via HTTP/HTTPS. Webhook. Also search for 'events' in the software/SDK. Webhooks enables a push type model, e.g., camera motion sensor triggers the webhook/sending of info to a particular server in the cloud.

If you simply want live video stream available online, this is typically done by assigning an IP address to each camera endpoint. Then there is usually a specific port that serves the stream. Add a domain name, configure your DNS server, and connect via a web address if you want, or just use the IP address.

As for Raspberry Pi specifically, see Raspberry Pi Documentation.

Not the answer you're looking for? Browse other questions tagged or ask your own question.