Web Interface of the Dalek

So… controlling the Dalek over the web.

I decided that the target device was to be a Tesco HUDL2, so the layout was to fit on that size screen without scrolling.

It would need a virtual 9 key pad would enough to give be basic control and some spare buttons, and that I would need a feed from the camera.

So, a little bit of design fettling, image searching and pissing about, I came  up with this control panel (caution: may include Dalek POV of beardy halfwit):

Obviously its not perfect (the wonky looking buttons are a design choice to reflect the general wonkiness of the whole thing though) and spaces have been left for other bits, but it will do for now.

I’ll put up the code behind it once i’m finished and happy with it (which might me another year). Ask me for it and I might send it you though…

Enumerating the Doctors

Since the recent goings on with which Doctor is which, and all the complications, I’ve put together a table to try to explain it. It might be wrong, but it is more for me than for anyone else.

And I think, as I’ve stumbled through this, I’ve finally got a handle on The Valeyard (more later).

 

Incarnation
Regeneration
Looks like
Doctor #
Known as
Played by
Notes
1 n/a willhart 1 The First Doctor William Hartnell
also Richard Hurndall and later David Bradley
n/a n/a cushing n/a Doctor Who Peter Cushing A human who created a time travel device called TARDIS. Non-canon, so I don’t even know why he’s listed here.
2 1 pattrou 2 The Second Doctor Patrick Troughton
3 2 jonpert 3 The Third Doctor Jon Pertwee
4 3 tombak 4 The Fourth Doctor Tom Baker
(A wax dummy)
5 4 petdav 5 The Fifth Doctor Peter Davison
6 5 colbak 6 The Sixth Doctor Colin Baker,Sylvester McCoy
7 6 sylmc 7 The Seventh Doctor Sylveter McCoy
8 7 paulmc 8 The Eighth Doctor Paul McGann
Now it goes a bit runny
Firstly we have the “Shalka” timeline…
9 8 shalka 9 (alt) “The Shalka Doctor” Richard E. Grant (Animated version)
Then the “Final Death” timeline
9 8 rowan 9 (alt) “The Nineth Doctor” Rowan Atkinson
10 9 withnail 10 (alt) “The Tenth Doctor” Richard E. Grant “The Conceited Doctor”
11 10 broadbent 11 (alt) “The Eleventh Doctor” Jim Broadbent “The Shy Doctor”
12 11 hgrant 12 (alt) “The Twelfth Doctor” Hugh Grant “The Quite Handsome Doctor”
13 12 lumley 13 (alt) “The Thirteenth Doctor” Joanna Lumley “The Female Doctor”
Meanwhile, back on the “real” timeline…
Incarnation
Regeneration
Looks like
Doctor #
Known as
Played by
Notes
9 8 johnhurt n/a The War Doctor John Hurt (Not actually The Doctor)
10 9 chrisecc 9 The Ninth Doctor Christopher Eccleston
11 10 davten 10 The Tenth Doctor David Tennant
11 11 davten 10 The Tenth Doctor David Tennant Vanity Regeneration
n/a n/a davten2 n/a Handy/John Smith David Tennant Human Meta-Crisis Doctor
12 12 matsmi 11 The Eleventh Doctor Matt Smith
Start of a new Regeneration cycle
13 13 petcap 12 The Twelveth Doctor Peter Capaldi
14 14 jodwhi 13 The Thirteenth Doctor Jodie Whittaker
Unknown “Doctors”
n/a n/a watcher n/a The Watcher Adrian Gibbs
n/a n/a curator n/a The Curator Tom Baker
n/a n/a micjay n/a The Valeyard Michael Jaystone an amalgamation of the Doctor’s darker sides from between his twelfth and final incarnations

Now, after all that number counting and trying to work out which numbers apply to which Doctors, if you go by my reckoning then the Eleventh Doctor (Matt Smith) was still only the 12th incarnation, even though he was also the 12 regeneration. To quote The Master from “The Trial of a Time Lord: The Ultimate Foe“:

“There is some evil in all of us, Doctor – even you. The Valeyard is an amalgamation of the darker sides of your nature, somewhere between your twelfth and final incarnation, and I may say you do not improve with age.”

As the “final incarnation” is far off in The Doctor’s personal timeline, the Valeyard problem has been untangled for now, but could surface in the future as a plot point.

 

 

 

How To Order A Taxi

Preparation

Before making the call, you need to prepare yourself for the questions you are going to be asked. It is vitally important that you know the following pieces of information:

  • Where are you? – Either the address or name of where you are.
  • Where are you going? – If you don’t know, we can’t take you there.
  • How many people? – This is really important, as you can’t fit 17 people into a Ford focus.
  • What is your name? – If you have to ask someone, it is probably time to go home.
Making the call

Once you have all the information required, there is one last thing to check before you make the call. Can you be heard?

It is all well and good knowing that 7 people want to go from the Brown Trumpet to the Pink Oboe in the name of Lucas, but if you can’t convey this information over the phone then you are screwed.

Good places to call from are:

Pub toilets or porches, beer gardens, anywhere that you can hold a conversation without shouting.

Bad places are:

At the bar on a busy night, 27cm from the main speaker stack at Knebworth when Motorhead are on, Cannock, a train, within earshot of your pissed mate murdering some piss-awful song on karaoke, next to a 747 spooling up for take off, a building site.

 Attitude

Don’t be surly. Really, we’re just trying to do a job. We’re trying to get as many people moved, and thus take as much money as possible. Getting arsey with us really won’t help.

[First published September 2014, © Tony Blews 2014]

Camera of the Dalek

I wanted to stream video from the Dalek camera to whatever browser was looking at it.  I asked t’Internet and it provided the answer.  Mr Miguel Grinberg has provided a nice tutorial on the matter, which I’ll now rip the bits I need from.

Install what you need and link header file.

$ apt-get install libjpeg8-dev imagemagick libv4l-dev
$ ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h

As an ex-Unix admin  who spent 10 years with a root prompt without anything going wrong, I fail to see the point of “sudo”. Just go to root and save the typing. You can be just as destructive either way.

Anyway, rant over.

Download, build and install  MJPG-Streamer

$ wget http://sourceforge.net/code-snapshots/svn/m/mj/mjpg-streamer/code/mjpg-streamer-code-182.zip
$ cd mjpg-streamer-code-182/mjpg-streamer
$ make mjpg_streamer input_file.so output_http.so $ sudo cp mjpg_streamer /usr/local/bin
$ sudo cp output_http.so input_file.so /usr/local/lib/
$ sudo cp -R www /usr/local/www

Thats it all done. To start it up, run the code snippet from rc.local below.

And to get the streaming running from boot time, you’ll need this is /etc/rc.local before the exit 0:

# start camera module for web server
mkdir /tmp/stream
/usr/bin/raspistill --nopreview -w 320 -h 240 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 9999999 -th 0:0:0 &
LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -w /usr/local/www" &

So far so good.  You can view the video streaming from your camera by pointing your browser thusly:

http://servername:8080/stream_simple.html

You will have to put the ip address of your pi in there if you haven’t fettled your DNS/hosts file to refer to it.

Next comes some hardware work on the case to get all the bits bolted/glued into place.

 

Google Earth Canal Maps

A very long time ago, while off work sick, I plotted every canal in the UK, including the extinct ones that had been drained and built over.

Because I foolishly made no effort to protect the data it has be stolen and re-used many times, including spelling errors.  So I got annoyed and deleted it.

But recently I decided to put my data online, with the old intentional errors removed. Click below…

 

Ports of The Dalek

I’ve decided on what interfaces the Pi-Dalek will mounted on the rear of the case.

  • USB-B socket to accept power for charging the internal battery (a mobile phone emergency charger. Internally the socket offers a USB-A socket which is connected to the Pi with a short USB-A-to-microUSB-B cable, then the emergency charger, then another short USB-A-to-microUSB-B cable.
  • USB-A socket for memory sticks etc. Connected to the UTG socket with a short UTG cable.
  • HDMI socket. Connected to the miniHDMI socket on the Pi with a short adapter cable.

These will be mounted on the arse-end of the Dalek.  Two on the 3rd row up of the Dalek-bumps on the rear panel (both USB ports), with the HDMI socket on one of the rear flank quarters (3rd row up).

Ideally I’d like them all on the back, but the bumps on row 1 are blocked by the motor housing, while rows 2 and 4 have far too many structual bits behind it.

This still leaves me with the issue of mounting the camera. While I’d love to have the camera mounted to the eyestalk, this is impractical.  Mainly as the eyestalk is missing, but also because the camera module is a huge square blob that wouldn’t look right.

The best I can hope is to mount the camera on the Glacis, between the Whisk and Plunger, just above the top of the skirt. It will still mean that some cutting will have to be done, but it will probably not look as awful.

I’ve also decided that instead of mounting the Pi and Motozero directly to the base chassis, I’ll mount them upside down hanging from the internal ceiling at the top of the skirt. This shortens the distance to where I want the camera to be, and means only 6 wires need to be run down to the base (motor power +/-, motor left +/- and motor right +/-). Everything else will be skirt mounted. So the 40pin GPIO header connection twixt Pi and Motozero forms the split in the arrangement.

A sort of split between the head and body, if you want to make up some sort of analogy up.

I’m sure there’ll be some photos of it when its done.

 

Installing Raspbian on a Pi-zero W

There is so simple way to do this. I’ve tried several times and failed each time. So here is my idea to make things easy.

    1. Download your prefered Raspbian Jessie version from https://www.raspberrypi.org/downloads/raspbian/ be it Lite or with Pixel.
    2. Get and install Etcher, and use that to burn your image to the microSD card.
    3. Remount the SD card and create a file on it called “ssh”.  Create another file called “wpa_supplicant.conf” with contains:
      update_config=1
      ctrl_interface=/var/run/wpa_supplicant
      
      network={
               scan_ssid=1
               ssid="yournetworkname"
               psk="yourpassword"
      }
      
    4. This should enable you to boot the Zero-W. It should then get an an address for your LAN via DHCP. All you have to do is check you router, or use Fing (or something like it ) to find it.

IT DOESN’T WORK!

Ah. Do you have another Pi with a wired connection somewhere about the place? Good.

Pop your microSD card from your new Pi-zero into an adapter and boot your other Pi (in my case one of my KODI boxes) and boot it.

Find the machine on your network and login (“pi” and “root” have the password “raspberry”).

As root, run

apt-get update
apt-get upgrade

And, while you have a wired connection, install Apache2 and PHP5.

apt-get install apache2
apt-get install php5

Set your new hostname in /etc/hostname now, so you’ll ne able to identify it later.

After thats done, shut it down, pop the card into the Pi-Zero W, and it should come up and appear on your network.

From Fing or your hub you should be able to get the MAC address and add the to your DHCP.

And it should all work.

Additional note concerning #3 above. If you are planning to use it on more that one WiFi network (example: I use my home network, and also the hotspot on my phone if I’m working on it anywhere but at home), your wpa_supplicant.conf file can contain multiple network entries.  Thusly:

update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
         scan_ssid=1
         ssid="yournetworkname"
         psk="yourpassword"
}
network={
         scan_ssid=1
         ssid="yourhotspotnetworkname"
         psk="yourhotspotpassword"
}

Put the entries in order of preference.

Resurrection of the Dalek

At last I can paraphrase a Doctor Who serial title again.

This time I’m going to be using a Raspberry Pi-Zero W with MotoZero control board. Gone are the attempts at bashing by own circuitry (which are already in the Model Railway control system anyway), and this time IT WILL WORK!

So, the ingredients for *this* incarnation of the Dalek are:

For now I’ll forego the distance sensors, as I’ve already bashed them into a sort of thermin idea.

Anyway, the key stages for this project are:

To make things easier to track, the new Category Pi-Dalek has been created.

 

moan, moan, flippin' moan