3d Printing

Capturing time-lapse from mjpeg streamer or any jpg using aws lambda

Posted on Updated on

We have a raspberry pi running jpeg streamer through octoprint for checking the status of a remote 3d printer, it is also a pretty unusual print and unusually large so I thought we should capture the process for posterity.

I really did not want to spin up a server to capture the 96 hour print (1 image every 60 seconds/1 minute) so I thought why not write a was lambda function (server less!), it will be much cheaper and easier – no command line crons and server to set up and ssh into etc.

Here is how I done it:

Firstly rather than the stream action, we need to use the snapshot function (action=snapshot).

Next we create an S3 bucket to save our images I called mine “timelapse-camera-1”.

Screen Shot 2018-05-24 at 22.22.21

Following that we move onto was lambda and set up our role and function. I went into the membership menu, roles and manually attached this policy.

Screen Shot 2018-05-24 at 22.22.58

I then wrote the following code in lambda, saved and tested.

BUCKET_NAME = "timelapse-camera-1"
from __future__ import print_function

import boto3
import time
import urllib

BUCKET_NAME = "timelapse-camera-1"
TMP_FILE = "/tmp/tmp.jpg"

def lambda_handler(event, context):
camera_file = urllib.URLopener()
camera_file.retrieve("http://000.000.000/webcam/?action=snapshot", TMP_FILE)

timestr = time.strftime("%Y%m%d-%H%M%S")

s3 = boto3.resource('s3')
s3.meta.client.upload_file(TMP_FILE, BUCKET_NAME, timestr + '.jpg')

return 'saved ' + timestr + '.jpg'

except Exception as e:
raise e

Next we need to run our function every minute by calling lambda from was cloud watch.

There we go, easy 🙂 just remember to turn it off when your done.


In China etching and 3d printing St Pancras

Posted on Updated on

I’m in China (more on that in another post) whilst I have been here I really wanted to find a photo etcher and visit some 3d printing factories.

Well I did just that and here are some samples from St Pancras Roof which are 10 thou brass with some nice detail and some sample 3d prints of St Pancras windows, I’m really happy with the result.

A go at casting

Posted on Updated on

I recently wanted to get a feel for how difficult casting may be. A bit of trial and error going on here which seems a subject with actually very little detailed information on google – lots of high level but I failed to get any decent examples.

So jumping in I used some rubber tool silicone to make a negative cast which I then made a wax mould from which in theory I could then cast with investment powder. Lot more experimenting and a good book needed to proceed I think. But not a terrible outcome from an afternoon just jumping in and experimenting.

The idea being that with a good wax cast (and I think I had the wrong wax) I could make a number of patterns that I could cast in brass using some equipment available to me.

More 3D fine scale

Posted on Updated on

A second round of 3d printing fine resolution. These prints explore how low you can go looking at rivet detail and resolution from 0.1mm to 0.33. You can see the orange print is my first reasonable output from my own low resolution resin printer. The detail becomes much clearer and amazing when primed in red. Finally mastering my metalwork skills by making something a little bit heavier out of metal and you can see the 3d printed wheel encapsulated in the rim. Certainly a lot of theory and technique on show here!



First go at resin printing 

Posted on Updated on

I recently took delivery of an iBox Nano 3d printer which was a kickstarter campaign I backed. It seems robust enough but has some very extreme limitations and is quite buggy. I tried to print a solid model of a locomotive I am working on in 2mm scale and it seems to have really miss interpreted some of the polygons! As you can see the rear of the model at the tops seems to have been conjoined at the top of the model – not really quite sure what happened there!

Its also very hard to model for this printer as it uses an LCD screen to block UV light on the resin, this obviously makes everything orientated around square pixels, this makes the low resolution claimed very difficult to achieve because your either on a line of pixels or your not.

I also managed to knock the desk and spilt some resin as so that it overflowed into the components so looks like this is the end of experimenting for now. There does seem however something quite satisfying about resin printing – so maybe its time for an upgrade to a better machine???

Print your own St Pancras Station!

Posted on Updated on

After some though and many years of putting this project together I have decided to share it with the community, maybe people will contribute to finishing version 2 or even have a go making their own models. It’s certainly quite satisfying to hare your work with others. If you build one let me know!

Download links



Sandown Model Engineer Exhibition

Posted on Updated on

I was incredibly proud to display the St Pancras model against so many other prestigious and skilled individuals and really do feel as I had achieved what is a multi year goal today- huge smiles all round – and Many thanks to Allen who helped me pull an all nighter to get the job done!