Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Wednesday, 18 April 2018

Raspberry Pi 3B+ Desktop for an RV


Years ago on one of his visits home from Japan, my son gave me his old Raspberry Pi, because he had just upgraded to the new Pi B+.  It didn't take much messing around with it before I saw some potential and ended up with a Pi B+ as well.  As luck would have it, the Pi 2 was released about a week later, and with the faster processor and double the RAM, I acquired one.  

Then the Raspgerry Pi 3 came out with a faster processor and 4 USB ports, and even more useful - built in Wifi and Bluetooth.  Suddenly I had the basis for something I had wanted.  A low power draw desktop computer for one of the yachts I was living aboard for part of the year.

A wander around the computer stores found me a 15 inch LED TV that used a 12 Volt power supply and had HDMI input and a USB port.  I had thought the USB port could be used to power the Pi, but while it may have been sufficient for the B+, the Pi 2 needs close to 2.5 Amps and the early TV USB port outputs were seldom that high.

The neat thing though, was that this TV used a 2 Amp 12 volt power adapter with a standard D.C. plug end.  It worked fine instead with a car cigarette lighter adapter.  A Pi of course, will run nicely using a cigarette lighter USB charger adapter.

So the electrical requirements were sorted, because the 26 foot Cavalier keel boat I was living on was already set up with 12V cigarette outlets in various places, and solar charging.

A few things happened with my health - mainly three apparent Golden Staph infections in my brain, and a mess of it in my heart,  The brain was stabilised using very strong antibiotics, but the heart was bad and required a replacement Aortic Valve.  That took me off the yacht and screwed up my life for the next 6 years.  After years of suffering from a 1999 spinal injury that the hospital had ignored, then more from the dozen or more fractures in the hit and run incident in 2004, I could do without more health dramas.

My life had been pretty well 'stolen' from me by medical incompetence for years, and now this!  As it turned out, things would get worse.

In 2017, the yacht "Shepherd Moons" was wrecked in cyclone Debbie, and while I was trying to salvage some stuff in the wreck lying in the mangroves, I got infected again.  I ended up with a Golden Staph infection in my heart that was so serious they were doubtful if it could be operated on.  On top of that I had three bleeds into various lobes of the brain.  One in the occipital lobe has affected my eyesight, one might have made me a little dumber, but the other was into the cerebellum and was definitely life threatening of its own accord, because there was a real likelihood that I would return from surgery in a permanent vegetative state.

The surgical team pointed out that this time the Golden Staph infection was not only in the valves of my heart, but had apparently eaten into the 'mitral curtain', and area separating two of the chambers in my heart.  They would not know for sure, but they suspected repair might not be practical.  If it was reparable, they planned to remove a section of my heart containing the root of the Aorta, and the Aortic Valve, and replace the whole piece with a section from a pig's heart.

They also insisted my son, who was now working in Brisbane, fly to Townsville to say 'goodbye'  just in case.  

Despite saying goodbye to the people closest to me, I ended up surviving again.  But my days of living aboard yachts are probably over.  I came through with permanent effects of stroke, and some extended peripheral nerve damage as well as a couple of eyesight problems.  But I can still drive, which is where we get back to this post.


I still have my Toyota HiAce van, and although it is getting a bit long in the tooth, I have spent a bt on it to keep it mechanically sound.  And as much as a laptop might be more practical, I have all the bits here to make a small mobile desktop computer.  So when the new Raspberry Pi 3B+ came out I bought one, because I had given my Pi 3 to my son.

I had a couple of Pi 2 around in cases, and since the cases haven't changed, I fitted one to the Pi 3B+, along with spare heat sinks left from when I overclocked the Pi 3.  I also still had a bluetooth keyboard with a track pad.

All the parts were there, so I hooked it all together,  Immediately I found that the system runs about the same as the overclocked Pi 3.  But it is definitely sucking more power than my 2.4 Amp adapter likes.  That means I will have to look for a 12V 2750ma or 3000ma adapter.

But it works.  Video is ok on Chromium, and great on Kweb with OMXplayer.  I worked on some stuff for Kweb with Gunther Kriedl a couple of years ago, so I like Kweb.

I also found that no matter what I did, VLC and SMplayer will not work properly because unlike OMXplayer, they do not have the appropriate codecs available and do not work with the Pi hardware acceleration.

However Kodi still does, so I can play video at 1080p using OMXplayer or Kodi, and I can watch 1080p or 720p YouTube videos.


The last big difference is that the Pi 3B+ can access my 5GHz WiFi with its built in wireless and bluetooth module, and streaming is now seamless.

The Pi case attaches to the back of the TV using velcro, and I use a very short flat HDMI cable for neatness - not the one shown above.  Sound is though the HDMI cable,but I also have a little gadget that plugs into the audio socket on the Pi and transmits audio to the car radio if I want to play music with decent sound.

The van has a built in 4G WiFi hotspot access, so I can also have Internet and comms on the move, as well as TV if I am in a reception area.

I'm happy as a pig in stuff.

Friday, 3 June 2016

The most important NEW FEATURE for Raspberry Pi - backup your SD card

While I agree that the Raspberry Pi is basically a toy computer, that is only because of a few design limitations imposed by the builders sticking to the original low budget ideals.

The greatest of these is the lack of Flash memory and the lack of a swap partition somewhere fast.  Everything is done within the rather slow limits of a micro SD card.  And from time to time the Raspberry Pi will simply lose its ability to work due to corruption of the SD card.

The latest update of the Raspbian 'Jessie' operating system goes a long way to making that easier to live with.  Under Accessories in the Menu is an option called 'SD Card Copier'.

This tool is a little like the Linux 'dd' command, except that it is graphical and semi automatic.  All you need to do is insert a micro SD card in a suitable card reader in one of your USB ports, choose that card as the destination to write to and hit start.

It defaults to choosing an MMC (which generally implies an SD card) so as long as you don;t have another SD or micro SD card attached you are unlikely to make a mess.  The process takes as long as writing a disk image using dd, but you just leave the Pi to do it along and don;t touch anything until you see the job completed popup.

The wonderful thing about this is that I can install a heap of new Add Ons to KODI for example, then backup the whole thing to a spare card.  Or I can do an update or a dist-upgrade and backup to a spare card.  All your current settings including wallpaper, special changes to config files, everythign is mirrored to the copied card.  So if something goes wrong, all you lose is whatever you added or any documents and stuff since the last backup.

It takes away all the guesswork and the worry about possibly corrupting your micro SD card.

Saturday, 19 March 2016

Raspberry Pi - Bluetooth the Easy Way - Reposted

Recently I posted about using Blueman to make Bluetooth work on the Raspberry Pi 3B.
It gave me immediate access to transfer files to my tablets and phones so I could print using Wireless Direct to my wireless printers.

But as someone kindly commented here - it did not work with Audio.  So I deleted the original post and changed a few things so I could connect by bluetooth to my Logitech S00113  Bluetooth Audio Adapter.

Here's what I did.  I use Synaptic, so finding what is installed is easy.

sudo apt-get install synaptic

First, I made sure that bluetooth was installed, then checked that pi-bluetooth was also installed.  pi-bluetooth loads the drivers for the new on-board bluetooth in the raspberry Pi 3B.

Then it was time to add a few tools:

sudo apt-get install bluez

sudo apt-get install blueman

sudo apt-get install pulseaudio

sudo apt-get install pulseaudio-module-bluetooth

I also have bluez-tools.  It should have been installed by bluez.  If it was not, it doesn;t hurt to install it.


then, just in case I want to use pulse for anything else

sudo apt-get install pavucontrol

pavucontrol is not really needed.  But there are times I use the pulse volume control for other things.

I am listening to music playing from my Raspberry Pi 3 to my blueooth system as I write this.




Monday, 7 March 2016

Raspberry Pi 3 Enabling Analog Audio in omxplayerGUI - and avoiding the KODI shutdown problem.

Since the first release the Raspberry Pi has been used as a Media Centre, and the extra performance of the Pi 3B means more of them will be used that way.  But a media centre outputs sound and the Pi 3 and Raspbian have some problems in that area.

UPDATED

The best video playback on Raspberry Pi is achieved using omxplayer, and in Raspbian Jessie, omxplayer defaults to playing audio through HDMI if an HDMI cable is plugged in.  Of course if you are using a HDMI cable for video, you will get HDMI sound.  Changing the output by right clicking the Volume (speaker) icon on the panel will not change this for omxplayer, although it does for most other players.

If you are opening omxplayer from the command line, you can output through the Analog jack on your Raspberry Pi by typing

omxplayer -o local filename.mp4    

And in this example it would play the file filename.mp4 with the sound through the Analog jack.

However if you happen to be using the fastest browser available for Raspberry Pi, this will not work, because kweb uses omxplayerGUI.  And omxplayerGUI does not have a button to select the audio output.

What kweb does have though is a very detailed Configuration system accessed by clicking the 'Home' button.  I wasted a week trying to get sound working by adding it in various forms to each of the places where omxplayer arguments can be placed.

Once at the Home page,  clicking the  Settings button will open a page with lots of places to tweak the program.

Scroll down about 1/3 of the page and you will find a heading:
GENERAL OMXPLAYER AUDIO VIDEO OPTIONS. arguments.

To switch the audio output in omxplayerGUI from HDMI to ANALOG or back again you need to click the Settings button and scroll down the page to:

There are four headings with a text box below them to enter argumentsWhat kweb does have though is a very detailed Configuration system accessed by clicking the 'Home' button.  I wasted a week trying to get sound working by adding it in various forms to each of the places where omxplayer arguments can be placed.

Once at the Home page,  clicking the  Settings button will open a page with lots of places to tweak the program.

Scroll down about 1/3 of the page and you will find a heading:
GENERAL OMXPLAYER AUDIO VIDEO OPTIONS. to send to omxplayer.
Each part of an argument MUST BE On A SEPARATE LINE.   So to enter   -o local  You would enter it like this in each box.

-o
local

These are the places you need to enter it:
NOTE!!   Click the SAVE button next to each box after you add the lines.
The first three settings are about 1/3 down the page under the heading:

GENERAL OMXPLAYER AUDIO VIDEO OPTIONS.
omxoptions (video player)
omxaudiooptions (audio player)
omx_livetv_options (video player, special settings for live TV streams)

The last is near the bottom of the page under the heading:
ONLINE VIDEO OPTIONS
youtube_omxoptions (video player, used for web video)

To return your omxplayerGUI output to HDMI, simply open Settings again and chenge the entries under each heading to:

-o HDMI

NOTE!  
In the Settings page there is an option to create 'Presets'.
I will write more about these in a few days.  For now I'll mention tat once you have made any special changes to the Settings of kweb and omxplayerGUI, you can save the state of those settings and kweb will create buttons so you can apply them quickly with a mouse clisk.

So you can change the above settings for Analog and create a Preset for Analog audio, then change them back and create a Preset for HDMI audio and simply click the appropriate button to swap output modes.

Presets can easily be created for quick access to various other functions.


Some videos will not play in omxplayer, but do play in KODI.  However KODI has a problem.   Choosing 'EXIT' from the KODI menu leaves you with a blank screen and the risk of corrupting your bootable micro SD card if you simply unplug the power.


So what to do about it.

Quitting KODI.
FORGET about the 'Exit'  option that is supposed to take you back to the desktop.
Choose 'Power Off' - to get out of KODI and turn the system off.
Choose 'REBOOT'  - if you plan to use Raspbian again.

I use omxplayerGUI for just about all of my video playing needs, except where I want to loop a video or a playlist.  In that case I simply open KODI.

Saturday, 5 March 2016

Raspbian - Disable Screen Blanking

Many Linux distributions over the years have had a problem where disabling the distro's screen save and power options do nothing.  Raspbian doesn;t even have the option to put it out of screen save mode, so at rather annoying intervals the screen simply blanks.  Fortunately the fix is exactly the same as it has been for years.

The quickest and simplest way to stop Raspbian going into screen save mode is:

sudo apt-get install xscreensaver

Once it is installed, you should find a new Menu Item under Preferences  called Screensaver.

Just open that and select Disable Screensaver from the Modes dropdown list.  Or, if you prefer, set a slide show or something.  At least you will be able select the time between screen saves.

Thursday, 21 January 2016

Media Centre Raspberry Pi B - PcDuino 3B - Raspberry Pi 2, Raspberry Pi 3B - My experience.

Since the Christmas Season and the receiving of gifts, I've had the chance to compare the PCDuino v3b with the old Raspberry Pi B (the one with only 2 USB ports - not the B+) and also with the Raspberry Pi 2 B.  The results were interesting.

The PC Duino 3B played all HD mp4 Video, even 4k files of 3GB in size perferctly with the exception that the audio was almost always out of sync.  Which is not ideal in a multimedia centre for example.

When I was given the Raspberry Pi, the model B I had no intention of using it as a computer, so I installed OpenElec and checked it as a Multimedia Centre.  It worked perfectly!  Did everything I could want in multimedia without a glitch,

The Raspberry Pi 2B on the other hand was completely incapable of playing the same 3GB file in KODI,  So I tried installing SMplayer and VLC, which also failed.  Not only that, but they failed to allow Analogue Audio,  I installed OpenElec (the special Pi 2 version) and had similar problems.  The file would play for a while, then stop and start, then play a while and so on until after a while it simply locked solid. I was beginning to think the mp4 file might be corrupt, but I checked it on a couple of other devices and it was fine.

Back to the old model Raspberry Pi with the same video, and again it played perfectly.

So as a Media Centre, both the PCDuino 3B and the Raspberry Pi 2B have serious limits.
And as a Media Centre, the old Raspberry Pi B works beautifully.

I through the extra CPU power and memory of the PCDuino would make it great for the job, but it appears the lack of suitable media CODECS is its downfall.

And the QUAD core processor of the Raspberry Pi with double the RAM of the older Pi B should have put it head and shoulders above the rest - but it failed miserably.

So the Old Pi model B, which seems to be no longer available is back to performing my Media tasks.  There is however a Pi model B+ available that seems to have the same specs, but with the addition of an extra two USB ports.  With any luck the 4 port model should perform just as smoothly as the 2 port model.

EDIT !!
Somebody emailed a question about whether the SD cards were different and could be affecting the playback performance.
ALL the SD cards were Sandisk ULTRA microSD 16GB.  On the Pi B  the card was in the supplied standard size adapter.

All systems were initially tested with the OS and the players, including KODI or XBMC (on the PCDuino) at their standard settings with the exception that Audio was swapped to Analogue output.

Only the Pi B played the 3GB HD mp4 at standard settings.
Even tweaking settings including scripts for Mplayer failed to fix the other systems.

UPDATE !!

The Raspberry Pi 3B does everything the Pi 2 did, but a hell of a lot faster.  Benchmarks aside, real world programs are running on the Pi 3B at about the same speeds as my AMD E-350 Dual Core Compaq, and some things are actually happening faster in side by side speed tests.

I even used the Raspberry Pi 3B and OpenShot to add 3 mp3 files and some effects to an AVI video, then convert it to an mp4.  It took 12 minutes to process a 3.5 minute video.  Not much different from the AMD desktop.  However, with only 1GB RAM and no swap file, I can't see myself using the Pi for too many really big video editing jobs.  It was just interesting to time it compare with my 4yo desktop computer that I use for the same work.

We browsing is much faster on the Raspberry Pi 3 than on the Desktop computer, bu that is the result of using kweb as the browser on the Pi.  kweb also streams YouTube video smoothly, where the AMD desktop computer is always stopping and starting the video stream.

On the desktop I have to download a YouTube video and watch it in a media player.  On the Raspberry Pi I simply open YouTube in kweb, and watch it on a 50 inch TV.  The Raspberry Pi 3B has to be the cheapest way ever to get a really smart, smart TV!