Take a Picture on the Raspberry Pi
Following the instructions from https://www.raspberrypi.org/learning/getting-started-with-picamera/worksheet/
setup the camera to take a picture.
The only modification to that is to add the #!/usr/bin/python3 and make it executable.
Have it store the image to a known location.
It is a good idea to set the sleep time to 1 second
from picamera import PiCamera
from time import sleep
camera = PiCamera()
Create a Node Red Flow on the Raspberry Pi
Create an HTTP node input where you create http request input on the rasperry pi.
Create an Execute Node configured to run the script you wrote in step 1.
Create a File node where you get the file.
Create a HTTP response node where you send the file back after the http request.
Conenct the 5 nodes together like this:
Create a UI template node on your BlueMix NodeRed Flow
If you need instructions for using the UI nodes go http://flows.nodered.org/node/node-red-contrib-ui
Create a node red flow that connects a repeating inject timestamp into a function that creates the web path to the camera picture page made available in step 2, with the time stamp appended at the end. IE
var address = global.get("PiNodeRedAddress");
Then create a template node and update the code to the following. Be sure to specify the IP address of the raspberry pi.
View your UI web page and see your image
Navigate to your Raspberry Pi web address /ui and see your image being updated.