All posts by Tony Blews

Model Railway Arduino Point Control – Design

As stated elsewhere, I’ve mothballed the Arduino Dalek Project, and started to cannibalize bits for a new project: Arduino control of the turnout points on an N Gauge model railway layout.

For a start, heres some information about the point motors I’m using: The PECO PL-11 side mounted motors, which attach to the side of the points, like this:

PECO PL-11 (© PECO Publications)
PECO PL-11 (© PECO Publications)

These motors operate on 16v AC and require only (and indeed cannot tolerate more than) momentary current, and are currently controlled from “passing contact switches” drawing power from a Capacitor Discharge Unit.

There are currently 6 turnouts/points, arranged in pairs as below. As it would be reckless (and in real life impossible, due to interlocking) to operate either of the pair independently, I’ve decided to activate them together.

points1Thus, at all times both A and B will either both lead straight ahead, of both lead off to the left (for sets C&D and E&F it will be right not left).

As the Arduino can only throw out 5v DC, each pair of motors will need to be driven via a 5v DPDT replay. But, as we can’t leave the current on without melting the motors, each pair will actually need two relays (one for each direction of change), driven independently from different output pins. Another complication is that the relays will have to energised and then de-energised within a specific time-frame to avoid motor damage, but this is a programming issue to be dealt with later.

PL-11-CDU-Relay WiringThe above diagram shows only the 16vAC side of the wiring. The Arduino 5vDC is shown below.

Arduino-Relay Wiring

Obviously I could have chosen to just use SPDT relays, and connect the outputs together, but due to the vagaries of how the motors work and the orientation and placement of them on the layout, I thought it was safer to design and wire it this way at the outset, rather than back-fix it later when it went wrong. Plus, I had all the wiring in place, so thought I might as well use it.

Note the lack of common Ground between the two halves of the circuit. Grounding AC and DC together isn’t a good idea. Just say no.

Anyway, here is all is again on one convenient image.

Arduino-Relay-PL-11 Wiring
Click to embiggen

So now the next stage to to take that abstract squiggle and build it as a circuit.

Note – for myself, mainly: Each “pair” takes up 2 outputs, so for the three pairs of points we need 6 lines from the Arduino, out of a total of 12 (not 14, as I’d rather not use the 0 and 1 lines (RX & TX) as this could cause issues with data transfers activating the relays – something that the Dalek had problems with at first.

To be continued… with a start on Signalling!

Death to the Arduino Dalek

Here I go again, repurposing shit. In this case it is both a Doctor Who episode title and some  electronic bits.

The Arduino Dalek/Raspberry Dalek project has been on hold for some time (obviously), due to me not being arsed to sort out a niggling wiring problem that only allowed one of the motors to run in one direction.  That and the camera melting itself into slag. That didn’t help.

Anyway, today it suffered a major setback when the Arduino and relays got removed for use in another project.

But Daleks never say die, so it might come back later.

The gubbins are being reassigned to Project Railway, and will act as the point motor control system, once I’ve worked the circuit design out.

Adventures in N Gauge

It seems a long time ago that I started working on an OO Gauge model railway. Well, true to form I abandoned that idea and moved on. Because of space problems, I switched to N Gauge, which takes up half the space.

I came up with the idea of “Garwick”, a station on a mainly industrial line which still handles passenger traffic. The layout is based mainly on the long-closed Maudlands station in Preston, but with several additions which “just seemed like good ideas at the time”.

The Original Plan - it does not look like this anymore.
The Original Plan – it does not look like this anymore.

The time period is somewhat confused, being set in a fictional era where British Rail never ended, and bus deregulation never happened. Hence old-style DMUs and Ribble buses sit alongside late model Transit vans, Austin taxis, modern cars and a BR Blue liveried Class 66.

Version 2 of the layout. Still not finished
Version 2 of the layout. Still not finished

Garwick is actually two stations. Firstly there is the main station which handles commuter traffic and has a taxi rank and bus stop.

Garwick Bus Stop. A Ribble/Notional Express waits.
Garwick Bus Stop. A Ribble/Notional Express waits.
Garwick Taxi Rank. Some Austin FX/4s wait patiently.
Garwick Taxi Rank. Some Austin FX/4s wait patiently.

This station was originally a two platform station, but one of the platforms was demolished to provide extra siding space for Shocks Mill.  The underpass entrance on the platform now leads to a corridor and storage facilities.

The station sees frequent DMU trains which run to Pill End.

Since the closure of the second platform, the other through line  has been mainly used for freight traffic to the nearby coal depot and bitumen processing plant.

There is also the secondary platform which is generally only used by the single car Class 121 service to the main town station . This was built on part of the former marshalling yard of  Shocks Mill, which still stands above the site but has been converted in to a housing, and the former site of the original No 2 platform.

Unfinished version of Shocks Mill, overlooking some old coal wagons from another layout.
Unfinished version of Shocks Mill, overlooking some old coal wagons from another layout.
Unfinished Garwick Platform 2, with industrial estate behind, and a Class 101 former Express Parcels unit waiting.
Unfinished Garwick Platform 2, with industrial estate behind, and a Class 101 former Express Parcels unit waiting.

To the west, after Farish Lane bridge, the lines split. A single track line runs on to Pill End, and a line runs to the industrial sites at Chain Lane and Caul Road.

66626 hauls Bitumen tanks under Farish Lane bridge as a Ribble Atlantean heads towards Oxford Lane.
66626 hauls Bitumen tanks under Farish Lane bridge as a Ribble Atlantean heads towards Oxford Lane.

To the East, one line runs through the short Victoria tunnel to the City Centre, passing the DMU maintenance depot, while the the main line runs though the double track Albert tunnel to the south to join the main line. Locally, the Albert and Victoria tunnels have been nicknamed “George and Mildred”.

Metcalfe Row and the "Ferret and Dartboard" on the corner of Hatton Street above the tunnels.
Metcalfe Row and the “Ferret and Dartboard” on the corner of Hatton Street above the tunnels.

Obviously there is still a lot for work to do. The who track formation needs re-ballasting, the buildings need tidying up, and a lot of dead space needs to be filled. And that’s even before I start trying to hide the various point motors that are highly visible.

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.

 

To Every Electronics Company In China

Dear Every Electronics Company In China,

I understand that you have trouble finding people to translate instruction manuals for your products into readable English.

I am willing to undertake this task. Whilst I do not speak nor read Chinese, I am willing to lake your partially translated manuals, which make little sense, and translate them in to correct English.

I work very cheaply, requiring only £12 per hour for my work. I realise that this is about 24 times what you normally pay, but if you want your manuals to be readable, it is a small price to pay.

Also, I will require one example of every product for which you require a manual.

Hope to hear from you soon,

 

Tony Blews

xxx

 

Facebook App Privacy Concerns Are Bullshit

There seems to be a lot of kerfuffle and whatnot about the privacy concerns of the Facebook Messenger App on Android phones going on at the moment. Mainly it seems to be fuelled by this piece of shitehawk “journalism” by the Huffington Post: http://www.huffingtonpost.com/sam-fiorella/the-insidiousness-of-face_b_4365645.html

Please bear in mind that The Huffington Post is owned by AOL, who have a long-standing mardy about Facebook.

So, what are the concerns? Well allegedly Facebook can spy on you constantly, use your phone to send text messages and make calls, yada yada yada be evil. Here is a screencap of the entire list (from that site – taken 13/01/2015)

hufpoand

Notice how it is in text format, and not a screencap. Now, there is a screencap of the current permissions (actually its two screencaps stitched together…

full perm list

Should you be scared that it can access your microphone and camera?

Firstly, due to the way Android handles permissions, you have to allow access to things all the time for an App to work. iOS does it differently, only requesting access as and when it is needed.  So on an Android device you have to agree in advance to let it use your camera, but on an iPhone you can opt to use the App but not let it access the camera. I know which model is better, but I am never, ever, EVER going to make any public statement that I agree with anything that Apple have done. Blame Bono for that.

Secondly, do you really know what all those permissions mean? No? Well I’m going to tell you. With pictures. Try not to fall asleep at the back!

Starting at the top…

huff1

  • “directly call phone numbers” – well you know that bit in the App where you can telephone people? Have a guess why it needs to do this.
  • “read phone status and identity” – well the two come bundled together. It has to know about your phone and whether ot not you are on a call or not just so that it doesn’t fire up and bombard you with voice calls from Dickhead Dave while you are trying to order a pizza.

huff2

I’ll lump all the above into one. The app (yeah bollocks to capitalisation now) allows you to send and revieve SMS/MMS messages. So it needs to be allowed to do just that.

huff3

You know how you want to do that chatty with live video and sound? Just try to work out why the app needs to use your camera and microphone.

huff4

Just like Facebook posts, messages say where you are. If you don’t like it, turn Locations off in your device settings.

huff5

You want to contact people don’t you? No? Oh just delete the app, get rid of Facebook entirely, and go and live in a cave. You could always use Google+.

Hang on, why does it read the call log? Maybe, just maybe, its so that when you start a new conversation it will prioritise those contact’s names in the list as you ham-fistly bash at the screen with your knuckle trying to spell N I C K.

huff6Really, have a guess on this one. Did you go with “so it knows who I am”? Yes? Well you’re not having a prize.

huff7

Want to save that pic of a dog in Darth Vader costume that Alan The Muppet just sent you? Well you’ll need this.

The same goes for if you want to send your home-made pornographic version of “The Wrong Trousers” to someone.

huff8

Do you want to connect Facebook to your Twitter, Instagram, Swarm, etc accounts?

huff9Right… so here we go…

  • “change network connectivity” – this basically allows the app to determine if you actually have a valid connection or not. Its a badly worded phrase in the Android permissions list really. Panic Not.
  • “download files without notifications” – Do you really want to have to agree to see every picture that you are sent?
  • “full network access” – It is a communications app. It will need it.
  • “receive data from internet” – How do you think message are received.
  • “view network connections/ view Wi-Fi connections” – bundled in with the above “change network connectivity”

huff10

Can we guess this one?

huff11

This is just so that Chatheads can piss you off by floating on your screen in the most inconvenient place possible.

huff12

  • “control vibration” – buzz your phone if it is on silent
  • “prevent tablet from sleeping” – keep the screen turned on if the app is active
  • “change your audio settings” – actually is should be called “check your audio settings”. It is used to determine whether your device buzzes or bings.

huff13

Well it does need to know if the contacts list is synced and up to date or not.

huff14

“install shortcuts” allows the app to put those really annoying “Chatheads” on your home screen,

and finally…

“send sticky broadcast” – this is where it all gets a bit complicated.

A “sticky broadcast” is a parcel of information concerning your identity, location. recent activity, blood pressure, IQ, heart rate, and whether or not you smell of almonds. It is broadcast to the CIA, MI5, Mossad, WASP, Interpol and the ISPF.

Or, it could just be a method of inter-process communtication.

So thats that. Nothing sinster going on at all. Whats more sinister is that Google track your every move and action, that you’ve agreed to this, and furthermore seem quite happy about it.

 

A Few Days With a HUDL 2

Yeah yeah I know I’ve said many times that I’m not a big fan of tablets, seeing them as big phones that you can’t make calls from, dismissing them as useless for not having keyboards, and calling them nothing more than toys.

Fair enough, I can be wrong. It does happen.

So the missus bought me a HUDL 2 for Christmas. Ok, it isn’t the ex-MOD Defender 110  I wanted, but that would have been too much to expect.

Here is a screen-grab of the home screen:

2014-12-26 13.58.30Well I’ve never seen a bunch of VW owners looking so happy. Surely they should all be frantically trying to find where the smoke is coming from, and looking worriedly at the huge puddle of oil forming? And there seems to be an AA low-loader missing from the photo.

Oh, and surfing in a meadow really isn’t going to work (unless it is on the tide of oil leaking out of the knackered van).

Anyway…

So what is a HUDL 2 then?

Well, it is a £129.99 tablet sold exclusively by Tesco. From the info on the box, the important bits are:

  • 8.3″ FHD 1920×1200 IPS LCD anti-smudge screen
  • Intel Atom quad-core processor up to 1.83 GHz
  • Android 4.4.2 Kitkat
  • 16 GB Storage (expandable  by another 32GB)
  • Dual Band Wifi
  • 2GB RAM
  • 1.2MP Front Camera
  • 5MP Rear Camera
  • Bluetooth 4.0
  • Micro-HDMI and Micro-USB ports
  • Weighs 410g

410g might seem a lot, but it is probably how much sugar I consume in a day.

And what is it good for?

Well, I still think it is a bit of a toy, but as Jack Nicholson said, some toys can be “wonderful”. The HUDL is better for watching iPlayer on that an iPhone4 for a start. I can load it up with stuff to watch at work and not have to squint at a tiny screen.

The battery life is fantastic. I got five hours watching stored iPlayer content no problem.

The cameras are ok, but I prefer the ones on the iPhone4, mainly for the ease of physical handling, but also because the HUDL lacks a flash (aha, he saved everyone of us). The automatic Panorama and PhotoSphere functions are cool though.

Bob a Telnet and VNC client on it, fettle your router right and cross your fingers and your can play about on your home machines when you’re on the bus (how come Arriva can provide free WiFi for a ten minute trip into town, yet Virgin can’t for a two hour trip to Preston?).

Blinkbox Books will give you a tenner free credit, which is enough to buy those two Pratchet books that you missed (Unseen Academicals and Making Money in my case).

And what is it bad for?

Well the wifi on it won’t connect to the access point I having running on my Raspberry Pi. Not surprising really, as Android devices in general don’t work with it (and I have no idea why).

It is a little bit big. Far too big to fit in a pocket. Coat makers need to address this. Bring back “poacher’s pockets”!

I find the form factor of the device a little odd. It seems good when used in landscape mode, but it seems a bit too tall when used portrait mode, and a little top heavy too. Maybe it it was about half an inch shorter it would feel better. And its not often that you hear that.

And I still hate touch-screen keyboards.

Would I have bought one myself?

Eventually, yes. It would be as inevitable as death and taxis not turning up on time.

In general I get hold of tech devices for a reason, but in this case I received one before I knew I needed it. So it has caused me to re-start my learning of app writing for Android devices. This may be considered a good or bad thing. Only time will tell.

Could you stock a pub using only Rock drinks?

So, thats the burning question. Can you fully stock a pub using only drinks officially associated with rock bands? Well, let us have a look.

For your regular beers, you can have Iron Maiden Trooper Beer, Status Quo Piledriver, AC/DC Australian Hardrock Lager, Motorhead Bastards Lager, and Elbow Charge. And pretty soon Thunder will be releasing Thunderbrew. So something for everyone there. Except Cider drinkers.

Moving on to spirits, there is a choice of Killer Queen Vodka and Motorhead Vodka.

If its time for wine, then try Motorhead Shiraz, Eddie’s Evil Brew Merlot, Pink Floyd The Dark Side of the Moon Cabernet Sauvignon and Slayer Reign in Blood Cabernet Sauvignon.

That seems to be a fairly good stock list, and if there is a niche unfulfilled I’m sure Kiss have brought something out to fill it.

I am planning one hell of a party, by the way!

 

Fake News on Facebook

There seems to be a spate of fake news sites going around Facebook at the moment. By that I don’t mean sites that are posting fake news, such as Toytown News, but posts that seem to link to legit news articles but then throw you off to something else.

I’m not going to give any direct links, but Bellingham tributes linking to UKIP hates sites is a particularly vile example.

So, how does this happen? Well to put it simply, when you post a link on Facebook, the site trawls the link to grab a picture and some text details. For example:

fakenews-eg1Note the “WWW.SYFY.CO.UK” text in the bottom left corner of the image. Most people wouldn’t pay attention to it, but that shows what website the post will actually link to.

The good news is that you can’t hide the destination site, but the bad news is that you can confuse people about it.

People don’t pay attention, and generally only scan “unimportant” information, so if the text at the bottom left says something like “news” or “feed” they are inclined to trust it.

So I registered a domain name to test this out.  I figured that it would have to include the word “news”. So, being a bit of a sick puppy (and a Chris Morris fan) I tried to get newsfelch.co.uk. Sadly, it was taken, so I got felchnews.co.uk. (As an aside, I will probably use this to post news articles about a fake village somewhere in the the Staffordshire Moorlands. If I can be arsed.)

Anyway, back to the fake news thing. Nothing makes a fake story looks real like the logo of a reputable news organisation. so I used this:

bbc-newsNext, you need a title. I went with my long held belief that you can use modern cleaning fluids to get rid of a body. Hence: “Cillit Bang Used to Disolve Corpses”, including a deliberate spelling mistake.

Next, some flavour text that will show up under the link. I decided to make it contradictory and nonesensical yet still grammatically valid, so:

According to South Lancashire Police, several corpses have been found completely disolved in Cillit Bang, leaving no traces whatsoever.

Ignoring the fact that there is so such organisation as “South Lancashire Police”, if no traces have been left, then nothing can have been dicovered? Obvious, right? Erm, no. But I’ll get back to that.

So, how does our fake news link look now?

fakenews-eg2It all looks legit doesn’t it, well apart from the “felchnews” bit that nobody pays attention to?

And here is the HTML to do it:

<html>
<head>
<title>Cillit Bang Used to Disolve Corpses</title>
<meta name=”description” content=”According to South Lancashire Police, several corpses have been found completely disolved in Cillit Bang, leaving no traces whatsoever.”>
<meta name=”keywords” content=”According to South Lancashire Police, several corpses have been found completely disolved in Cillit Bang, leaving no traces whatsoever,humor, prank”>
<meta name=”author” content=”News Editor”>
</head>
<body bgcolor=ffffff>
<center>
<img src=”/assets/bbc-news.png” width=1 height=1>
</center>
<center>
<font size=+10>Don’t be so fucking stupid! </font>
<center>

</body>
</html>

Clearly this just links to a site that says “Don’t be so fucking stupid!”, but with a little bit of javascript or the right HTML you can immediately bounce the browser the somewhere else.

I suppose, really, that this post could be condensed down to “be careful what links you click on”, but really, if you haven’t worked that out by now then you have no fucking business owning a PC/tablet/smartphone.