Showing posts with label Windows 8. Show all posts
Showing posts with label Windows 8. Show all posts

Raspberry Pi 2 Kodi storage on USB using UUID

A default OpenELEC or OSMC MMC/SD-card contains two partitions:
  1. A FAT32 partition with the kernel and system file and a cmdline.txt file that specifies the two partitions to use
  2. An EXT4 partition with the data, like artist/video thumbnails, the video and texture databases, and user configurations
The first issue is that a MMC/SD-card is:
1) less robust and gets corrupted easily and
2) slower then a 2.0 USB drive (note that the most recent Raspberry Pi 2B only supports up to USB 2).

The second issue it references these partitions by a "logical" name that can change from boot to boot. Especially for USB (thumb) drives that get removed and reconnected. For example, a drive might be /dev/sda5 during one boot, but /dev/sdb5 during the next. These logical names are used by default in the cmdline.txt file in the FAT32 partition when OpenELEC or OSMC starts. But it is better to use the unchangeable UUID that each drive has.

How to put the 2nd partition on a USB thumb drive using Windows and UUID's (OpenELEC, but OSMC is similar:
  • Download the 5.95.5 image from OpenELEC. There might be a more recent version, but this guide is tested with that one
  • Download and install Win32DiskImager on Windows
  • Insert the MMC/SD-card into a card reader that is connected to the Windows machine. If you don't have one, you need to buy it
  • Start Win32DiskImager and select the downloaded image. The file has extension .img. Select the device letter the MMC/SD-card has been assigned and press Write
  • Insert the USB thumb drive into the Raspberry Pi
  • Insert the MMC/SD-card into the Raspberry Pi and connect the power. The Raspberry Pi should already have a connected Ethernet or Wifi dongle before the power is connected!
  • Wait while the EXT4 partition is configured with i.e. the video database and Kodi folder structure. This EXT4 partition will be copied to the USB thumb drive later on.
    A short while after that, Kodi is started presenting an installation wizard
  • Follow the installation wizard and make sure the network connection is up and running and activate SSH. Keep OpenELEC running.
  • Download and install PuTTY on Windows
  • Start PuTTY and make a connection to the OpenELEC Raspberry Pi using its IP address on port 22 and selecting SSH
  • Click Yes to accept the new server host key
  • OpenELEC always has user: root and password: openelec
    OSMC always has user: osmc and password: osmc
  • Type in: blkid and hit enter and copy the UUID's from the FAT32 partition (most probably denoted by /dev/mmcblk0p1) and the USB thumbdrive (can be anything like /dev/sda1, /dev/sda5, /dev/sdb1, dev/sdb5, etc)
    Example result from blkid:
    /dev/mmcblk0p1: SEC_TYPE="msdos" UUID="6495-ECA4" TYPE="vfat" PARTUUID="84e76e9c-01"
    /dev/sda5: UUID="df2ea9f9-bdc6-4e79-b436-d2aa272ddac0"
  • Create a text file called cmdline.txt with this single line of text and UNIX line endings.
    For OpenELEC, specify the boot and disk locations using the UUID:
    boot=UUID=6495-ECA4 disk=UUID=df2ea9f9-bdc6-4e79-b436-d2aa272ddac0 quiet
    For OSMC, use the PARTUUID for the root (OSMC does not support UUID):
    root=PARTUUID=04030201-05 rootfstype=ext4 quiet osmcdev=rbp2 boot_delay=50 rootdelay=10 rootwait
    Note that the "boot" disk does not need to be specified for OSMC.
  • Shutdown OpenELEC properly from the Kodi interface and when done remove the power from the Raspberry Pi
  • Remove the USB thumb drive and the MMC/SD-card from the Raspberry Pi and insert both into the Windows machine
  • Download and install MiniTool Partition Wizard Free on Windows
  • Start MiniTool and click "launch application"
  • If the USB thumb drive has partitions, then select them and one by one select Delete Partition from the Operations pane
  • Press Apply and wait for the partitions to be converted into one big unallocated partition
  • Select Copy Partition Wizard from Operations and 
    • Select the EXT4 partition from the SD/MMC-card as source
    • Select the unallocated partition from the USB thumb drive as the destination
    • Press Apply and wait for the copy to finish
  • Close MiniTool and copy the previously created cmdline.txt to the root of the FAT32 partition of the MMC/SD-card. Overwrite the existing file there
  • Remove the USB thumb drive and MMC/SD-card from the Windows machine and put them in the Raspberry Pi. Connect the power
It might be that the Raspberry boots too quick and the USB disk is not yet available. This results in a black screen and freezed boot. For OSMC, a delay for system start in general (rootdelay) and each kernel call (boot_delay) can be used. Add this to the cmdline.txt (already done in the example above):
boot_delay=50 rootdelay=10

The MMC/SD-card can become corrupted easily when e.g. the Raspberry Pi 2 hangs or Kodi is writing too long to the video database and hangs, or there is a power glitch. In that case, re-writing the disk image is the safest and quickest option. The alternative is to download the KERNEL and SYSTEM file archive from OpenELEC and copy the necessary files manually to the FAT32 partition on the MMC/SD-card. This method however might still result in the Raspberry Pi not booting if the corruption is severe.

The BLKID tool can also be downloaded together with the necessary Cygwin libraries. Here is one by user bircoe: blkid for Windows. The downside is that this implementation - as well as the blkid on the OpenELEC/OSMC command line when it does not boot correctly, and you are stuck at the command prompt - does not show the PARTUUID (partition ID). It only displays the UUID, which is the filesystem ID. The SSH version does return the PARTUUID also.

It might also be that the combination of SDA and UUID does not work. To be sure do not use this combination:
boot=/dev/mmcblk0p1 disk=UUID=df2ea9f9-bdc6-4e79-b436-d2aa272ddac0 quiet
but always use UUID for both
boot=UUID=6495-ECA4 disk=UUID=df2ea9f9-bdc6-4e79-b436-d2aa272ddac0 quiet

One attempt with UUID's in the cmdline.txt file was not successful; OpenELEC would not boot and freeze at the gradient over-powered picture. Re-writing a clean image to the MMC/SD-card and putting the cmdline.txt file on it again solved the problem.

Install Epson AcuLaser AL-C900 on Windows 8

The Epson C900 AcuLaser can be easily installed on Windows 7 x64 and before using the Vista x64 driver available from the Epson website. In fact, most legacy printers can be installed using this method.

There might be an official in-box driver available for your (older) Windows operating system, i.e. it comes shipped with the C900 driver and recognizes the printer when it is connected via USB. No downloaded driver is then required.

Officially, there is no support and no driver for Windows 8 x64 for this printer. But luckily, the in-box driver is still present; it is just not recognized automatically on connection.

Manually install the Epson AL-C900 driver

Perform the following steps to get any legacy printer working on Windows 8:
  1. Open Devices and Printers
  2. Add a printer
  3. Click "The printer that I want isn't listed"
  4. Select "Add a local printer", next
  5. Select "Use an existing port" and select "USB000", next
    This "Virtual printer port for USB" only exists when the printer is connected and turned on!
  6. Select the following driver:
    Manufacturer: Epson
    Printers: Epson AL-C900
    Note: if the AL-C900 is not in the list, press "Windows Update" to get it
    next
  7. Done!
The printer will now function, but only on the physical USB port that is linked to the virtual USB000 port. You need to figure out by trying port for port which one this is. Also note that in some cases it can take up to five minutes for a print job to start on this printer.

Delete an existing port mapping

Delete an existing - visible or invisible - port mapping as follows:
  1. Open Device and Printers
  2. Click Print server properties
  3. Select Ports tab
  4. Select USB port with the mapped printer driver
  5. Click "Delete port"
Cannot delete port

Clear the printer spool folder beforehand by running these statements from a command prompt and reboot:

net stop spooler
del %systemroot%\system32\spool\printers\*.shd
del %systemroot%\system32\spool\printers\*.spl
net start spooler

USB printer is not recognized

If the USB printer is not recognized by Windows 8.1 (you don't even get the "USB device not recognized" message) then try the following:
  • Control Panel -> Troubleshooting -> Hardware and Sound: Use a printer-> Next
  • Device Manager -> Universal Serial Bus controllers -> Delete all Generic USB Hub entries and reboot
After reboot, open the Device Manager and plug in the printer. It should automatically appear. When the unplugged, it should immediately disappear.

PS3 controller on Windows 8.1 via bluetooth

A PS3 Sixaxis controller can be used as an input device on Windows 8.1.

For this to work the free Motion In Joy (MiJ) application needs to be installed: http://www.motioninjoy.com/download. At the time of writing, for Windows 8.1 x64, select v0.7.1000 (testing).

Using the controller via a wired USB connection almost always works, but using a wireless Bluetooth connection can be a problem.

Possible error: "Wait for bluetooth adabter to be connected" (Yes, there is a typo in adabter)

The causes for this are:
  1. MiJ installs its own non-signed bluetooth driver, which is not allowed on Windows 8 unless the system is started with "driver signature enforcement" disabled
  2. The bluetooth device's hardware id is not in the INF file of the MiJ bluetooth driver
The following instructions are from WingedT on:
http://forums.motioninjoy.com/viewtopic.php?f=15&t=3764&start=10

I revised them and put them on my blog in case that post is deleted from the Motion In Joy forum.

Instructions for bluetooth support:
  1. Before starting, make sure bluetooth works by clicking the Bluetooth icon in the tray in right-bottom corner and selecting "Show bluetooth devices". If there are none, try "Add a bluetooth device" and try to pair e.g. a mobile phone. If this works, continue
  2. Install and start MiJ's DS3 Tool
  3. Select "Driver Manager" and click "install all"
    It might be that MiJ drivers for both devices (USB and bluetooth) are installed correctly. In that case they both have a green checkmark at the end in the MotionInJoy column. If one has a red cross, then most probably that is the bluetooth driver and that has not been installed
  4. Take the Hardware ID of that device and strip the revision part, i.e. for a Lenovo Y510P this might be that USB\VID_8087&PID_07DA&REV_7869 becomes USB\VID_8087&PID_07DA
  5. Open C:\Program Files\MotioninJoy\ds3\drivers\MijXinput.inf in a text editor. 
    1. Find and replace:
      ;BLUETOOTH DONGLE
      with
      ;BLUETOOTH DONGLE
      %MIJ.DeviceName%=CC_Install, USB\VID_8087&PID_07DA
    2. Delete the following line:
      catalog=MijXinput.cat
    3. Save and exit
  6. Restart Windows 8 with Advanced Options so Driver Signature Enforcement can be disabled. Open a command prompt (Win + X, command prompt) and type:
    shutdown /r o
  7. In the Advanced Options screen, select Advanced Options -> Windows Startup Settings -> Restart
  8. In the next screen with the Advanced Option to enable, choose: 7. Disable Driver Signature Enforcement. A reboot will follow
  9. Select "Driver Manager" and click "install all". Now both devices should have a green check mark:

  10. Exit and restart DS3 tool and once again click "Load driver". Now the bluetooth driver should be selectable in the BluetoothPair tab:

Reinstall OEM-installed Windows 8.1

One of the first steps of the re-installation process of Windows 8.1 is that it asks for a Windows key. There is a "bug" that prevents a valid Windows key from working when the general Windows 8 installation disk is used on a laptop with a pre-installed OEM version.

Fortunately, if there are no installation disks supplied, then Windows 8.1 can still be easily re-installed on such a laptop, for example on another partition or disk:

1. Get a copy of the Windows 8.1 ISO, e.g. "Windows_8.1_EN-US_x64.ISO" and extract the contents to a USB stick

2. Bypass the Windows key screen by creating an ei.cfg text file in the sources folder on the USB stick. It should contain the following (replace "Core" with "Professional", if you have a valid key for that edition):

[EditionID]
Core
[Channel]
Retail
[VL]
0

3. Restart the laptop with the USB stick in it. The initial Windows key screen is skipped. During the latter part of the installation another Windows key screen pops up. Here the genuine valid key can be entered

Notes
  • It has to be a USB stick, an external disk will not work: Win 8 can only be installed from an USB stick or a DVD
  • Unfortunately, I cannot supply a link to the above mentioned ISO file
  • Make sure the BIOS settings are such that the USB stick can be booted from and is the first in the sequence of bootable devices. Check how to enter the BIOS and set the bootable USB device on the site of the laptop manufacturer. Each manufacturer has a different method. For Lenovo IdeaPad: press and hold the small round button next to the power adapter entrance during a reboot