Use your iPad as a display for your games console, any HDMI device.. or endoscope!

iOS 17 added support for UVC (USB Video Class) input devices, so that any iPad with a USB-C port can use an external camera, including USB capture cards.

This opens up a world of opportunities to use your iPad as a portable display for things like a game console (Xbox, PlayStation, Nintendo Switch), a device like the Raspberry Pi (making it very handy for debugging issues with a normally headless server), or even a $4 endoscope you can find on AliExpress!

Here are a couple of videos that show this feature in action;

Unless you’re just using a USB C endoscope, you’ll need a cheap HDMI capture dongle which you can plug into the iPad’s USB C port. The adapter I use is available here on Amazon; https://amzn.to/34xv7Lk

In my testing so far, the apps show very little latency and are great for playing games through.

The apps you can use for this so far are;

Feel free to leave a comment with any other apps you find!

Best 3.5mm to USB Type C adapters for microphone input

After switching to a reconditioned Galaxy S21 Ultra which has no 3.5mm headphone jack, the prospect of moving to Bluetooth earbuds didn’t phase me; they’re cheap enough & the quality is pretty good.

However, I wanted to use my Boya BY-M1 lav mic (with 3.5mm jack) to record videos for YouTube, and therefore needed a 3.5mm to USB Type-C adapter. After rooting around on Amazon I found a couple with decent reviews; one at £8, the other £18.

They might be fine for listening, but both were a absolute disaster for recording audio! The cheaper one had a poor frequency range, so it sounded like I was talking through a cushion. The other had a good frequency range (similar to the internal mic), but a high amount of electrical noise.

Since then, I’ve tested a couple more adapters and have put together a series of video reviews to show you which ones to avoid, and which ones I’d recommend you buy.

Samsung Galaxy S9 Super Slow-Mo Videos

The Samsung Galaxy S9 is a bit of a bargain if you look at the International versions. When it retailed for about £700 in the UK, you could import it from Italy for about £500! It’s available now on Amazon for £480.

When I bought the S9 I didn’t realise it had a special video mode called Super Slow-Mo. I’ve had slow mo on a Canon Ixus camera before, but it was poor resolution and needed a lot of light to work.

The S9 shoots super slow-mo at 960 frames per second, and captures 0.2 seconds of motion, stretching it to 6 seconds when you play it back.

One big difference with the S9 is how you trigger super slow-mo. When its set to automatic, a yellow square appears over the video preview.. when you start recording, the S9 looks for motion within the square, and when it sees movement it’ll trigger super slow-mo.

For me, the automatic mode makes it more than a gimmick .. you can get some great videos out of it without much effort. Here are a few (non-professional) examples that I’ve taken over the past few months;

 

 

 

 

 

 

These were quite simple to capture.. just practice a bit to see how it triggers and you can get good results.

Automated mains socket power-off for OSMC on a Raspberry Pi

I’ve chosen to replace an ageing mini-PC which I’ve used since 2010 with a new Raspberry Pi 3 B+ running OSMC. It makes for a really capable media centre which can playback newer h.265 HEVC video files at 1080p without any problems, or it can serve 4K files over NFS to a box with a hardware h.265 chip like the Fire TV Box.

This form factor is easy to take on holiday and you can use an old infrared remote control (or Harmony learning remote) with it too.

However, the one thing I’ve struggled with is how to make it easy for my family to use in regard to switching it on and off. The Pi doesn’t have a power button. Some power supplies have an inline rocker switch, which almost fits the bill. I wanted something more automated.

Fortunately I had a spare Energenie power socket from a previous project where I use one to turn off our bass speaker when the TV isn’t on. These power sockets are controlled remotely (over RF) from a Pi which you attach an Energenie control board/shield to.

What I’ve done with the Pi 3 is have it powered through an Energenie socket, and set up a service that executes when it detects OSMC is shutting down. That service will make a quick HTTP call to the Pi with the Energenie controller shield, which will in turn send an RF signal to turn the mains socket off.

 

osmcshutdown

 

Here’s how you can set it up like I have…

Scripts for the Pi running OSMC

First, add a new service script.. create a new file in this folder;

/etc/systemd/system/callenergenie.service


[Unit]
Description=Energenie Remote Call to Secondary Pi
Before=multi-user.target
After=network.target
Conflicts=shutdown.target
[Service]
ExecStart=/bin/true
ExecStop=/bin/sh /home/osmc/callenergenie.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

Then enable it with;

sudo systemctl enable callenergenie.service

There are a couple of useful things happening in this service, the After parameter makes sure the code runs before the network code is shut down, and Conflicts parameter is looking for OSMC shutting down.

Now add a helper script… this will make the webserver call as a background task, so control will be given back to the service immediately, rather than it waiting for the wget to complete.

/home/osmc/callenergenie.sh


echo Calling energenie socket…
wget –quiet –background –output-document="callenergenie.log" "http://192.168.1.99/callenergenie.php?delay=10&switch=2&state=off"
echo Sleeping for 2 seconds
sleep 2
echo Done.
exit 0

This calls the PHP script, telling it which socket to turn off, and how long to delay before sending the command, which we’re doing so that the Pi has time to shut down before the power is cut.

Scripts for the Pi with the Energenie shield

This is the PHP script I added to the other Pi which was already configured to be a PHP web server.

/var/www/html/callenergenie.php


<?php
/* MattC – Call this with various parameters..
callenergenie.php?
delay = time in seconds to sleep before calling Energenie
switch = which socket to talk to
state = turn socket on/off
e.g. callenergenie.php?delay=5&switch=2&state=off
*/
print ("Waiting ".$_GET['delay']." seconds");
sleep($_GET['delay']);
print ("Switching socket ".$_GET['switch']." ".$_GET['state']);
exec("sudo python /var/www/callenergenie.py ".$_GET['state']." ".$_GET['switch']);
?>

To allow PHP to run the script as root, I needed to add the Apache user to the list of sudo-ers.. not that secure tho :( I’d be interested in anyone who knows how to run the Energenie scripts a regular user.. their Python doesn’t like it when it’s not root.

nano /etc/sudoers

www-data ALL=(ALL) NOPASSWD:ALL

The nice thing about the PHP script is that we can actually call it to turn the Pi on remotely too.. so you could configure that into a widget on your phone, or add it to Alexa.

Adding IR Remote Control Support to the Raspberry Pi

In my last post I took you through how I created a small portable media centre that I can easily take on holiday to hook up to the hotel TV.

To reduce the amount space it took up, I used a cheap USB keypad which could be used to control the media center. It worked really well & having something hard-wired meant I didn’t have to worry about a Bluetooth-paired device needing re-pairing.

However, what I then realised was it would be good to be able to use a spare remote control instead. I was using the OpenElec distribution and looked through their documentation for how to do this, but only found references to version 3 of the software (it’s on version 7) and how to get LIRC working with it. There were plenty of blog posts on hooking up IR support, but a lot of them were written 2-3 years ago, and the software has moved on somewhat.

Hardware Setup

What I did first was buy a suitable IR receiver. I chose the Vishay TSOP4838 (which costs less than £1) because of the voltage range (2.5-5.5v) and receiver frequency (38KHz). If you look at the datasheet for the product, you’ll see which pins should get wired up to the Pi;

Simply wire pin 1 to GPIO 18, pin 2 to GND, and pin 3 to a 3.3v power pin, e.g.

By using some short F-F jumper wires and a small cut in the side of the case, I was able to position the reciever neatly(ish) on the side.. it’s still easily removable, but you could integrate it into the case a bit more seamlessly than this ;)

Software Setup

Before this project I was using OpenElec, but had limited success getting the IR support working properly. I switched to OSMC which I’d read had better IR support through the main UI. I think I was actually on the right track with OpenElec, but I realised later that the old vintage Xbox remote I was trying to use wasn’t 100% working.

If you’re going to use a remote control that’s officially recognised, then you can jump this part about learning IR remote control codes.

Learning IR remote commands

The remote I found in the loft was an old DVD player remote which (unsurprisingly) wasn’t in the list of pre-recognised remotes in the OSMC installation. I needed to get the Pi to learn the IR pulses being sent out by the remote and map them to the Kodi functions.

1. First off, you need to telnet to the Pi. Username: osmc, Password: osmc.

2. Next you need to stop the LIRC service which is being locked/used by Kodi

sudo systemctl stop lircd_helper@lirc0

3. Now you can run the IR learn mode.. this will record what it finds to the config file you specify;

irrecord -d /dev/lirc0 /home/osmc/lircd.conf

4. Follow the on-screen instructions which will recognise your remote.

One observation I had was that this only worked properly if I stopped after the first prompt to press lots of keys on the remote.. if I completed the second stage, the key mapping didn’t work, e.g.

If I ignored the second phase & let it abort, the learn process worked

When it’s working, you’ll be able to enter the Kodi function (like KEY_UP, KEY_DOWN, etc) & map it to a key press on your remote;

Once you’ve mapped all the functions you want, we then need to move back to OSMC and tell it to use that config file we’ve just written.

OSMC Settings

In OSMC you need to do the following;

1. Disable the CEC service (via System Settings > Input > Peripherals > CEC Adapter), which seems to be needed for LIRC to work.

2. Now go into OSMC settings and pick the Raspberry Pi icon

3. Go into Hardware Support and enabled LIRC GPIO Support. You shouldn’t need to change anything if you connected the sensor to GPIO 18.

4. Now go back and select the Remote Control option.

5. Ignore the list of pre-installed remotes and select Browse;

6. Navigate to the folder where LIRC wrote your config file;

7. Confirm the change & reboot the box;

That should be it.. your remote should be able to control everything in Kodi.

Portable Raspberry Pi Media Center

We recently went on holiday and I took my laptop & VGA cable with me. It was my intention to hook it up to the TV and play some media on it to keep the kids happy on rainy days. However, It turned out the TV had the VGA port covered up by the wall mounting bracket, and my laptop doesn’t have HDMI.. so we ended up putting the laptop on a chair and watching videos from there; it did the job, but wasn’t ideal.

At home we have a Fire TV Stick that could run Kodi, but the problem with Fire TV is that it has to have an internet connection, otherwise it doesn’t work (you can’t even get to Kodi!). Tethering it to my phone isn’t an option, since there are poor mobile signals in a lot of the places we visit.

Next time I’m going to be more prepared, with a more compact and flexible setup consisting of a Raspberry Pi 2 running OpenElec (and Kodi) together with a set of cables allowing me to hook it up to pretty much any TV. The Pi 2 runs Kodi really well, and the OpenElec distribution boots really quickly & has good Wifi and BlueTooth support. I initially chose a compact/travel USB-based keyboard instead of Bluetooth in case OpenElec ‘forgot’ the keyboard and I’d have nothing to navigate the menus to re-pair it.

Cable-wise, I’ve got a 1m standard HDMI cable, which will be fine in most situations.. with a 2m HDMI extension lead if I can’t get the Pi near enough to the TV (some accomodation doesn’t have power sockets where you’d expect them). I’ve also got a RCA lead, with a SCART adapter as well.. so that helps if we get stuck with an older TV.

For media storage I’ve gone with a USB3 Flash Drive with a capacity of 64Gb, which gives us more to play with than the microSD card, and it’s super-fast for copying media from a PC. As soon as you plug in the flash drive, Kodi will show it in the menus.

So that’s it.. nothing groundbreaking or overly difficult to put together. The whole system is small enough to fit in a small travel bag & gives us a lot of flexibility when dealing with different hotels/accommodation. You may just find the TV accepts the USB flash drive and can play back whatever is on it.. but at least you’ll have all the gear you need if it doesn’t ;)

After I made the video, I bought a USB numeric keyboard from eBay for a paltry £2.. that’s compacted the kit even further, allowing it to fit in an old camera bag.

The keypad isn’t instantly recognised by Kodi, but an easy way to get it up and running is to use the Keymap Add-on. Attach a normal USB keyboard and the keypad at the same time.. start the add-on and use the keyboard to activate the remap process. From there, it’s dead simple to map the keypad to the different Kodi functions.

Here’s the full kit list;

1 x Raspberry Pi 2
1 x 8Gb MicroSD card
1 x 2m HDMI extension cable
1 x 1m HDMI cable
1 x USB numeric keypad
1 x RCA to SCART adapter
1 x 3.5mm plug to RCA lead
1 x 64Gb USB3 Flash Drive
1 x USB power supply + cable

Update 1:

Just got back from a week at Center Parcs (Woburn) and was really pleased to find a HDMI socket on the wall, and a power socket.. it made it super easy to hook up the Pi to the TV :)

Update 2:

We spent a week near Blackpool, and the accommodation we stayed in had a patch panel as well! Seems like they’re quite common these days :)

 

Increasing battery life on a Galaxy S3 with Android 4.3

The latest software update to the Samsung Galaxy S3 upped it to use Android 4.3, but included a whole bunch of Samsung bloatware. From a full charge, it was only taking 20 hours to run down flat, with it feeling slightly warm all the time. There was also a really annoying app that was requesting I sign into Facebook after each restart.

From what I can see, there are a bunch of things that you can disable to improve the battery life & get things back to normal. Here’s what I did;

Go to.. Settings > More > Application Manager > All

Open & disable each of these.. (obviously if you use a particular service, like Dropbox, leave it alone);

Amazon MP3
Backup
Dropbox
DropboxOOBE
Face Unlock
Game Hub
Music (the official Top 40 app)
Music Hub
O2 Space
PageBuddyNotiSvc
S Suggest
S Voice
Samsung Account
Samsung Apps
Samsung Backup Provider
Samsung Browser SyncAdapter
Samsung Calendar SyncAdapter
Samsung Cloud Data Relay
Samsung Cloud Quota
Samsung Contact SyncAdapter
Samsung Link
Samsung Push Service
Samsung SMemo SyncAdapter
Samsung Syncadapters
SamsungAppsUNA2
SNS
Video Hub

Foscam FI8910W Review, Unboxing, and tips

foscam Over the past 3 years I’ve had the Edimax IC-1310 working in my home without many problems. It’s great to be able to monitor the house when I’m away & know that I’ll not have any nasty surprises when I get back.. well at least from a living room point-of-view.

The Foscam range of webcams caught my eye, specifically the FI8910W which can use a wireless network connection, and is steerable. I like the fact that this gives it a lot of placement flexibility.. just needing a power source & off it goes. This newer model has an IR-Cut filter which gives better colour reproduction from it’s predecessor. I paid about £65 for the white version from the official UK-based Foscam distributor; there was a 10% coupon code floating around on the web, which brought the price lower than Amazon.

Here’s what’s in the box;

Initial setup of the camera is supposed to include you installing some Windows app to find the camera’s IP address on your network; my router gives me a list of connected devices, so I chose to forego the app and use the router’s info instead. I could log into the camera once I had it’s IP address, and configured it to connect over wifi, altering a few other settings as I went (disabling the DDNS service, since my Edimax camera is already updating dyndns.org with my externally visible IP).

As long as you’re used to fiddling with things like port forwarding you’ll have everything set up within 10-15 minutes; there’s not a lot to it & these days it’s handy to have a phone on 3G to check things are working correctly. I added a few extra user accounts, and had TinyCam Monitor for Android working in no time at all.. specifying the local network IP on the main settings, and the DynDNS address on the extra 3G settings page.

Being able to steer the camera is really handy.. when you have it pointing in the right direction, you can save it as a preset, both from your browser, or from an app like TinyCam Monitor. I’ve set mine to mostly look out of the back window, but can swivel it round to look into the kitchen & hallway.. even up to the skylights, etc.

The quality of the images is pretty decent, but at 640×480, they’re not exactly HD quality. Motion detection is a tad limited.. even compared to my 3yr old Edimax. There’s no way to specify zones for motion detection, and it only uploads 2 .jpeg files for each motion capture event (the Edimax can upload 5 second videos!).

Annoyingly, even if you turn off the IR LEDs, they’ll switch back on the next time the camera is rebooted.. which is a real pain when the camera is looking out of a window (you only see the bright glare of the LEDs shining back at you!). Hopefully that’ll get fixed in a future firmware update, but I’m not betting on it. Talking of firmware, make sure you upgrade it.. the latest versions include some (unspecified) security fixes.

Overall, I’m still impressed with the camera.. the price point is just right when you compare it with the features and annoying niggles.

For anyone who wants a direct URL to a jpeg snapshot from the camera, then this is the correct URL format;

http://your-external-ip:port/snapshot.jpg?user=whoever&pwd=letmein

That should be handy for anyone who has a HTML dashboard page, or a desktop widget that accepts webcam image URLs.

And here’s a sample image from the camera as it points out of my back window.. a window that needs a clean! And yes, that’s a sink plunger on the patio.. for some bizarre reason the kids enjoy playing with this more than the billion toys they’ve got ;)

Foscam FI8910W snapshot

Bluetooth audio A2DP receiver BTR006 review

We have a tablet that we put in a headrest mount for the kids to watch on longer journeys. In the past I attached an FM transmitter so that audio could be fed through the car stereo, and I could control the volume from the dash. The only problem with that was local radio stations in other regions stomping over the FM signal I’d pre-set earlier in the journey.

I bought the Bluetooth audio receiver from Justop. It’s the BTR006 model which apparently has some updated chipset. It’s about £15 on Amazon.

This tiny unit draws power from its built in li-on battery (or any USB port) and when fully charged will allow for 8-10 hours of use, and something like 250 hours of standby.

It was easy to pair up with my Samsung Galaxy S3, and Blackberry Playbook.. both of which will be using A2DP. The signal travels 5-10m without problems, but at extremes, the signal gets scrambled by walls/people. For my use, which is for in the car (tablet with the kids in the back) it works a treat.

The only thing I don’t particularly like is the tiny power socket which uses some non-standard plug instead of micro or mini USB. That’s a real pain when I have loads of micro USB-ended adapters kicking around.

Titanium Apps and the Blackberry Playbook

In Feburary 2012, Blackberry updated the OS for their 7″ Playbook tablet to v2.0. This introduced compatailbity with Android-based applications whereby developers can simply repackage, code sign, and submit their Android apps into BlackBerry App World. It also means you can take any Android app (that hasn’t gone through this process) and sideload the app yourself.

Since I develop mobile apps for iOS and Android using the Titanium platform, I was interested in how much effort it would be to get my existing apps working on the Playbook. There are plenty of posts on how to take an APK and sign it correctly for App World, but what took me a while to figure out, was which version on Titanium was compatible with the Playbook.

After some experimentation, I’ve found that if you package your app against Titanium SDK 1.7.5, it’ll work nicely on the Playbook. Version 1.8.x won’t work (hmm, maybe it’s V8 vs Rhino.. V8 definitely doesn’t work…). Certain pieces of code may also cause the app to crash (whereas it won’t crash on a proper Android device). The one thing I hit, was passing url:null, into Titanium.UI.createWindow will crash the app, whereas that’s absoutely fine on iOS and Android.

The other small advantage of using the 1.7.5 SDK is that the resulting APK is a lot smaller, although since the current Playbook only has Wifi this is less of an issue than it is on a mobile phone.

Now we have the APK, you just have to go through the app packaging/signing process as detailed elsewhere on the web, or in Blackberry’s official documentation. This new GUI-based tool looks like a good place to start if you don’t like working from the command line.

ASUS RT-N56U Wireless Router Review

The Belkin 54G wireless access point I’ve been using for a few years has been suffering since we extended the house.. there’s just not enough range on it, and it tends to temporarily lock up if it’s hammered a lot.

Finding a replacement took a lot of research, but I eventually decided on the ASUS RT-N56U, costing about £85, after reading some great reviews, including one in PC Pro. It’s worth reiterating that it doesn’t contain an ADSL router.. so if you’re on that type of broadband you’ll still need one of those in your set up. I’m happy with that, since the master socket isn’t where I want to place the wireless router anyway.

Configuration was straight-forward, aided by a decent web interface. As soon as I plugged it in I upgraded the firmware to the latest version from ASUS. I’d also seen that there are unofficial firmwares from a Russian group which are meant to fix a bunch of stuff & add new features. I’m sticking with the ASUS firmware unless I hit stability problems or find that I want to tinker later on. I certainly like the option to have a customised firmware should the need arise.

After having it running for a few days I’m really impressed with the speed and coverage across the house. It allows you to either use one SSID for 2.4Ghz and one for 5Ghz.. which lets you decide which band you want a device to use. Or set the same SSID for both, and it’ll automatically switch you over to the fastest band according to the signal strength. I was in the kitchen, and it connected on what must have been the 2.4Ghz band (due to the distance), then moved to the living room where the speed shot up & was obviously using the 5Ghz band.

Here’s a table showing how the signal strength has been affected by the upgrade;

Signal Strength (dBm)
Postion ASUS Belkin
Utility Room -70 -75
Kitchen Diner -76 -85
Lounge -45 -63
Bedroom -61 -75
Bathroom -76 -85

 

And here’s my unboxing video;

Blackberry Playbook: Bargain 7″ Tablet

In the last few weeks the price of the Blackberry Playbook has plummeted further, to £169 in the UK from retailers such as PC World. At that price it deserved some research into what it offers & whether it’s worth a look. The tablet itself is solidly built, with a decent amount of processing power & good multi-tasking abilities. There’s an app store that offers a fair number of apps, including the obligatory Angry Birds, Plants vs Zombies, and useful stuff like free VNC clients.

The 7″ screen looks crisp & vivid, and isn’t as cramped as I’d imagined it would be. I’d viewed someone’s Samsung 7″ tablet so knew what to expect. Browsing the web on it is slick & fast, plus it’ll play Flash videos, so iPlayer, 4oD and other sites all work on it without a hitch.

The OS is soon to get v2.0, and that’s where things get even more interesting; that opens the Playbook up to the Android Market, allowing it to run a majority/proportion (not sure which yet!) of Android apps. OS2.0 will also offer MKV support, but what codecs are actually covered is unclear.

Built-in storage is limited to what you initially purchase (e.g. 16Gb), and there’s no SD card expansion. However, if you root the Playbook, there’s a method to add USB-host functionality, allowing you to attach USB flash drives.

A micro-HDMI connector allows it to mirror the display to a TV without proprietary adapters & it just works!

Here’s what you need if you want to hook it up to a TV (a few different cable lengths included):

Micro HDMI to HDMI adapter = £3.56

0.5m standard HDMI lead = £1.18
1.0m standard HDMI lead = £1.14
5.0m standard HDMI lead = £3.19

And here’s what you’d need to connect a standard USB flash drive

Micro USB to USB adapter (270 angle means it doesn’t clash with HDMI output) = £3.17
USB Female to Female adapter = £1.14

For the back of the car, I’ve gone for a generic headset mount that can also mount an iPad:

Universal tablet mount

And to protect it from scratches and minor droppage in the house I bought the official faux leather convertible case, which beats the hell out of the horrible case it ships with.

Faux Leather Convertible Case

After a few hours of research I knew it was a good deal, bought one & haven’t been disappointed. It *is* a bargain for what you get :)

Custom Firmware on the Humax HDR-Fox T2

After the untimely death of my Topfield box, and less than stellar performance of the 3view box, I ended up sending that back & buying the Humax HDR-Fox T2. Since I bought it over a year ago there’s been a huge amount of progress on a custom firmware which enables you to install ‘packages‘ that add a whole bunch of new features, including;

– Web-based interface for controlling the box, searching the EPG, etc.
– Smartphone optimised web interface
– Auto-filing script for placing series linked programs in designated sub-folders
– Remote scheduling interface for setting timers on the box remotely
– Recording trimming to cut off unwanted segments of recordings
– Custom TV portal (offering Sky Player support)
– And loads more!

There are some videos on YouTube that show a lot of these features in action, together with a guide showing exactly how to install it onto your box. It’s a simple, and reversible process & the guys that have worked on it have helped improve the features on the box no end!

Harmony 600 Replacement

Due to a clash with a toddler and my Harmony 555 all-in-one remote I bought a Harmony 600 in September last year. In the last month it’s been repeatedly rebooting/restarting. A new set of batteries sorts the issue out, but only for a couple of weeks, and then it starts happening again. There’s a thread on Logitech’s support site which talks about the problem, so it’s not an isolated issue.

The good thing is, that after raising a support ticket on Sunday, it only took a couple of message exchanges before they said it was faulty & shipped a new remote. They don’t even ask for the old one back, since they can de-activate it on their servers so that it can never be updated online.. pretty much rendering it useless, because there’s no way to update it without using their online app.

Kudos to Logitech for sorting this out so quickly! Really impressive.