P1 3.5″ Touchscreen

This is just my notes on getting this up and running. I’d purchased a 3.2″ touchscreen to work with a Pi used on a project. However they supplied a precopiled ISO image rather than drivers and instructions so this is my notes from taking it apart to work with my own image. First up, get a keyboard on it and open a terminal (this is horrid with such little screen real estate)

sudo apt-get install xrdp

Will get the RDC server onto it then you can use remote desktop to get in there, much nicer and easier to use. user is pi and password raspberry (the defaults)

First going after config.txt, it seems there is nothing in there, how annoying.

cmdline.txt does seem to have some extra bits :

fbcon=map:1 fbcon=font:PrFont6x11

This looks like its worth investigating. This seems to be passing info to the FBTFT driver, there’s  some info here. This also identifies this as the BCM2708 SPI Display controller and if you look at the docs that line is given as needing to be added. SO if we look through that driver info we should be able to find where the display is setup…

So we now need to look at /etc/modules. We might even find the touch driver in here too…

This file is VERY different to the stock file. The first, obvious changes are that SPI and I2c are enabled, I’d imagine the corresponding blacklist options have been removed too. Now we have lines for FBTFT, FLEXTFT and ADS7846_device all of which are part of the above site. This is handy as it means likeley all you need is here. In theory as the modules have been merged into the main tree you *should* have these already.

So the lines we need seem to be:

fbtft_device name=flexfb gpios=dc:22,reset:27 speed=48000000

flexfb width=320 height=240 buswidth=8 init=-1,0xCB,0x39,0x2C,0x00,0x34,0x02,-1,0xCF,0x00,0XC1,0X30,-1,0xE8,0x85,0x00,0x78,-1,0xEA,0x00,0x00,-1,0xED,0x64,0x03,0X12,0X81,-1,0xF7,0x20,-1,0xC0,0x23,-1,0xC1,0x10,-1,0xC5,0x3e,0x28,-1,0xC7,0x86,-1,0×36,0x28,-1,0x3A,0x55,-1,0xB1,0x00,0x18,-1,0xB6,0x08,0x82,0x27,-1,0xF2,0x00,-1,0×26,0x01,-1,0xE0,0x0F,0x31,0x2B,0x0C,0x0E,0x08,0x4E,0xF1,0x37,0x07,0x10,0x03,0x0E,0x09,0x00,-1,0XE1,0x00,0x0E,0x14,0x03,0x11,0x07,0x31,0xC1,0x48,0x08,0x0F,0x0C,0x31,0x36,0x0F,-1,0×11,-2,120,-1,0×29,-1,0x2c,-3

ads7846_device model=7846 cs=1 gpio_pendown=17  speed=1000000 keep_vref_on=1 swap_xy=0 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900

Thats quite a mouthful so there is a copy of the working modules file. Check it against yours and copy and paste whats needed in rather than do this all by hand. If you are going to edit this on a Windows machine please use notepad++ as it’ll save you a lot of pain.

Interestingly it looks like there are dfeined setup modes for other displays here such as the Adafruit one which makes adding things way easier. It may be worth looking into this as looks way easier than the above mess.

Next up we need to chek inittab…

Interestingly they havent made any changes here. This should mean that the pi’s main console is still intact. I dont have anything on my desk to plu into right now so I cant verif this but it does leave a way into the system is something breaks. There is a reccomended line but it does look like it would disable the main console. Now the quesion is, where is whatever is running on that screen coming from? The other place would be rc.local and its not from there. The next step now is to make these changes on the dev system and see what happens.

Getting X running isnt too hard now. You’ll need to move the fbturbo framebuffer somewhere else. If you dont X will just bomb out with no screens found.

mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf ~

This will drop it into your home dir. You’ll want this to re-enable it later.

export FRAMEBUFFER=/dev/fb1 startx

*should* now get you an x-session. Have fin with that touch screen as its probobly way out of whack 🙂 CTRL+C and come out.

mkdir /etc/X11/xorg.conf.d

My stock Raspbian didnt have this directory, the updated did so you might not need to do this. In there create 99-calibration.conf and put the following in there…

Section “InputClass”
Identifier      “calibration”
MatchProduct    “ADS7846 Touchscreen”
Option  “Calibration”   “215 3735 3938 370”
Option  “SwapAxes”      “1”

save and then try to start X again. With any luck you should have a working touchscreen. Note that while this is all pretty similar to the Adafruit unit it’s different enough that if you use their walkthrough it wont work.


The PC Market, Going forward in 2015

I was asked earlier where I thought things were going with the home PC market. With the announcement of free Windows 10 Upgrades for many it’s obvious that now even the big players think things are about to change so heres my thoughts. Jump in and belt up…


At Home:

The landscape of home computing has changed in the last couple of years and still is changing. Cheap, powerful portable devices are becoming ubiquitous and are replacing the humble PC and Laptop and this is changing everything. Desktop sales to domestic users have been slowing down quite substantially for a number of years, this isnt news, most sales now tend to be to people that dont want the hardware lock in of a laptop. This really means Gamers, Tinkerers and those with specific needs for a tower, most home users are now on laptops.

Smartphones and tablets are increasingly replacing these laptops in day to day use. Why fire up a laptop when you already have a booted phone, these devices are getting more and more powerful and integrated with other aspects of our lives and are starting to push the laptops out now as well. Web browsing, doing email and online banking is pretty much it for a lot of the machines I support and all but the most basic tablets can cope with this

On top of this its all gettting cheaper. I was asked about repairing a £90 tablet the other day, after hunting the parts were found at £55 and then as the thing is glued together, I need to allow for a good hour of work. At this point its not worth doing so in the bin it goes. With laptops falling rapidly (I didnt say GOOD laptops) we are heading into disposable territory and to be honest the design of the newermachines dont lend themselves to repair anyhow as we are returning to the days of proprietory non-upgradable hardware which is somewhat ironic.

So where is this going? Well for the dozens of small PC vendors around its not good. The box shifters are doomed as they stand. Of the 4 PC vendors in my imediate area I dont expect any to survive based on the above. All 4 will find themselves fighting harder and harder for a smaller market share and with exclusivity deals gong on with the big players for tablet hardware and phones its not looking great.

But there’s still Repairs right?
For now, however we’ve seen this happen before. Rewind to the 80s and 90s. A TV or VCR was a costly investment back then and a very healthy economy existed of repair shops, authorised dealers and A/V shops (This i where I started out). As the trend for cost reduction kicked into gear at the end of the 90s and start of 2000, these items started to get cheap. All of a sudden it wasnt worth spending £100s on having your VCR cleaned of the jam sarnies your sprog had fed it and the second genearation tech was already on notice of obsolecence anyway. In the space of just a few years almost all of these shops vanished, those left hanging on for dear life fighting over the few loyal customers that remained. Then, about 5 years later prices crashed to the stage we are at now where that loveley 42″ screen you are sat in front of and that cost you £400 actually needs a £600 panel if you break it, its not worth it and most electronics goes in the bin. PC’s are going this way now.  Take something like the godawful HP Stream thats all over the TV. You can get this thing for £179, for whats in there thats impressive. Now, you buy one for Billy and as children do, he breaks it. SO in you come and you are informed that the screen will be about £45/50 and the labour about the same again (thats actually a pretty cheap price) and hang on, thats the 50% rule broken and you may as well replace it. Your insurance co wont repair it and god knows what else he’s done to it.  So you see, we are well on our way already. Once this reaches its logical conclusion there wont be much point in doing the tablet repairs either, to make this all viable as a business you’d have to do so many at such a low cost you’d end up making pence at a time and would have to run so close to overload its just not worth it.

From the domestic point of view I think our days as small PC vendors to home users are numbered, maybe not in 2015, but soon.


This is a slightly better story. In short things arent going to change here that quickly. Businesses like continuity and often spend a lot of money on keeping this so. Business desktop sales are actually picking up as are server sales but its sadly not all good news.

Businesses are looking increasingly to save more money and IT always takes the hit, and in this case its set itself up for it. With increasing convergence of technologies that were once totally seperate such as telephony, paper filing etc, simply dropping a server in and going home isnt going to cut it anymore. Businesses are looking more and more at tying everything together and it seems that among the SME IT vendors the skills to do so arent commonplace and contracts are being lost because of this. It used to be that if you didnt know how to do something you’d be able to find a way round it or as was done by some businesses, simply say its too expensive or cant be done, this didn’t wash at the time and certainly wont now.

Many businesses are now whole heartedly embracing technologies such as cloud computing, roaming profiles, metwork storage in way they wern’t a few years ago. The knock on from this is that the desktop machine is becomming more and more of a thin client, now for some of you this will be familiar. A lot of people went down this route early 90s and before in the shape of X-Terminals. Although they worked, the PC’s overtook them pretty quickly although this didnt stop Larry Ellison for Oracle saying we’d all be using thin clients in the future. He took a lot of flack for that, and it turns out, he was probobly right. With the massive increase in computing power and network performance over when we first went this route its almost becoming a given. A PC in an enterprise network will probobly log into a domain, it’ll do nothing more taxing than office or web browsing in most cases and it’ll be working with al its files and user data stored on a server. This is nice from a support point of view and backup point of view and to be honest there arent many good reasons for it to be done another way. The upshot is, all thats doing any work is the processor, and if we virtualise that machine you can have a slice of a much more powerful CPU on a server. and thats where we are headed. This is bad news for the PC because of the current crop of thin clients, only a handful could be called PC’s and the rest are normally ARM or MIPS based, closer to the Tablets and Smart TV’s than a PC. When a thin client goes, you throw it out. Theres no software to toubleshoot just the hardware.


So where does this leave us, well lets draw some conclusions:

The PC landscape is changing, this change is acceleration and will drive the demise of the PC as we know it now, this *is* happening now and would almost certainly form part of Microsoft’s decision on Windows 10. PC Desktops have the same fate as our friend above, he’s dodged the bullet, but it’s still going to get him. Laptops wont be far behind. Its worth noting though that the main opposition to PC’s in the form of Tablets and the ARM ecosystem offers nothing that can displace the hardcore games, though it is coming. Ultimately Win10 will continue the march towards SAS or Software as a service and for that goal to be acheived Microsoft need to break the connection between Windows and the PC

In business the change is still there but its slower, there is always going to be some requrement for that little bit more power than a thin client offers and PCs will hold on there for a while. The amount of investment will draw out the death of the business PC a little longer BUT bear in mind I can pick out all of my larger corporate customers and have them on thin clients without any apreciable loss of productivity in a few days, the change may be faster than in the domestic market.

Its interesting to note that there has been little technical drive from intel of late, most changes have been incremental, the same could be said of AMD, almost as if Chipzilla and AMD are in a holding pattern. AMD seem to be hedging their bets, not only are they headed down ther APU route and the tight coupling of GPU and CPU lends itself quite well to a change of CPU core but they are also ouring a lot of money and development into seriously fast ARM chips: http://www.amd.com/en-us/press-releases/Pages/64-bit-developer-kit-2014jul30.aspx There is also very little speculation or indeed any information on what Windows may become after 10 or indeed if there will be anything, the money maker here now is Office, MS made that abundantly clear.

So, the box shifters that are still out there need to shape up and change focs, be aware that the golden goose is about to buy the farm. Its time to lead and innovate and find better ways to engage and serve your customers. With lock in deals with larger ventors the playing field isnt very friendly so now more than ever you need to make yourself stand out and move away from relying on PC sales and repair as a core business activity. Find a niche or at the very least plan an exit strategy.

I’m not saying that the sky is falling here, we all know it is going to and its going to soon. I’m saying start planning and be ready.



Learning Curve, well right angle…

I’m working on a tracker system for a customer. Now my C++ isnt that good and my ARM assembler isnt up to somthing quite so heavy (Its not JUST a tracker) so I looked at other platforms to use.

In the end I’ve settled on the Pi, not least because its not a huge stretch to do what I need to to in the basic programming tools available.  I need to open two serial ports, fire up PPPD and then do some rudimentary data processing and split one of the serial ports.

After some fiddling PPPD behaves and the pi can connect to the Internet on its own over GSM. Non trivial but PPPD is an old foe and it was beaten into submission. The hardware was built and tested and the whole thing mounted up on a plate ready for some serious dev work…

During the tinkering I found out that there was a working Pascal compiler, I know Pascal, I know it VERY well and can do a lot with it, then I found the Delphi like IDE, Lazarus. In a few mins I was away. Turns out the repository versions are very old, cue having to download and compile from scratch.

This didnt go entirely well and took 8 hours and many false starts but in the end I got there, more faffing and I have an x86 dev box that actually compiles in under a week.

A fight then ensued to get workign serial port access and I *think* I’ve done that so now I have the unit talking to the GPS already.

Asynchronus TCP… Thats taking longer…

This does open the way to a lot of porting of my apps over to Linux, something I have been wanting to do for a while. It also opens up a serious number of possibilities with Pi and Beaglebone for us. So many projects opened up.