Planet Linux-to-go

January 27, 2012

Richard 'RP' Purdie

Tarmac takes getting used to again

Due to the various building works last year, the 675 was laid up off the road. I had planned to wait until spring to get it MOT’d (safety checked) and get it back on the road. With the mild weather there is not time like the present though.

After riding the CRM/YZ for the past months, getting back on a true road bike was very very odd. The amount the bars moved for slow speed manouvering was scary, the brakes seemed weak (but aren’t), the throttle rather responsive, the clutch immediate and the raw accelation, grin worthy.

I did manage to remember how to ride it, the battery worked, the engine management didn’t light up like a christmas tree and it gained an MOT. Triumph did a beautiful piece of engineering with that bike and I remember why I own it. We need some better weather but its ready and waiting :) .

by Richard at January 27, 2012 06:03 PM

January 26, 2012

Cliff 'cbrake' Brake

The easy way to get serial terminal in Linux

When doing embedded Linux development, most of us spend out time tethered to a target system with a serial cable, which is used for a serial console.  Minicom is the defacto serial terminal software for Linux.  However, Minicom is a little fussy in that you typically have to set it up for each port you want to use.  This is no big deal, but is generally difficult for new users to understand, and yet another hurdle.  And with 8-port USB->serial adapters, I have a lot of ports to set up.

Just recently, I discovered that screen can be used as a serial terminal program:

screen /dev/ttyUSB0 115200

A few notes on using:

  • to exit screen: Ctrl-a k
  • to write a hardcopy of the screen image: Ctrl-a h
  • to get help: Ctrl-?

All the neat features of screen are two numerous to list here, but one more that I’ll point out is the scrollback/copy feature (activated by Ctrl-a [ ).  This allows you to scroll back and the navigation works much like VI — what could be nicer?

by Cliff Brake at January 26, 2012 07:24 PM

January 25, 2012

Koen Kooi

Fixing I²C timeouts during boot on the beaglebone

The beaglebone kernel was timing out on I²C bus 2 when no cape is attached. This was traced back to missing pullups on the 2 I²C lines. Looking at the source:

"uart1_ctsn.i2c2_sda",    OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW \
 | AM33XX_PULL_ENBL | AM33XX_INPUT_EN

That seems to enable pullups, let's check on the device itself:

root@beaglebone:~# devmem2 0x44e10978
devmem2 0x44e10978
/dev/mem opened.
Memory mapped at address 0x40313000.
Read at address  0x44E10978 (0x40313978): 0x00000063

The magic decoder ring gives us the following:

bit 7 6 5 4 3 2 1 0
function Reserved Slewrate Receiver enable Pull up/down Pull disable mode
value 0 1 1 0 0 0 1 1

No pullups enabled, but pulldowns! Let's change the kernel to make it try a bit harder to enable pullups:

"uart1_ctsn.i2c2_sda",    OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW \
 | AM33XX_PIN_INPUT_PULLUP},

The timeouts seem to be gone, let's double check:

root@beaglebone:~# devmem2 0x44e10978
devmem2 0x44e10978
/dev/mem opened.
Memory mapped at address 0x40313000.
Read at address  0x44E10978 (0x40313978): 0x00000073
bit 7 6 5 4 3 2 1 0
function Reserved Slewrate Receiver enable Pull up/down Pull disable mode
value 0 1 1 1 0 0 1 1

Success!

by koen at January 25, 2012 12:08 PM

January 18, 2012

Paul 'pfalcon' Sokolovsky

Notes on Android EGL/native windowing system interface

EGL is defined here and appears to be in OpenGL ES something what GLUT was (?) in OpenGL world. At least, EGL is what takes care of actually displaying on screen what was rendered by OpenGL ES.

Donut

EGLNativeWindowType is defined in opengl/include/EGL/eglplatform.h as struct egl_native_window_t* . egl_native_window_t is defined nearby in opengl/include/EGL/eglnatives.h . This is nice, clean, standalone structure (unlike horror in Eclair+). It starts with a "magic" (signature) 0x600913, followed by "version" which is sizeof of the structure (now I know why Microsoft gets a buck on each Android phone sold - they for sure patented this (stupid? lazy?) trick widely used in Win32 API). There're some function pointers (virtual method table) used by EGL to call into native windowing system (deep, close to vendor drivers) to support its workings. Out of these, there's essentially one related to rendering finalization: swapBuffers(). So yes, it seems that eglSwapBuffers() just calls out to this. The structure also directly contains "Base memory virtual address of the surface in the CPU side" and other easily graspable memory/graphics notions.

It's clear that in its young years, Android was fair and naive, not suitable at all for typical vendor OpenGL mumbo-jumbo. The "fix" came with the later versions.

Eclair and following

EGLNativeWindowType is defined (in include/EGL/eglplatform.h) to be struct ANativeWindow*. ANativeWindow was android_native_window_t in Eclair, but was renamed to ANativeWindow in Froyo (android_native_window_t is still available for compatibility). ANativeWindow is defined in platform/frameworks/base/include/ui/egl/android_natives.h:
ANativeWindow not just emulates VMT, but seems to want to do entire C++ in C-like manner in its metes and bounds. It uses subclassing from android_native_base_t, and that contains fields for magic ("_wnd" for ANativeWindow) and version-sizeof. Methods defined are also more involved. Among the most interesting are dequeueBuffer(), lockBuffer(), queueBuffer(). Essentially, it appears that EGL takes a free buffer out of native system's rotation, locks it for changing its contents, then puts back into queue for display.

Actual implementation of ANativeWindow for read device screen is in libs/ui/FramebufferNativeWindow.cpp . There's factory function to get its instance: android_createDisplaySurface().

All implementation details on buffers used are hidden in android_native_buffer_t type. It is also subclassed from android_native_base_t, its magic is "_bfr". Among simple things like width/height it contains buffer_handle_t, which leads in utero of vendor graphics driver. buffer_handle_t is native_handle*, and native_handle is a generic container for arbitrary number of fd's and pointers.

native_handle's are produced by gralloc vendor module, and that's exactly what FramebufferNativeWindow constructor does - it loads gralloc module, then uses it to open framebuffer and gralloc devices. It then allocates back and front buffers from gralloc devices with the size of the framebuffer. queueBuffer() method is implemented by calling framebuffer's post() method which well, shows the buffer on the screen.

by pfalcon (noreply@blogger.com) at January 18, 2012 01:00 AM

January 17, 2012

Paul 'pfalcon' Sokolovsky

Thoughts/notes on Android version upgrades and reusing Android drivers

So, what it takes to upgrade Android on an arbitrary Android device (from user perspective)? What takes to run Linux in full-fledged mode? This boils down to few things:

Kernel porting

Upgrade kernel. This means forward-porting hardware support modules to a new kernel version. That's, when source code for such modules is available. Sometimes, it's not violating GPL (or tainting kernel, but who wants that? ;-) ). In an ideal world, that would all that's needed, but vendors don't like GPL, and try to move stuff outside of kernel. So, the list continues.



Bitblt acceleration porting

Next step is making sure that basic hardware acceleration works - accelerated bitblt/compositing (defining compositing as bitblt with alpha). This is actually pretty important step - without accelerated bitblt, Android with more or less big screen will run pretty sluggishly. Well, X Windows won't run too zippy either. Bitblt code in Android lives in /system/lib/hw/copybit.*.so  and depends on gralloc.*.so from the same dir (* there is vendor/implementation identifier - Android support multiple, pluggable implementations). Needless to say, for a random device, source for these modules are not available - vendors don't have to provide it, it's Apache2-licensed, and very few choose to uphold OpenSource spirit nonetheless. So, if new Android version have changes the ABI for those modules, then oops - upgrade is "not possible" is layman terms. Of course, real men will immediately think about writing adapters, etc...

What about other X and other "foreign" windowing systems? They would need drivers/adapters too, and base all their low-level FB access based on Android's gralloc/bitblt/etc. model.

OpenGL ES porting

Last, least, but nonetheless. Curse of the modern world - OpenGL. You didn't have it on your Apple 2 (I mean Apple 2, yes, not what you thought about!) and everything was great, wasn't it? Apart from games you don't have time to play, what it's useful for? Yes, as soon as we'll stream videosignal directly into the brain, it will be useful for augmented reality, but I mean, *useful now*. They keep talking they added some hardware acceleration using OpenGL to the normal UI, then immediately say it didn't work that great, and depends on many things, because... Because OpenGL simply doesn't work that great, yeah. For example, even "accelerated", it's pretty slow, buggy, inconsistent across devices, etc, etc.

Anyway, thanks for listening to the rant. Let's de-emphasize usefulness of OpenGL, let's just take it as a challenge - vendors hacked it, so why can't hackers hack it? The basic idea is the same as with bitblt - there's an interface between closed vendor OpenGL ES implementation and Android. If interface changed, you're hosed. I mean, you write adapters. You also write adapters to make it talk with your windowing system of choice, and not Android. The core interfacing part of OpenGL ES/Android junction is EGL. How to deal about it is worth a separate post.

by pfalcon (noreply@blogger.com) at January 17, 2012 06:40 PM

New Hack Toy - Zenithink ZT-180

Recently I got new hack toy: cheap (well, depends) Chinese Zenithink ZT-180 tablet. This one seem to be (have been) pretty popular and hacker-friendly. Here's data about it:

It seems that I've got vendor model ZT180_G2 (maybe, ZT180_G0).

Button combinations to hold during power on:
  • Home+Power - Upgrade firmware from /sdcard/zt-update/
  • Left arrow (of swing double-button)+Power - Boot with debug kernel from /sdcard/zt-debug/ . Debug kernel is booted and continues with the normal boot process.
  • Right arrow (of swing double-button)+Power - Multiboot support, select one of 3 modes:
    • Android adb - kernel with ADB over USB support
    • Android mass storage - kernel with mass storage USB gadget support (tablet is presented as a mass storage when connected to host)
    • Other OS - WinCE

Random links:
  • http://www.slatedroid.com/topic/10233-zenithink-zt-180-cpu-actually-infotmic-imap210-cpu/
  • http://www.androidtablets.net/forum/infotmic-based/2354-infotmic-chips.html

by pfalcon (noreply@blogger.com) at January 17, 2012 05:16 PM

January 16, 2012

Paul 'pfalcon' Sokolovsky

Stopping Android GUI services

Well, this really worth a cross-post. The way to stop Android GUI services is (under root of course):

setprop ctl.stop zygote

UPDATE: Thanks to hint from StackOverflow: there're even simpler commands: "start" & "stop". Surprise.

by pfalcon (noreply@blogger.com) at January 16, 2012 11:32 PM

January 15, 2012

Koen Kooi

Using 1-wire on a beaglebone

w1-gpio on a beaglebone

The dedicated AM335x HDQ pin(s) aren't exposed on the beaglebone header, but there are enough GPIOs available to emulate one with the w1-gpio driver in linux. I connected a DS18B20+ to the beaglebone as shown in the picture above.
After patching the kernel and booting the update uImage:

root@beagleboneA3-0457:~# dmesg | grep w1
[    0.208956] w1-gpio connected to P8_3
root@beagleboneA3-0457:~# cat /sys/bus/w1/devices/28-00000256073a/w1_slave
b8 01 4b 46 7f ff 08 10 8a : crc=8a YES
b8 01 4b 46 7f ff 08 10 8a t=27500

With a friendlier output:

root@beagleboneA3-0457:~# cat /sys/bus/w1/devices/28-00000256073a/w1_slave | tail -n1 | awk -F= '{print $2/1000 " degrees Celsius"}'
27.687 degrees Celsius

The final tweak is to use some jumper wires to prevent the beaglebone from heating up the sensor:

root@beagleboneA3-0457:~# cat /sys/bus/w1/devices/28-00000256073a/w1_slave | tail -n1 | awk -F= '{print $2/1000 " degrees Celsius"}'
19.125 degrees Celsius

w1 patch

by koen at January 15, 2012 12:20 PM

January 13, 2012

Marcin 'Hrw' Juszkiewicz

Want to buy Android tablet (again)

During my trip to Linaro Connect 2012q1 I want to buy Android tablet for myself. But this time I decided to spend more time on choosing one to not end with crap like Hannspree Hannspad which I bought half year ago.

Also situation on market changed. There are cheap tablets worth checking but there are also cheap crappy ones. So let me list what I checked so far.

Kindle FireNook TabletArchos 80 G9 ClassicArchos 80 G9 Turbo
price (USD)199249259299
RAM size512MB1GB512MB1GB 1
resolution1024×6001024×6001024×7681024×768
screen size7″7″8″8″
internal storage8GB16GB 28GB16GB
external storagenonemicroSDmicroSDmicroSD
CPUOMAP4430 1GHzOMAP4430 1GHzOMAP4430 1GHzOMAP4460 1.5GHz 3
stock Android version2.3 customized2.3 customized3.2 (4.0 in February)3.2 (4.0 in February)
community Android version4.04.0not checkednot checked
locked bootloadernoyes (hacked)nono
USB Hostnonoyesyes
HDMI outputnonoyesyes

As you see my requirements are more or less simple:

  • dual core cpu (arm7)
  • 512MB ram (1GB preferred)
  • 1024×600 (or higher) resolution
  • 7-8″ screen size (I had 10″ and it was too big)
  • price below 300USD

During CES many vendors presented new tablets but I think that most of them will be released in Q2 or later. ASUS MeMo 370T looks nice for 250USD but it is not on market.

And I do not want 3G module in tablet — my phone has over 10GB of data limit to use for next months and so far I was not able to consume 1GB per month :)

Have I missed some devices? If yes then please share information in comments. Just remember that I do not want any of those NotionAdam/Viewsonic/Hannspad ones.


  1. 512MB in older model 

  2. 13GB /data/ so it is hard to put own data over USB 

  3. OMAP4430 1.2GHz in older model 


All rights reserved © Marcin Juszkiewicz
Want to buy Android tablet (again) was originally posted on Marcin Juszkiewicz website

by Marcin Juszkiewicz at January 13, 2012 01:34 PM

Richard 'RP' Purdie

Ice, snow, hills, mud and new territory

Last Monday with it being a bank holiday I was invited out for a trip to the other side of Alston, starting from Allendale. I’ve wanted to ride the lanes over there for a while and this was my opportunity. I didn’t fancy setting off early in the morning in the dark and trying to find fuel in Allendale so I took the bike in the van to the starting point. On the way, I found the conditions were getting colder the further inland I went and approaching Allendale, there was one junction where it was gently snowing with snow lying on the ungritted sections of road.

I managed to get there on time and eventually everyone was ready to set off. Everyone left apart from me and one other, I was playing my tail gunner role since I had a copy of the route. It was quickly clear we wouldn’t be going anywhere whilst Stewie’s chain was lying on the ground. Stewie has a reputation for breaking chains but not getting away from the van is a new record. Eventually the others noticed we weren’t there and came back and we managed to get the chain repaired. We were off, really this time.

I have a reputation of not doing so well on ice covered tarmac so I’d decided I was going to take things very carefully. I was on the YZ which isn’t really the ideal bike for those kind of conditions having too much power and totally knackered tyres (a dead mousse distorting the front and no tread on the back comparatively speaking). Sure enough as soon as we’d done the first lane we were onto ungritted country roads covered in a thin layer of sheet (black) ice. There was one nasty off camber T junction covered in ice which I did not enjoy at all. Coming around a corner I then found a piece of road with a couple of tight turns over a bridge, all covered in ice. This would have been bad enough (but manageable) but one of the group was lying in the road, as was his bike. Thankfully I wasn’t carrying much speed but even then there wasn’t any chance of stopping on the ice, or steering around the obstacles. At this point it helps to remember the kind of vehicle and its capabilities. I quickly concluded my only chance was to ride onto the 12″ strip of verge between the road and the wall and whilst that was covered in snow and heavily banked and undulating, chances were I would have enough traction to stop. Thankfully this proved correct. Ben got himself and the bike upright and we set off again. At this point I went past a couple of the group stopped halfway up a hill. There was too much ice around for me to fancy stopping too. I spent the next couple of miles of tarmac going slowly wondering where they were but they caught me up just as we found the rest of the group.

At this point I realised we were approaching Alston and were onto some trails I know. I only ever seem to see these ones in winter when they’re covered in ice and they’re heavily rutted making riding an interesting challenge. Rather than head into Alston, we bypassed it and did an interesting piece of trail which included a steep uphill section. Unfortunately one of the group was stopped half way up which meant everyone else had to stop. That person decided not to attempt the near vertical climb at the top and let someone else take the bike back down and take it at speed. I decided to just attempt it from stationary at the half way point which proved tricky and resulted in stalling the bike multiple times. The rear tyre’s condition wasn’t helping as it was just slipping. I was wary as the exit was onto a road with a parked car in the path if you applied too much speed/power. The first attempt ended up with the front wheel up, only to have the bike slide backwards back down it with me unable to grab the back brake, only keep the front locked solid which isn’t a fun experience. I made it on the second attempt.

After the next trail, the group had disappeared. My GPS appeared to indicate the route was left so I followed it, only to realise I was heading in the wrong direction and the tracks were confused on the map. I turned around and found two group members looking for me. One U turned and headed back the way they’d come, the other continued past me. I sat in the middle and wondered what the heck I was supposed to do! We go that sorted out and found the rest of the group but I missed out on one of the trails. We then arrived in Alston and refueled. We were still on trails I’d done before but not for a long time. We wound our way up to Hartside Cafe, beyond which I’ve never ventured on green lanes. On road bikes, this marks the point the entrance to the Lake District and I’ve been there many times on tarmac though. We started down some very interesting lanes. There were a lot of muddy ruts and I was having a lot of difficulty keeping the YZ going in a straight line at any kind of speed.

We came across a group of horse riders (on tarmac) and slowly followed for a while until they pulled over onto some grass at a junction. The rest of the group went through but I was slightly behind having had trouble restarting the bike after stopping. As I approached and was about to pass, going slowly since I know how tricky these situations are, one of the horses reared up and set off down the road. I came to an instant stop despite the ice patches and waited as the rider controlled it and brought it back to the grass. At this point the horses were clearly getting nervous and it was spreading between them but I was able to carefully but quickly get off up the road past them, hopefully allowing the situation to diffuse. I can see these issues from both sides and I hope the horses/riders weren’t too upset.

Next up was a road with a sign about a ford being washed out and impassible. To us this was interesting, we’ll see. Upon arrival, it was clear there was a *lot* of fast moving water going through the core channel and it had been roped off with warning tape. We couldn’t see any indication of depth and some of the group thought it was possible but I was of the opinion it was too deep/fast and after some discussion we reached that consensus. It’d be interesting to see it in summer.

Periodically, Ben’s bike was cutting out, likely due to the cold and some form of carb icing type effect. It was frustrating as he’d have to sit for a while, then the bike would work just fine again. It was also proving a pain to kick start. I can sympathise with this after experiencing how draining kick starting the CRM was when I first started. At one point he’d dropped it in the mud and couldn’t get it started and was obviously worn out so I gave it a go whilst he recovered a bit. It started first kick, I know how annoying it is for someone to do that :/.

At the end of one lane, we had a bit of confusion over the exact route to take with it turning out to be a drop down a hill, over a tiny stream, then through a much deeper ford crossing. On the drop, I managed to get a large tree branch stuck between the mud guard and the front wheel for which I had to stop and disentanhgle it. This isn’t simple on a steep slope but I eventually managed. I only saw the last member of the group going through the ford but it was clear Ben had fallen in. I was given several pieces of conflicting advice about the best route over including mention of a large piece of old road which may or may not be in certain bits of the river but wasn’t visible from where I was on the other side. Great. I set off through and about half way, it was clear I was riding on a piece of flat slab (old roadway?). So far so good but they’d said there was a problem? Sure enough, all of a sudden it became cracked, pointing upwards and then stopped with a deep drop (1ft+) off the end. At this point I accelerated a little and attempted a small jump off the end, as best as is possible off a slime covered piece of rock in water. Thankfully the bike then landed upright in the properly deep water with both wheels and I could quickly power out the river. Apparently Ben had attempted something similar but had lost balance coming off the slab, needed to put a foot down and slipped off. Far too easily done. We emptied out the drowned bike, then towed it to get it started.

We then had to stop in a village and wait whilst once again Stewie had to repair his chain. By this point we were running well behind schedule due to the stoppages and general slow progress made. There were some lovely relatively unused lanes we passed through. One memorable moment was coming to a shear decent, probably only a couple of metres in height which took some nerve to plunge the bike over. Again I was cursing the condition of the tyres on the muddy bits and couldn’t carry any speed.

By this point time was against us as it was going to be getting dark. There certainly wasn’t time for a lunch stop and we pressed on. We winded over the A686 (heads to Alston) taking some interesting lanes although I was still fighting tyres and going slowly. We then went up a trail that leads to hardside cafe which I’ve heard of but never done. I think I made the biggest hash of it I’d made all day, being unable to get traction anywhere even vaguely muddy. I ended up stalling and having to drop the bike into ruts to find stone to get momentum up the hillside. There is a steep climb at the side of the trail here and one group member did attempt it but only got halfway. The trouble then is getting back down safely. I decided not to bother given my experiences so far that day (and experiences of steep climbs going wrong on other occasions).

We then headed over to Garrigill at which point I hit reserve fuel (eek!). I did warn the rest of the group and thought Alston for a top up might be wise but Steve thought we’d make it back ok (he and another group member hit reserve too). We took the road over the top to Nenthead. I know this road well for various reasons and know that if there will be snow/ice anywhere, its on this road (17th highest road in Great Britain). Sure enough the whole thing was sheet ice. Making it the hill was bad enough. Once at the top, you then have the problem of getting down the other side. The only way I could do it was on the verge, being very mindful of the deep holes and drop offs (up to 6ft) in the verge. I was surprised to make it down there without some kind of incident, I was going very slowly/carefully. Apparently Steve did drop his bike at one point (I didn’t for a change!).

There was one more lane and then it was tarmac back to Allendale. At this point I ran out of fuel entirely. Thankfully Paul came back to look for me when I disappeared and using a water bottle, I was able to share some of his fuel, enough to get me back to the van. Meanwhile, Stewie had also run out and was towed the last couple of miles.

Despite the issues, it was a great day out, one of the days I’ll look back on with fond memories. I really enjoyed it and look forward to exploring more trails in that area when there is a bit more daylight.

by Richard at January 13, 2012 12:38 PM

Crazy Insurance People

“We are unable to quote for house insurance since our records show you are within 50m of water and are at risk of flooding”.

Well, yes I am within 50m of water. Its called the North Sea, its clearly visible out of all my front windows. What isn’t being accounted for are the sea defenses, a lower and upper promenade and a road between me and it, not to mention the cliffs. A hint about the height of the cliffs is the “High Point Hotel” just up the street which oddly enough is built on “High Point”.

Not quoting based on the risk of coastal erosion I could understand (although with the sea defenses here its extremely unlikely and they’d protect the road) but flooding?! I guess its possible bits of Norway might fall into the sea and cause a tsunami but thats about what it would take…

by Richard at January 13, 2012 10:54 AM

January 10, 2012

Holger 'zecke' Freyther

QtMediaHub on MIPS with Qt5 and DirectFb

Ever since the start of the Qt project I am working on DirectFB in Qt5 (and Qt4) with the remote goal of getting QtMediaHub to run. It started with catching up with the rather nice refactoring of lighthouse in Qt5, fixing memory and resource leaks in Qt5, DirectFB and mostly in the DirectFB lighthouse plugin.

It moved to dealing with broken "make install", broken QML2 examples and documentation, figuring out how to get patches for QtV8/V8 into the project, adding MIPS code for the Qml mode (a new global object), global compare for MIPS and finally working on OpenGL integration for QML2.

In this specific case I had an OpenGL ES 2.0 library coming from a vendor and created the 'directfbegl' plugin to use EGL to go from IDirectFBSurface to an eglSurface. I think in this specific case there is unified 2D and 3D buffer space which should allow a lot of cool stuff.

It mostly works, QML2 has some way to go to work on battery powered devices but it is looking quite nice.

by zecke (noreply@blogger.com) at January 10, 2012 01:10 PM

January 07, 2012

Paul 'pfalcon' Sokolovsky

Bluetooth Park Mode Exposed

So well, as I settled on Bluetooth as a wireless sensor/automation protocol and grow my device base, I started to wonder what will happen when I'll have more than 7 slave devices. Bluetooth stack of master device (Bluez in our case) must be smart to put devices into and out of PARK mode to allow to communicate with more than 7 devices, right? Not in this world.


Not only Bluez doesn't support park management, according to Marcel Holtmann, the problem is that it's really not known if there're devices (masters) which can support more than very limited number of slaves, or even have decent park mode implementation at all:
Anyway, I started to test parking with devices I have.

HC-04 Bluetooth module with CSR BlueCore4-Ext

# hcitool cc 00:11:10:xx:xx:xx; hcitool con
Connections:
    < ACL 00:11:10:xx:xx:xx handle 12 state 8 lm MASTER

What we need here is a connection handle 12 (0x0c). hcitool doesn't have dedicated command for part mode (and for lot of other things), so we'll use raw HCI command mode using "cmd" command:

# hcitool cmd --help
Usage:
    cmd <ogf> <ocf> [parameters]
Example:
    cmd 0x03 0x0013 0x41 0x42 0x43 0x44

What's important here is that <parameters> should be byte values. If words should be given as parameters, they should be give by bytes in little-endian format.

# hcitool cc 00:11:10:xx:xx:xx; hcitool cmd 0x02 0x05 0x0c 0 0x50 0 0x40 0

Here we run HCI_Park_State(Connection_Handle=0x000c, Beacon_Max_Interval=0x0050, Beacon_Min_Interval=0x0040) command (see Bluetooth spec). And here's communication as captured by hcidump (parts irrelevant to park command omitted):

2012-01-07 15:36:46.084074 < HCI Command: Park State (0x02|0x0005) plen 6
    handle 12 max 80 min 64
2012-01-07 15:36:46.086040 > HCI Event: Command Status (0x0f) plen 4
    Park State (0x02|0x0005) status 0x00 ncmd 1
2012-01-07 15:36:46.271047 > HCI Event: Mode Change (0x14) plen 6
    status 0x24 handle 12 mode 0x00 interval 0
    Error: LMP PDU Not Allowed

This "LMP PDU Not Allowed" was quite confusing and took me lot of googling to figure out. Fortunately, I found insightful post from a CSR guy right on this matter: http://article.gmane.org/gmane.linux.bluez.devel/72

What we get here is that local Bluetooth master just forwards status it got from the remote device. As the message suggests, park might be disabled in remote device line policy. Let's see:

# hcitool cc 00:11:10:xx:xx:xx; hcitool lp 00:11:10:xx:xx:xx
Link policy settings: RSWITCH HOLD SNIFF PARK

Here's slight issue of what hcitool lp actually does. According to man, it "displays link policy settings for the connection to the device with  Bluetooth  address". There's also "hcitool lp" command which "Sets default link policy". So, reasonable assumption would be that every device may have default link policy, then during connection, they negotiate link policy which is suitable for the connection. Ok, let's set PARK policy explicitly:

# hcitool cc 00:11:10:xx:xx:xx; hcitool lp 00:11:10:xx:xx:xx PARK; hcitool lp 00:11:10:xx:xx:xx; hcitool cmd 0x02 0x05 0x0c 0 0x50 0 0x40 0
Link policy settings: PARK
< HCI Command: ogf 0x02, ocf 0x0005, plen 6
  0C 00 50 00 40 00
> HCI Event: 0x0f plen 4
  00 01 05 08

But hcidump shows the the same "LMP PDU Not Allowed" error. So, what we have is that HC-04 module advertizes park support, it apparently negotiates its availability for connection, but when asked to actually perform it, it rejects it. This is so much correlates with this message: http://article.gmane.org/gmane.linux.bluez.user/12710

PS3 Bluetooth remote

# hcitool info 00:06:F5:xx:xx:xx
Requesting information ...
    BD Address:  00:06:F5:xx:xx:xx
    Device Name: BD Remote Control
    LMP Version: 2.0 (0x3) LMP Subversion: 0x229
    Manufacturer: Broadcom Corporation (15)
    Features: 0xbc 0x02 0x04 0x38 0x08 0x00 0x00 0x00
        <encryption> <slot offset> <timing accuracy> <role switch>
        <sniff mode> <RSSI> <power control> <enhanced iscan>
        <interlaced iscan> <interlaced pscan> <AFH cap. slave>

So, this fair Broadcom device doesn't even conceal the fact that it's barely Bluetooth interoperatable - it doesn't support park state at all.

No surprises when asking it to go there nontheless:

2012-01-07 16:03:08.863586 < HCI Command: Park State (0x02|0x0005) plen 6
    handle 13 max 80 min 64
2012-01-07 16:03:08.865636 > HCI Event: Command Status (0x0f) plen 4
    Park State (0x02|0x0005) status 0x1a ncmd 1
    Error: Unsupported Remote Feature / Unsupported LMP Feature

LG KS20 WindowsMobile phone

# hcitool info 00:1E:75:xx:xx:xx | grep park
        <park state> <RSSI> <channel quality> <SCO link> <HV2 packets>

So, this one advertizes park. But:

2012-01-07 16:29:11.288514 < HCI Command: Park State (0x02|0x0005) plen 6
    handle 12 max 80 min 64
2012-01-07 16:29:11.290485 > HCI Event: Command Status (0x0f) plen 4
    Park State (0x02|0x0005) status 0x00 ncmd 1
2012-01-07 16:29:11.466508 > HCI Event: Mode Change (0x14) plen 6
    status 0x0c handle 12 mode 0x00 interval 0
    Error: Command Disallowed

Broadcom is such Broadcom...

Huawei U8160 aka Vodafone 858 Smart Android phone
# hcitool info 04:C0:6F:xx:xx:xx | grep park
<empty>


2012-01-07 16:19:01.322536 < HCI Command: Park State (0x02|0x0005) plen 6
    handle 12 max 80 min 64
2012-01-07 16:19:01.324521 > HCI Event: Command Status (0x0f) plen 4
    Park State (0x02|0x0005) status 0x1a ncmd 1
    Error: Unsupported Remote Feature / Unsupported LMP Feature

Broadcom is such Broadcom...

HTC Mogul WindowsMobile phone

2012-01-07 16:11:14.184067 < HCI Command: Park State (0x02|0x0005) plen 6
    handle 12 max 80 min 64
2012-01-07 16:11:14.186430 > HCI Event: Command Status (0x0f) plen 4
    Park State (0x02|0x0005) status 0x00 ncmd 1
2012-01-07 16:11:14.528429 > HCI Event: Mode Change (0x14) plen 6
    status 0x00 handle 12 mode 0x03 interval 80
    Mode: Park

Bwahaha! TI rules!

Samsung i740 WindowsMobile phone

Manufacturer: Cambridge Silicon Radio (10)

2012-01-07 17:54:17.141466 < HCI Command: Park State (0x02|0x0005) plen 6
    handle 12 max 80 min 64
2012-01-07 17:54:17.142911 > HCI Event: Command Status (0x0f) plen 4
    Park State (0x02|0x0005) status 0x00 ncmd 1
2012-01-07 17:54:17.472919 > HCI Event: Mode Change (0x14) plen 6
    status 0x00 handle 12 mode 0x03 interval 80
    Mode: Park


Linux computer with Broadcom chip

Park mode work here, supervised by Bluez.


So, out of 7 devices (that's whole piconet, and I have more!)  only 3 supported park mode.


More insightful posts:

by pfalcon (noreply@blogger.com) at January 07, 2012 05:05 PM

Linux kernel Bluetooth ACL connection auto-disconnect

I finally found time to figure out why "hcitool cc" created connections die very soon (see previous posts). It turned out to be handled on the Linux kernel level. What's worse is that it's hardcoded at 2s - no provision for adjustment via sysfs for example. http://lxr.free-electrons.com/source/include/net/bluetooth/hci.h?v=3.0#L120 :

118 /* HCI timeouts */
119 #define HCI_CONNECT_TIMEOUT (40000) /* 40 seconds */
120 #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */
121 #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */
122 #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
123 #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
124 #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */

Actual disconnection happens in hci_conn_timeout(). Other issue is that such disconnect reported as "Remote User Terminated Connection", which is, well, not true, as I don't terminate it, the system does. There's another status code, "Remote Device Terminated Connection due to Low Resources" which IMHO more suitable (if there's no "low resources", why do you disconnect so quickly, dear Linux?).

I quickly made a patch to be able to adjust disconnect timeout via sysfs, to experiment with low level connection more comfortably. Unfortunately, it turns out that I can extend delay to max 10s, even if set value much higher. So, something appears to call disconnect routine, even though I don't see any other references or timer manipulation %).

by pfalcon (noreply@blogger.com) at January 07, 2012 01:14 PM

January 06, 2012

Florian Boor

Computer startup aid using a LEGO train

Some times it happens that I have to dig out some old piece of hardware and try to get it running again… I recently got a very geek present for my birthday – one that requires a working SGI Indigo next to it. Luckily nothing gets lost at kernel concepts and I was able to select from several Indigo gathering dust at the attic of our office. It looks like the machines survived quite some years not being used pretty well – including most of the harddisks. Unluckily all batteries which are supposed to supply the real-time clock chip were flat and these batteries are hard to get and soldered to the board. I did not have a replacement for the 3.6V Lithium battery but it was pretty easy to replace the battery with some cables to supply the board with 3.6V. The first thing to supply 3.6V I found was the electric LEGO locomotive the kids left lying around…

Indigo Lego Train

Indigo Lego Train

This one was powered by three 1.2V AA rechargeable batteries – perfect for some startup aid for this old machine. After applying power I was able to boot into IRIX 6.2 installed on this historic piece of hardware (100MHz MIPS R4000 CPU, 192MB of RAM, 2GB SCSI hard disk, ELAN graphics). I have to admit I somehow enjoyed the “time travel” experience playing around with such an old system for a while. Someone here still remembers the Netscape browser? Or Electropaint? One really scary experience was the network setup: IRIX 6.2 has the ability to configure a static IP through the GUI but obviously you have to edit the network startup script in order to set a default route on boot.

A lot more of information about these machines can be found here.


by Florian at January 06, 2012 06:31 PM

Nils Faerber

M$ to buy Nokia smartphone division? WTF!?

According to many news tickers, Slashdot amongst them:

http://mobile.slashdot.org/story/12/01/05/2325227/microsoft-in-talks-to-buy-nokias-smartphone-division

rumors spread that Microsoft is about to take over the whole smartphone business from Nokia and as nice cream tip, Elop might change back to Microsoft and lead that pack.

If I would be a Nokia share holder I would sue Elop personally for intentionally destroying Nokia's smartphone business in order to have it later on being taken over by Microsoft entirely.
Doesn't that seem like a good 'evil' plan by Microsoft?

read more

by nils at January 06, 2012 05:49 PM

Marcin 'Hrw' Juszkiewicz

Scythe Mugen 2 and socket 1155 mainboard

When I moved my home machine to i7-2600K I realized out that Scythe Mugen 2 cpu cooler which I was using lacks elements to mount it on socket 1555 motherboard.

I looked at shops and found out that I need SCCSMG2-1156 (Scythe Mugen 2 mounting kit for Socket 1156/1155) as I have quite old version of cooler (then there was Rev. B released with support for all socket types). But then problem started — no one in Poland had them…

So I contacted Scythe directly and later after spending 10€ I got mounting kit delivered at Xmas Eve. Took me some days to find time to mount it.

First attempt ended with lot of curses, angry email to Scythe and stock cooler mounted again.

But I decided to not give up. Did some extra research and found this YouTube video where I saw that I mounted bolt screws wrong…

So I did another try. This time it fitted perfectly and I can enjoy silence.

Next step: replace new case fans with more quiet ones.


All rights reserved © Marcin Juszkiewicz
Scythe Mugen 2 and socket 1155 mainboard was originally posted on Marcin Juszkiewicz website

by Marcin Juszkiewicz at January 06, 2012 08:51 AM

January 05, 2012

Marcin 'Hrw' Juszkiewicz

Events in 2012 which I will attend

In March I wrote where I will travel. Decided to write such memo at start of year so it will be more visible what my plans are for 2012.

In February I will miss FOSDEM because Linaro Connect Q1.12 will start right after it. So at 4th I will fly to San Francisco for a week. But this time instead of flying back home I decided to spend weekend in New York City where I hope to meet some people from Bug Labs company. You know: we worked with each other for 1.5 year and I met only Peter Semmelhack and Ken Gilmer. Also I plan some sightseeing.

Then a bit of quiet until next Linaro Connect will happen. Probably May but it was not yet decided where and when. As many people I also hope for Asia (never was in this part of world).

Same month there will be Ubuntu Developer Summit somewhere at west coast of USA. Who knows — maybe it will end in trip around the world in May? Sounds interesting but I think that only sounds as it can be hard to survive due to jet lag.

Then July/August another Linaro Connect. No idea where, but hope for Europe. In meantime I may or may not attend Ubuntu Rally (Canonical internal event) which will be somewhere in US (as it follows UDS place).

And end of year will bring yet another Linaro Connect and Ubuntu Developer Summit. Second one in Europe.

What else? Probably LinuxTag if company events will not be at same time, maybe something local (there are few conferences planned in Szczecin).

Overall it looks that there will be some travelling — but this year I plan to make more use of free time to see something else than conference centers.


All rights reserved © Marcin Juszkiewicz
Events in 2012 which I will attend was originally posted on Marcin Juszkiewicz website

by Marcin Juszkiewicz at January 05, 2012 08:24 AM

January 04, 2012

Florian Boor

Android Lessions Part 1: Bluetooth Crash

Finally – some free days for family and friends and to write a few lines which might be useful for someone else. Since Android started to become more and more interesting for industrial and business applications I got involved in some projects porting Android to several devices. It turned out that the documentation of the lower layers (hardware and driver adaptation) is very thin in contrast to the SDK and NDK documentation. But I took some notes working on these projects… this one might be useful for other people porting Android 2.3.x and experiencing issues with Bluetooth.

I ran into the issue that activating Bluetooth in the settings application resulted in a crash of the whole GUI. It seems that only ARMv5 core based devices are affected so that only a few people ran into this so far. (Not that it would be correct on more common cores used for Android devices such as ARMv7A, but it does not seem to cause the same effect.) The solution I found in the Android 4 commit log is quite simple for a problem causing that much of hassle:

--- a/core/jni/android_server_BluetoothEventLoop.cpp
+++ b/core/jni/android_server_BluetoothEventLoop.cpp
@@ -311,7 +311,7 @@ static int register_agent(native_data_t *nat,
{
DBusMessage *msg, *reply;
DBusError err;
- bool oob = TRUE;
+ dbus_bool_t oob = TRUE;


by Florian at January 04, 2012 11:05 PM

Marcin 'Hrw' Juszkiewicz

2011 timeline

Again we are at start of new year. As usual I decided to write some timeline for 2011 year.

January

February

  • FOSDEM as usual. This time I went there with my wife. She saw more of Brussels in one day then I manage during few visits. But she had ‘spouse tours’ in Saturday and Sunday ;)
  • Started using Cyanogenmod on my phone instead of stock Android. Nice improvements and always fresh system.

March

  • Decided to drop KDE and switched to XFCE on desktop and laptop. Main reason was KMail which started to be too hard to rely on. Moved to Evolution and few months later to Thunderbird.

April

  • Linaro porting jam weekly event started. It got quiet last months but we will resurrect it!

May

June

July

  • Another Ubuntu platform sprint — this time in Dublin, Ireland. Met some old friends which moved there from Poland. Also spent awesome weekend with my wife and local part of our family.
  • Took 2 weeks of vacations. We went nearly in the middle of nowhere ;)
  • Switched phone operator again. This time it is Orange, PL and I am on prepaid. Number stayed the same of course.
  • Started using Google+.

August

  • We had first official Linaro Connect in Cambourne, UK. It was kind of conference with lot of hacking time. During it I played with all developer boards which we support and wrote what do I think about them. This post gave me unofficial title of ‘Linaro’s main complainer’ and as a result we can expect some hardware guys presence during next Linaro Connect events.
  • Released some [Generic Linux cross toolchain for tests](Generic Linux cross toolchain for tests) which got some use. Toolchain working group has now people working on it.
  • Bought Hannspree Hannspad tablet running Android 2.2 by default. Played with Cyanogenmod7 and Honeycomb on it. Finally got rid of it month later as I got one with shitty screen.
  • Tried Unity but gave up.

September

  • Modded ATX Power supply which provided 5/12V for my developer boards got fried. Replaced it with industrial +5V/20A one — no boards running at 12V at desk.
  • VPS upgrade from Ubuntu 10.04 ‘lucid’ to 11.04 ‘natty’ ended with not bootable system. All I got was “Error: Boot loader didn’t return any data!” message from Xen. Solved problem, described for users.

October

  • Bought a bike for me and another for wife. We also got extra seat for our daughter and did some trips in forests surrounding Szczecin. Then it became too cold for family trips.
  • Went to Open Source Szczecin conference to listen what people have to say about some projects. Was quite interesting.
  • Got mx53 Quick Start board from Freescale for my Linaro work.

November

  • Visited Prague, Czech Republic again. This time for Embedded Linux Conference. Nice time, met friends. There was also general assembly of OpenEmbedded e.V. organization.
  • Linaro Connect Q4.11 took place at same time as Ubuntu Developer Summit. Another visit in Orlando, Florida, USA. This time we got room as usual — at the end of corridor ;) Bought myself Amazon Kindle e-reader which I am now using to read some old Science Fiction books.
  • I got interviewed during Linaro Connect — we were talking about projects which I worked on in past, what brought me to Linux on ARM. Worth watching!
  • Started using Unity again.

December


All rights reserved © Marcin Juszkiewicz
2011 timeline was originally posted on Marcin Juszkiewicz website

by Marcin Juszkiewicz at January 04, 2012 01:24 PM

January 03, 2012

Richard 'RP' Purdie

Banks of the tyne

Its traditional for the local trail riders to want to escape into the countryside during the Christmas holidays and this year was no exception. Last year we had snowfall which made it all the more interesting but its been relatively mild this year so far. We met at Prudhoe to realise the usual fuel stop was closed due to the bank holiday but there was another garage open nearby thankfully. We did the usual lanes around Slaley noting that the obstructed right of way which we’ve had long standing issues with and I mentioned in a previous post is finally being opened up on the correct route!

Before long I noticed the last man behind me had disappeared so I turned back to find his chain had snapped (at the split link). I was starting to assist in the repairs when it was pointed out my number plate was half hanging off. Some rearranging of some bolts had it reattached in a different way and others had the a replacement split link fitted at the expense of a pair of my pliers by that time.

We came across a shooting party who were not pleased to see us and thought we shouldn’t be there. They were shooting from a public highway (illegal) and standing around with loaded guns on a highway (illegal) but it wasn’t worth risking a discussion with them.

I seemed to be having trouble on anything muddy with the bike sliding all over. At one point I started off down a deeply rutted trail and found the bike weaving all over. It got bad enough that I ended up stopping abruptly when the wheel ran into the side of the rut, hard. Its amazing what goes through your mind and how quickly it can think through things at a time like this. Upon consideration of the situation, I quickly realised there was only air on my right hand side and that was the direction the bike was going to fall over in. Rather than try and catch the bike when my leg did find ground (and likely break something), I evidently decided that escape was the best option so I dived off the bike. I rolled in the air, hitting the ground rolling on my shoulder, and right side. Something told me I had too much momentum to try and stop. I was probably remembering the motorcycle track day rider briefings where they warn you about trying to get up too early after falling off a bike at speed (wait for 2 seconds *after* you think you’ve stopped as you likely haven’t). The consequences of not waiting are described as “breaking off your sticky out bits”. I therefore let myself make another revolution at which point my speed was sufficiently reduced and I somehow made a relatively graceful transition to a standing position at which point I was laughing. The group stopped behind me gave my gymnastics top scores. The body armour did its job and I didn’t really feel any of it. The bike was fine having really just been laid on its side.

We wound our way over trails I’m starting to know quite well heading down the south side of the Tyne and ended up at Twice Brewed for lunch. Its great to see some of the interesting places we get to on the trails although its frustrating not being able to sample the beer! We headed back along the north bank and did some trails I’ve not been on for a while, probably not since I first joined the TRF. By this time is was starting to get dark and it was time to head home. It was good to be reminded of some of those lanes and there was at least one I never remember having ridden on before so it was an interesting day out.

by Richard at January 03, 2012 04:43 PM

December 30, 2011

Paul 'pfalcon' Sokolovsky

Bluetooth link key types

From http://lxr.linux.no/#linux+v3.1.6/include/net/bluetooth/hci.h#L254 :


/* Link Key types */
#define HCI_LK_COMBINATION        0x00
#define HCI_LK_LOCAL_UNIT        0x01
#define HCI_LK_REMOTE_UNIT        0x02
#define HCI_LK_DEBUG_COMBINATION    0x03
#define HCI_LK_UNAUTH_COMBINATION    0x04
#define HCI_LK_AUTH_COMBINATION        0x05
#define HCI_LK_CHANGED_COMBINATION    0x06

by pfalcon (noreply@blogger.com) at December 30, 2011 01:07 PM

Pairing Bluetooth devices from command line

Following appear to be commands required to trigger pairing process from the command line:

hcitool cc <bdaddr>; hcitool auth <bdaddr>

Commands must be on the same line, separated by the semicolon, as described in previous post.

At this point, Bluez auth agent should kick in, asking for a code, if you have GUI one.

I found a page which suggests that only "hcitool cc" was enough for the author to trigger pairing, this could be explained by the fact that prior to 2.1, Bluetooth supported security modes which could protect either entire device access or just some of its profiles.

by pfalcon (noreply@blogger.com) at December 30, 2011 01:00 PM

Making hcitool commands work

It's a shame how some now-ubiquitous technologies, like Bluetooth, are under-used and under-understood. And by usage I don't mean here occasional business card exchange, net access, being bluesnarfed and other boring consumer-level activity, but page scans, inquiries and having secure wireless communication you can trust (or not).

Anyway, if you ever tried using hcitool you may think it barely works. For example:


# hcitool cc <bdaddr>
# hcitool lq <bdaddr>
Not connected.


Ok, so here's the matter. First of all, hcitool accesses hci device directly, and that requires root access. Secondly, it works on low protocol level (ACL), so connection established by "cc" is of course not pairing or service-level connection. It's low level connection, which persist only while data is transferred and shutdown quickly to preserve the power. Yep, it shuts down while you type or even re-run next command. That's how it should be done:


# hcitool cc <bdaddr>; hcitool lq <bdaddr>
Link quality: 255


More fun:


# hcitool cc $BDADDR; hcitool auth $BDADDR; hcitool enc $BDADDR; hcitool key $BDADDR; hcitool con
Connections:
< ACL 7D:75:75:xx:xx:xx handle 12 state 1 lm MASTER AUTH ENCRYPT SECURE

by pfalcon (noreply@blogger.com) at December 30, 2011 12:51 PM

Marcin 'Hrw' Juszkiewicz

Links for 2011-12-29 [del.icio.us]

  • Deprecated Linux networking commands and their replacements « Doug Vitale Tech Blog
    Specifically, the deprecated Linux networking commands in question are: arp, ifconfig, iptunnel, iwconfig, nameif, netstat, and route. These programs (except iwconfig) are included in the net-tools package that has been unmaintained for years. The functionality provided by several of these utilities has been reproduced and improved in the new iproute2 suite, primarily by using its new ip command. The iproute2 software code and documentation are available from the Linux Foundation.

December 30, 2011 08:00 AM

December 20, 2011

Richard 'RP' Purdie

CRM Spares – Not looking so good

One of the reasons I like the CRM was the availability of spare parts. It may be an 18 year old bike but it was ahead of its time in design and you could still get most parts for it.

After the last trip out, it was suspected the oil pump throttle cable was pinched somewhere causing the sticky oil pump action, likely after having had the tank off. I finally got around to taking the tank off and it was clear this was not the cause. Even having isolated the cable from the splitter box with the main throttle cable, it was still not moving freely. Even with the cable totally removed from the bike, it wasn’t clear why it wasn’t happy although there was a nasty looking stretch in the cable outer just as it exits the oil pump. Fiddling with the cable, a strand of frayed cable appeared at which point it became clear there was hidden internal damage. I got a little more forceful in separating some of the fittings and found it really was rather worn being down to a couple of strands:

I was lucky this hadn’t snapped, cutting off the bike’s two stroke oil supply. So, no problem, I’ll just buy a new one. Upon enquiry with the usual purveyor of parts for CRMs I was told that it was not possible to order one and they had no replacement, sorry. This was a bit of a surprise and apparently likely due to the Japanese Tsunami disrupting the Honda parts supply chain. The likelihood of them ever retooling to produce these parts again was remote. I really wanted to have the bike available for use over the holidays too.

Not to be stopped by something like this I went and took a look at my brother’s box of throttle cable components and found he had the right pieces to make a new one (new end fittings, cable, inner liner and outer). The end result:


Its now on the bike and should work as required. I’ve rerouted it a bit to avoid pressure like the original had. I also had to tighten the return spring on the oil pump since the it wasn’t fully closing the oil feed at closed throttle and is evidently weakened with age and probably the previous damaged cable. Longer term, the lack of spares for the CRM might start to become an issue as there are many things that can’t be copied as easily :(

by Richard at December 20, 2011 11:29 PM

Koen Kooi

Using the analog pins on a beaglebone

The long term plan is to use the IIO framework, but till that happens:

root@beaglebone:~# for adc in /sys/devices/platform/tsc/ain* ; do echo "$(basename $adc): $(cat $adc)" ; done
ain1: 3967
ain2: 3762
ain3: 3930
ain4: 1993
ain5: 2096
ain6: 3748
ain7: 3814
ain8: 31

by koen at December 20, 2011 05:48 PM

Richard 'RP' Purdie

Green lanes, mid week, two bikes

[This happened back in September but I realised I never posted it]

I’ve promised my brother a try on a trail bike somewhere and things seemed to align to make it possible. Rather than a quick try, I suggested we just go for a run out. I’ve never been trail riding mid week before and never just with two bikes. This would also be the YZ’s second real trip out. What could possibly go wrong?

We left my garage just after the rush hour traffic died down and had the horrible fight through traffic to reach the other side of Newcastle. After a few more miles we reached the first trail, a nice uphill section which is “ideal” for someone who’s never had a bike offroad before. Chris did fine though. We looped over some further trails winding our way to Slaley forest. One of the routes there has had one end blocked up and we confirmed that was still the case. The local group is working on getting it fixed.

Since Chris didn’t want to destroy his road bike boots, I was trying to be careful where I took him. I couldn’t resist demonstrating the bike was perfectly capable to going through mud over the wheels on at least one occasion though.

We exited Slaley going through some water crossings which I got the bikes through, looped around some trails. At this point Chris was riding through the water crossings with his feet up. I did point out this was fine until you hit something. This is a lesson you learn the hard way though.

We then came back to Slaley from a different direction and then up onto Emberly Fell. This trail is seasonal and closed from 30th Sept for six months of the year so it was nice to ride it before it was out of bounds for a while. I think Chris found the mud/moorland harder than the rockier pieces we’d been on so far. He did have the bike stop standing in a rut as he went for a run. At least he didn’t have to pick it up :) . I was also bemused at one point to be sitting waiting and rather than ride up to me, he took a detour though several bushes :)

From here it was up onto Blanchland moor, over the top into the next valley. I’d decided the best place to head was Hamsterly Forest, a dead end but good fun with no deep water crossings. We made it over the first part of the route, then my bike started sounding rough. Not good. At this point I realised I was out of fuel. We hadn’t made a fuel stop when getting to the other side of Newcastle like I’d planned.

So what to do? I did have “reserve” although looking into the tank, I wasn’t optimistic about how long it would last. The nearest garage was the one we were heading for in Wolsingham, quite a distance away and there was not one nearer. I’d screwed up by not stopping for fuel once through Newcastle and was still thinking in CRM tank range. All we could do was press on. I went into fuel conservation mode, stopping the bike when I could although since it had no kill switch and has to stall in gear to stop the engine, it was hard to coast down hills.

We continued to have some good fun with me riding into what looked like a little puddle that pretty much swallowed the bike. Fuel conservation was forgotten as I had to open it up to get out of that mess quickly, muddy water going everywhere. Apparently it was funny to watch.

The fuel ran out on the flat tops of the hills overlooking the valley that Wolsingham is in. I assessed how much was in the CRM and decided to steal some of its for the YZ in the hope we’d both make it to the garage. The easiest way to do this was simply to remove the CRM’s tank and drain it in which we did. I got over the flat bit, stalled the bike, then coasted down the hillside. I had enough fuel to ride the road to the garage and I don’t think I’ve ever been more relieved to reach a fuel station.

After refueling we continued on to Hamsterly with Chris getting to see
some pretty nice landscape. The water eroded path we rode along contains
pretty scary drops, bumps, rocks and other obstacles and is a lovely
illustration of what those bikes can actually cope with. We reached the
far side of Hamsterly and had lunch.

The trip back was pretty much the route out but with Slaley cut out. It was getting quite late by this point and we needed to get back. On the third last trail of the day, Chris asked me what the red light meant. It was either over temperature or low two stoke oil, we decided on over temperature and the radiator seemed low on water. It should have been fine for two stroke oil. It was also smoking quite a bit. I decided to abort the rest of the lanes and head for civilisation and a garage. It did take water but not as much as we’d expected. I decided to head home and hope we made it.

As we drew nearer my house, the smoke was getting worse and worse, it was like a smoke screen. I was dreading what state the engine was in but at this point we might as well try and make it back. We got back, washed off the bikes and put them away.

I finally got around to a quick look at the bike to see what was wrong. Surprisingly after being left for a couple of days the bike had good compression and fired up first kick. The red warning light was still on. That means its the two stoke oil as it definitely was cold (or something was broken with the temperature sensing which is unlikely). I decided to check how much two stroke oil it had and pulled off the oil pump cover to disconnect the pipe to check there was still some in there. There was oil but the oil pump looked odd somehow, cue some staring at it. There was something not right, but what? I poked the pulley and it sprang back to closed position. Opening the throttle was indeed opening the oil pump but closing the throttle was not closing the pump off, the cable was sticking. Aha!, that would explain the problems. So the working theory is that when we put the tank back on we’ve somehow trapped the oil pump cable and its not returning properly, I’ve not checked into it further yet.

Chris did extremely well for a first time out on green lanes and whilst its a shame the CRM decided to act up, I don’t think it spoilt the day too much.

by Richard at December 20, 2011 11:52 AM

December 15, 2011

Marcin 'Hrw' Juszkiewicz

I feel the power of i7

Lot of time passed since last time I upgraded my home computer. Yesterday I moved from P35 based mainboard and Core2Quad cpu to P67 and i7-2600K processor. And 16GB of memory.

Main reason for change was memory. Building packages on SSD is nice and fast but I hate how system slows down when 3-4GB of data needs to be removed from drive. With 8GB of memory it was hard to fit pbuilder’s instance and all running applications. And P35 based mainboards do not support more than 8GB ;( Why I did not buy P45 based mainboard… They supported 4x4GB setup…

So I checked what is on a market. Then I waited months for AMD to release Bulldozer processors. Finally they did just to show that it was waste of time.

Current PC market sucks. Shops do not know what they sell, you need to go to vendors websites for every information. Intel Sandy Bridge platform has very limited amount of PCI Express lines which means that you can not have more than one x16 slot. But shops look at board and write “two/three/../seven x16 PCIe slots” — never mind that it is one of:

  • x16 + x8
  • x16 + x4
  • x16 + x8 + x4
  • x16 + x4 + x4

And in most configurations x16 degrades to x8 when second slot in use as you need PCI Express switch like NVidia NF200 to “provide” more lanes to get two x16 slots.

And fun goes even more when you look at those ‘three x16 slots’ mobos:

The PCIEX4 slot shares bandwidth with the PCIEX1_1 and PCIEX1_2 slots. When the PCIEX1_1 slot or the PCIEX1_2 slot is populated with an expansion card, the PCIEX4 slot will operate at up to x1 mode.

I remember board where using such x4 slot killed Serial ATA controller…

So, after long reading of all those specifications, reviews, I selected Gigabyte P67X-UD3-B3 mainboard. P67 chipset is not newest one but I do not plan to use on board graphics. I have x16 + x8 PCI Express slots (working as x8+x8 when both in use), USB 3.0 ports, firewire (which I never used), 8 Serial ATA ports (4x 6Gbps and 4x 3Gbps ones) and possibility to have 32GB of DDR3 RAM (but this has to wait for cheap 8GB sticks).

I did one speed test today: tmpfs based build of my cross toolchain packages for Ubuntu. Took one hour for armel and armhf ones. Very nice :)


All rights reserved © Marcin Juszkiewicz
I feel the power of i7 was originally posted on Marcin Juszkiewicz website

by Marcin Juszkiewicz at December 15, 2011 01:13 PM

December 13, 2011

Michael 'Mickey' Lauer

IT has seen a crazy year

Information Technology has seen a really crazy year. Among all the smaller incidents, the big bangs involved Nokia partnering with Microsoft, abandoning Maemo, HP driving with WebOS against the wall, patent lawsuits everywhere.

What that means for FOSS-lovers is clear… you can’t trust any company to continue working on anything. Business demands are what counts in the world of mass markets. If you want longterm support for a platform, your best bet is to build a community around it. But you will also want to work on hardware support otherwise you’ll run into the next dead end.

To be honest, right now I don’t see much of a future for any mobile Linux-inspired platform other than the mutation called Android. But that’s not much of a problem per se. The smartphone market is crazy. To compete in that world, you have to give up on freedom. But is the mass market really what we want? Is it what mobile Linux needs?

I don’t think so. There are still huge opportunities for using Linux-based mobile software platforms in niches such as machine2machine communication, home automation, research, teaching, and more. That’s where a service-based middleware like FSO comes into the game: for special interests. However, even niche-adoption is hindered without a minimal set of applications. And that is where we still lack: Even special interest people want to use their smartphones to manage contacts, browse the web, send mails, play media, etc. We don’t have an integrated software stack with a complete set of UI applications that would cover these needs. Openmoko worked on one, but failed. Nokia worked on multiple ones, but gave up (multiple times). What else do we have?

With HP’s recent announcement about releasing WebOS as open source, the game may have changed. If we could use the WebOS application stack on top of the FSO middleware, we may have a real chance to get something great and usable – and complete – soon. I have always liked the WebOS UI. If it’s a bit slower than other UIs, who cares as long as it is free?

by mickey at December 13, 2011 07:55 AM

December 12, 2011

Marcin 'Hrw' Juszkiewicz

Used Unity for over a month

Some of my readers may react like “WTF? Unity again? After writing ‘no thanks’ post?” But yeah — I spent over month using it. And yes — this is going to be past tense during this week.

In March I got tired of KDE4 and switched to XFCE which served me quite well during Ubuntu 11.04 ‘natty’ cycle. But then I had a feeling that it becomes more and more second citizen in Ubuntu world. All those transitions from GTK+2 to GTK+3 which made some applications look ugly etc.

Then there was this discussion on Canonical internal mailing list where I wrote what do I think about Unity. It was not polite and I am sorry for that. So I decided to give Unity/2D and 3D a longer try.

Unity 2D was interesting environment. Some things were not configurable or hard to find without using gconf-editor and had some issues. I reported few bugs and could not reproduce some of them even:

Also I had one issue with Unity/2D and Psi+ running at same time — was looking like Psi+ opened window, Unity composited desktop but did not noticed that window disappeared in meantime:

Unity/2D fun

But as I have graphics card which knows what OpenGL is I decided to make use of it and switched to Unity/3D. This was real change. More configuration options but you have to remember that you should not touch ccsm (Compiz configuration settings manager) which is the only way to configure it.

Why ‘do not touch ccsm’ mantra? Because it is easy to break whole Unity setup with it. But as there is no other way… For example I do not like 2×2 desktop setup which was default but prefer 6×1 one. Or when use wants to change keyboard shortcuts or several other things.

As usual I tried to report what I found:

Some other things went into #ayatana and #ubuntu-desktop channels on irc where I had several discussions with developers. Some suggested that I must have strange configuration that I have some of my problems. There was even suggestion that I should move to QA team but I hope that no one will take it serious ;D

After that month I can admit that Unity may be usable for many users but I am not one of them. Idea of switching applications not desktops (via Start+[1-0] keys) is nice but I was not able to fully adapt to it. Mostly because I tend to have several windows of same application (terminal, gvim, web browser) and in such case I had more switching as Unity Alt-Tab switcher makes it even worse (you need to use cursor keys in it).

Application menus in top panel was one of first things which I removed. When few windows were present on screen I had several focus changes before I went from right side of screen to menu in panel. Why several? Because I am too used to ‘focus under mouse’ way of selecting windows which is not default Unity way. And even with this enabled I did not find out how to disable ‘bring focused window to front’.

Other thing was side panel (launcher one). There is a way to disable devices icons but no way to disable trashcan or workspaces buttons (which I do not use). Good that other things are configurable — so I set it to 32px width and auto hide if any window wants to take space.

Application runner is hard to use. Press “Start+A”, type “xkill” and tell me what you see? Probably nothing. So run “Alt+F2″ and again type “xkill” — this will work. As interface is same in both situations it may confuse users.

To add application into launcher panel you have to start it first, then find it on panel, get to context menu (usually right mouse button) and select ‘keep in launcher’ option. Different then in other systems but can get used to it.

Systray implementation is weird but it will not be changed as there is a pressure to write indicators instead (if you do not know what it is think “panel applets”). In result some of the applications which I used for years became harder to use (Last.fm official client or Psi+ Jabber client). Some of them could get replaced by other ones or dropped.

What else? Unlocking screen can sometimes take ages^Wminutes. With KDE4 or XFCE I was able to turn on monitor, type password and begin hacking, with Unity desktop I had to remind myself what patience is because often I had to wait 1-2 minutes before ‘enter password to unlock screen’ dialog appeared. Sometimes I even got preview of desktop in meantime (which is privacy unfriendly).

Next week I will check how KDE4 looks like and will have to decide which environment to choose. Maybe will try GNOME 3 next year? Who knows…


All rights reserved © Marcin Juszkiewicz
Used Unity for over a month was originally posted on Marcin Juszkiewicz website

by Marcin Juszkiewicz at December 12, 2011 04:00 PM

December 10, 2011

Nils Faerber

Success - HP frees WebOS !

According to HP and their own developer blog, WebOS indeed becomes open source!

http://developer.palm.com/blog/2011/12/open-source/

This is excellent and great news. I am looking forward to seeing the actual code and project. I sincerely hope that this will not just become a code-dump onto the community.

I am very excited - let's hope for the best!

Cheers
nils

by nils at December 10, 2011 01:00 AM

December 09, 2011

Florian Boor

WebOS goes Open Source

Amazing news! HP just announced that WebOS will become an Open Source project lead and supported by HP in future. The full annoncement can be found here.
HP has an official press release about this here. I’m really looking forward to work with it… It’s quite an interesting framework for a large number of devices. The really funny thing is that Nils asked them to do so in his blog some weeks ago :-)


by Florian at December 09, 2011 08:58 PM

Michael 'Mickey' Lauer

Towards the end of 2011

Tempus fugit. I can tell you. Even more so, if you have a baby. I must confess I somewhat underestimated the impact the baby would have on my spare time. In some weird mindset I really thought I could continue working as usual on my open source projects… as we know now I couldn’t. I completely lost track and have to catch up with all changes that happened over the last 6 months.

The first bunch of weeks with the baby were really demanding. I mean, really. She screamed a lot and could only sleep in our arms. Boy, were we tired. We carried her around so much we have Schwarzenegger arms now. But it’s great to see her developing, err… growing up, of course. With 6 months now she is a very interested baby, eager to learn new things and always trying to become more mobile.

Luckily both my wife and me are self-employed. It so much easier when you can skip some hours at the usual start of the workday and also at the usual end. Of course, the work needs to be done, so we have to compensate when she’s in bed. But still, it’s very satisfying being able to see her twice a day for a couple of hours — not all families have this luxury. Plus the existence of our two invaluable grandmas… it’s great.

Company-wise, the Lauer & Teuber GbR had an amazing year with many interesting iOS (and some Android) projects. We have reached the maximum we can do with the two guys we are, so we decided to grow and hire our first regular employee who’s going to start in 2012. We also rented another office and are already moving.

I’m slowly getting back into some of my beloved open source projects… it’s great that work on e.g. FSO did not stall at all, but continued while I was “away”. Last week, I attended the 3rd installment of the Open Hard- and Software Workshop in munich, where the latest development of the very promising GTA04 mobile phone was presented. I had a talk about Vala which was well received. By the way, my Vala-book plans are not dead yet… just in parking position :)

Next week I’m attending the FSOSHRCON, a joined conference with the people working on the freesmartphone.org middleware and the SHR software. It’s going to be great seeing all the folks again, concentrating a full weekend to agree on some important issues laying the path forward for the next year. Can’t wait to be there.

What’s left is the feeling that an extremely busy year has passed by, spiced with incredibly intense emotions. I’m a happy man and I love my life. I’m given exciting opportunities, but also challenges – and I plan to accept everything :)

All the best to you guys!

by mickey at December 09, 2011 08:10 AM

December 02, 2011

Florian Boor

Summer Holidays

Now that its autumn in Europe it is a good time to blog about the summer vacations :) The Chaos Communication Camp was a real highlight – just a perfect environment for Hacker’s and their fork()^h^h^h offsprings summer vacations. I do not want to write too much… saving some words for more technical posts, but maybe someone likes the photos I took:

Quadcopter Nightflight

Quadcopter Nightflight

Camp at Night

Camp at Night

Antonov AN-2

Antonov AN-2

This nice machine was parked next to our caravan… it’s a little bit larger than you might guess from the photo. I have placed some more photos here.


by Florian at December 02, 2011 09:03 PM

November 24, 2011

Marcin 'Hrw' Juszkiewicz

Square board with five edges

Some time ago I got yet another developer board from Linaro — this time it was i.mx53 Quickstart also known as mx53 LOCO. At that time I only found time to power it on and check does it work at all.

Yesterday I booted it with Ubuntu desktop image from Linaro but without connecting to display (I have HDMI addon so can use VGA and HDMI outputs). Lot of lights (voltage controls mostly) appeared on board — funny thing is that to power some of them all you need is VGA or HDMI cable connected.

Today I went shopping… Board comes with power supply (did not used), USB cable and 8GB microSD card. Last item is important as mx53loco boots from it by default — I do not know does it checks SD card too. What I lacked was Serial ATA -> E-SATA cable for my external hard drive. Yes… SATA->ESATA as board has standard connector for connecting drives directly but as it lacks SATA power connector (about which I wrote already) I had to use external case. Good thing is that local electronics shop had those cables available. Disk speed is quite nice:

Serial ATA disk speed

Serial ATA disk speed

Same disk on USB

Same disk on USB

Compare it with SD card:

SD card speed

SD card speed

Which interface you prefer for storage? :) I hope that new Efika MX53 from Genesi will have some good Serial ATA storage inside.

But then I got hit by other issue… Mounting of board started to be a problem. I hope that next version of board will be bigger. This one is too packed — and HDMI addon makes it even worse at it adds 5th edge to square board. In past I wrote a post about perfect developer board and some points apply here. What I do not like:

  • too small amount of space around mounting holes — hard to reach with 5mm key
  • VGA and RS232 connectors forced me to use very tiny screws to be able to mount board to my board plate
  • Power button is hidden behind screw and hard to reach
  • HDMI addon makes use of Reset and Power buttons very hard — have to use pen or stylus instead of finger when cable is connected
  • leds are too bright — will have to put some duct tape on them

Is there something I like? Of course — I do not want to only complain ;) This is the only cheap developer board from Linaro supported ones with native Serial ATA interface (iirc Samsung cpu could have it but Origenboard does not have connector). Two SD interfaces allow to prototype devices which require extra expansions in case of Beagleboard or Pandaboard. And this is smallest devboard I ever used (cause I never played with Gumstix — but even they usually run in some carrier boards). And compare to Texas Instruments boards it comes with cables and power supply. I plan to make small distcc/icecream farm from my ARM boards and this one will be for use one of nodes.


All rights reserved © Marcin Juszkiewicz
Square board with five edges was originally posted on Marcin Juszkiewicz website

by Marcin Juszkiewicz at November 24, 2011 02:56 PM

November 22, 2011

Koen Kooi

Bob 2007 - 2011


Bob, the last of our two piggies died this morning peacefully in his cage after being too weak to eat for himself the past days. We fed him manually the past 4 week, but that wasn't enough in the end.

We will miss him very much.

by koen at November 22, 2011 03:59 AM

November 18, 2011

Koen Kooi

Using the beaglebone as a weatherstation

Now that the beaglebone has launched Jason and I wanted to see what the experience for a user would be when hooking up sensors. The ADC driver isn't ready yet and to make it worse the pins are only 1.8V tolerant. That leaves I2C and SPI as options to get sensor input into the beaglebone. I went ahead and ordered a few sensors and a display:


I started with the BMP085 barometric pressure sensor first. I hooked it up with jumper cables and booted the board. I2cdetect couldn't find the i2c2 bus, so after help from coworkers I fixedu-boot and the kernel to enable i2c2 and drivers for the sensors.
These changes are already part of the Angstrom Distribution, so you can easily update your kernel to have I2C2 support.

With the new u-boot.img and kernel booted lets see what we can detect on the i2c2 bus:

root@beaglebone:~# i2cdetect -r -y 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- 77                         

It detect the BMP085 at 0x77 (some digging on the sparkfun site tells me that). Let's try to use it without having to patch the kernel again. First we tell linux that we have a bmp085 at 0x77:

root@beaglebone:~# echo bmp085 0x77 > /sys/class/i2c-adapter/i2c-3/new_device

Next we check if everything went OK:

root@beaglebone:~# dmesg | grep bmp
[ 45.409667] i2c i2c-3: new_device: Instantiated device bmp085 at 0x77
[ 45.434717] bmp085 3-0077: BMP085 ver. 2.0 found.
[ 45.434756] bmp085 3-0077: Successfully initialized bmp085!

Let's try a few simple tests:

root@beaglebone:~# echo scale=1 \; $(cat /sys/bus/i2c/drivers/bmp085/3-0077/temp0_input) / 10 | bc
19.7
root@beaglebone:~# echo scale=2 \; $(cat /sys/bus/i2c/drivers/bmp085/3-0077/pressure0_input) / 100 | bc
1016.79

Yay! It's working. I also hooked up at TMP102 board, getting that to work is analogous to the above:

root@beaglebone:~# echo tmp102 0x48 > /sys/class/i2c-adapter/i2c-3/new_device
root@beaglebone:~# dmesg | grep tmp102
[  597.019843] i2c i2c-3: new_device: Instantiated device tmp102 at 0x48
[  597.039650] tmp102 3-0048: initialized
root@beaglebone:~# echo scale=2 \; $(cat /sys/bus/i2c/drivers/tmp102/3-0048/temp1_input) / 1000  |  bc
19.68

Jason and I updated his ELC 2011 demo:source code

The webservice is using nodejs as backend and socket.io + processing.js as frontend. The pressure and temperature are pushed to the client every few seconds to get live updates.

iPhone 4 screenshot:

by koen at November 18, 2011 11:55 AM

November 15, 2011

Marcin 'Hrw' Juszkiewicz

Links for 2011-11-14 [del.icio.us]

  • LXer: The Computer I Need
    This is an extreme example, but try it yourself: take note of what type of computer someone uses and see if it correlates to the way they speak and interact. At the very least, a computer that has regular, long processing "pauses" is training your brain to go on standby. Perhaps old, slow computers may prove to be a detrimental device to our mental health eventually?

November 15, 2011 08:00 AM

November 12, 2011

Paul 'pfalcon' Sokolovsky

Shopping for 3D TV...

Shopping for 3D TV (again), few findings:
  • There are no non-LED 3D TVs for sale in this part of world anymore (in particular, my older favorite, LE40C750 is no longer available)
  • Samsung D6xxx series (the cheapest) were caught red-handed not providing FullHD resolution in 3D: via Samygo. (Note from myself: Samsung was caught because lots of people actually buy their stuff, what one can think about other vendors?)
  • LG goes out of line of vendors with 3D shutter glasses technology with their FPR ("Cinema 3D" in marketing speak) technology. It uses passive (no power needed) polarized glasses, like RealD cimenas. Announced April (on these longitudes), already in local shops at not-so-indecent prices. FPR is Film Patterned Retarder, and I hope the last word is spelled right, because I have high hopes for this tech. It shares the same issue as Samsung D6xxx: there won't FullHD here for sure, but at least it's official and there're other benefits.

by pfalcon (noreply@blogger.com) at November 12, 2011 06:55 PM

Hacking Luxeon SP-1

I finally going to get Arduino, and while I'm choosing flavor and waiting for it, I can't help but disassembling all devices I have at home, each time speaking: "This must have Arduino inside!" (meaning of course that I expect it to be based on general-purpose MCU). Gosh, I usually get "blob chip" (uncased chip with blob of epoxy on top).

Well, I finally had my expectations fulfilled - Luxeon SP-1 voltage stabilizer/cutter features ATMEGA48V-10PU (Flash: 4k, EEPROM: 256, RAM:512). Not only that, it is installed in DIP socket! Buy from Luxeon, they're hacker-friendly ;-).

I bought the device actually for a wattmeter it features (which fact is hard to figure out from common specs found in the shops, I accidentally read somebody mentioning it on a forum). The wattmeter is of course not bright - for a lamp rated 100W it shows 88W, and for more powerful equipment (like perforator) understates wattage even more (maybe it's difference between real and apparent power factor).

Still, for $17 you get Arudino-alike with voltage/current sensor and hacking possibility. Woot!

BOM:
High-power board:
  • Relay: Coil: 24VDC, 5A/240VAC
  • 7805
  • Coil transformer LR-019B
MCU board:
  •  ATMEGA48V-10PU
  • 2 buttons
  • 2 LEDs (red & green)
  • 3-digit 7-segment LED indicator

    by pfalcon (noreply@blogger.com) at November 12, 2011 05:58 PM

    November 10, 2011

    Paul 'pfalcon' Sokolovsky

    Links for November 2011

    Kindle:

    Linux kernel module tricks:

    by pfalcon (noreply@blogger.com) at November 10, 2011 03:21 PM

    November 09, 2011

    Paul 'pfalcon' Sokolovsky

    Holger 'zecke' Freyther

    OpenOCD and SIMtrace

    This is just a short note to myself (and then copied into our SIMtrace wiki).

    This is working for OpenOCD (74558296d1e185fc4a7522f08832eceed460cbd7) and the Amontec JTAGKey (but should work with any JTAG adapter). The easiest way is to start OpenOCD with default config files.

    The SIMtrace v1.0 hardware is powered by the Atmel SAM7S microcontroller and the closest match for this platform is the atmel_at91sam7s-ek.cfg board configuration file.

    First try


    $ sudo openocd -f interface/jtagkey.cfg -f board/atmel_at91sam7s-ek.cfg
    ...
    Error: An adapter speed is not selected in the init script. Insert a call to adapter_khz or jtag_rclk to proceed...


    Second try


    You can patch one of the two files, create a new config file and load it with -f
    or specify the command. The below example specifies it on the command line.

    $ sudo openocd -f interface/jtagkey.cfg -f board/atmel_at91sam7s-ek.cfg -c "adapter_khz 30"

    Final config


    $ echo "adapter_khz 30
    > arm7_9 dcc_downloads enable
    > init
    > reset init
    > " > myinit.cfg

    $ sudo openocd -f interface/jtagkey.cfg -f board/atmel_at91sam7s-ek.cfg -f myinit.cfg

    One of the calls appear to fix 'halt' not really halting the SoC, I have not investigated which of the options is doing it.


    Flashing First try


    $ telnet 127.0.0.1 4444
    > flash write_image /tmp/main_simtrace.samba 0 bin
    wrote 0 bytes from file /tmp/main_simtrace.samba in 0.238727s (0.000 KiB/s)

    With a quick look into the NOR Flash code, it appears to fail as it does not
    find a flash region at the address it is looking for one and then reports to
    you the success of 0 bytes (instead of a failure).

    Flashing Working


    $ telnet 127.0.0.1 4444
    > flash write_bank 0 /tmp/main_simtrace.samba 0
    wrote 37020 bytes from file /tmp/main_simtrace.samba to flash bank 0 at offset 0x00000000 in 39.175068s (0.923 KiB/s)
    > reset init
    > resume

    by zecke (noreply@blogger.com) at November 09, 2011 04:34 PM

    November 08, 2011

    Marcin 'Hrw' Juszkiewicz

    Links for 2011-11-07 [del.icio.us]

    • Hacks Restore the text justification menu toggle without a hack - MobileRead Forums
      There is a hidden menu item in the font menu [aA] of all Kindles that toggles between left and full text justification. This menu item can be enabled and set from the default "full" to "left" so that most properly formatted Kindle ebooks can be read with a ragged right margin.
    • MobileRead Wiki - Kindle HowTo: Change Margin
      For simple adjustment of the left and right margins to one of the three preset values, use the "Words per Line" option on the font size page (press Aa key to the right of the spacebar on the keyboard). The option may be named "Words per Line" but what it really does is to alter the left and right margins. For finer control of the margins, the following steps require the user to access the the Amazon Kindle's internal storage memory through a USB cable attached to a computer.
    • MobileRead Wiki - Kindle Font Hack for all 2.x and 3.x Kindles

    November 08, 2011 08:00 AM

    October 25, 2011

    Paul 'pfalcon' Sokolovsky

    Fixing fan cooler in Asus X34F notebook

    I spent good deal of day today fixing howling, growling, roaring and making other pleasant noises fan in my Asus X34F notebook. X34F appears to be region-specific version of U35F, and motherboard bears labels of UL30A, so I guess this may be pertinent to them either.

    I wasn't able to find a service manual, so I proceeded with disassembly by experience and intuition. It turns out that to detach cooler one needs to unscrew one motherboard plate completely (there're two, bound with a connector). The cooler part number turned out to be KDB04505HA by Delta Electronics. Vendor site showed no trace of this part no. But quick googling showed that it's the same part no used in Macbook Pro with similar performance stories. One another reason you don't need to pay a lot to get the same c.r.a.p.

    Once I completely detached it, I figured how it could make those noises - impeller could dance on its axis, and while doing so could touch plastic casing. So, my idea was to either cut the corresponding side of impeller, or increase vertical space in which it "dances". I went for the latter, adding two washers between metal and plastic casing parts and gluing another washer on third point to get more support.

    I decided also to oil fan, and considering oiling with machine oil could lead to just more dust accumulation, figure I take a pencil and oil it with graphite. Big mistake - either that pencil didn't really have pure graphite, or I put it there too much, but after re-assembling and powering all stuff, I saw that the cooler stopped working at all.

    I almost gave up and started to look for closest repair shop, then figured I already have thing half-disassembled, and they would need to extract the fan anyway, so guessed I do it myself and deliver it to repairman in pieces. But before then, heck, I'll make another pass it it - first of all, try to power it on despite its rather home-use unfriendly connector.

    Couldn't reliably figure the connector pinout (found pinout only for 12V desktop fans, who knows if laptop one would be proprietary), so tried googling for wire color codes instead. This page gave me good hints (black - GND, red - VCC, blue - PWM for speed control, yellow or another - speed sensor) which I decided to try with power supply at last. Unfriendly connector? Was able to stick into it breadboard wires, then breadboard, then breadboard power adapter. Saw the motor nudge, as struggling with friction. Took off the impeller, wiped its axis, and cleaned other part as best as I could. Put it back and powered, and so it moving - but, with whistling and vibration, even though suspected plastic part was off. Well, decided there's little to lose and oiled it with smallish drop of machine oil.

    That was it! The thing stopped its hellish screams and just monotonically buzzed if move ear close to it. Reassembled all the stuff - the noise level is close to that which was when I bought it, as far as I can tell. acpitz sensor temperature is down to 55dC from 95dC I saw before. Finger crossed that oiling will help for decent time.

    Conclusion and note to myself: It's indeed nice idea to be in power of your hardware, no doubts, and fears off. And its better to invest into tools than to pay for services of unknown quality (could easily imagine the same oiling to be done, but charged as replacement).

    UPDATE: No, it didn't last even a day :-(

    by pfalcon (noreply@blogger.com) at October 25, 2011 09:53 PM

    October 21, 2011

    Holger 'zecke' Freyther

    DirectFB contribution to the Qt Project

    The Qt project was launched today, I got my 15 DirectFB patches merged, got some first experience with Gerrit, created an account for the Qt wiki, fixed some documentation, so all in all I think it is the great start of the Qt Project we have been waiting for! So thank you very much for all you involved with it!

    Now to something completely else, somehow I like to see the parts that are not great yet. But most importantly it is a great opportunity for everyone to get involved with the Qt project and improve things. So here is my short wishlist for the Qt project.


    • Single account for the Bugtracker, Wiki, other services.

    • Read-Only access to gerrit.

    • Public CI based on Jenkins, right now build failures will still point to internal Nokia servers. I assume KDE can help a bit with the Jenkins setup.

    • Make it possible for non-mainstream QPA backends and platforms to be part of the CI System, if proven stable be considered core builders.

    • The wiki being part of the Qt project should be part of the Qt Project, the license should probably be made compatible with the license of the Qt documentation, to allow copying from one to the other.



    Once again, thank you Nokia, thanks everyone involved!

    by zecke (noreply@blogger.com) at October 21, 2011 07:49 PM

    October 17, 2011

    Holger 'zecke' Freyther

    First days with Ubuntu 11.10


    • Crypto Password for /home is echoed back... no canonical mode set..

    • A single process can take down a multi-core system... poor scheduler performance?

    • New volume applet has no support for changing volume by keyboard... and no way to change the volume of the microphone

    • GTK+ file dialog has wrong margins... visual offsense... left and right area have different height

    by zecke (noreply@blogger.com) at October 17, 2011 03:32 PM

    October 13, 2011

    Holger 'zecke' Freyther

    Creating a small GUI for the SIMtrace application

    Earlier this year I created a Hardware company with a friend to supply to our GSM community and beyond. One of our first products is the SIMtrace Hardware (CC Licensed, actually it should work with any Smartcard). Today I had to wait a bit and decided to convert the CLI application that talks to the firmware to a GUI application. I did this by running the CLI part in a QThread and using QMetaObject::invokeMethod to callback to my GUI.

    I started off creating the Qt application with VIM and a browser to help me to remember some function names. After a while I had enough of this and used Qt Creator and enjoyed the auto completion, it had no problem reading our C header files of libosmocore and provided auto completion for these too. Once again I am amazed how nice Qt Creator is and how little code I needed to create the below.

    From October 13, 2011

    by zecke (noreply@blogger.com) at October 13, 2011 06:33 PM

    September 27, 2011

    Holger 'zecke' Freyther

    QPixmap and what I did not know

    In general QPixmap is the class I dislike the most in the Qt graphics stack. It is not because it did anything wrong, or has annoying bugs. It is merely that painting on a QPixmap can produce a huge slowdown. Maybe it is even the immediate painting model I dislike so much.

    In theory the QPixmap should represent the graphics memory and in theory painting this to another piece of graphics memory should be very fast. But reality is different, e.g. with directFB/X it is possible that your graphics memory resides in the host memory because you have allocated too much. X (EXA, UXA...) has migration strategies, directFB will just allocate it in system memory and it will stay there. So your graphics memory class might not be always allocated in graphics memory.

    The athur painting capabilities of Qt4 were very nice but Hardware/X/directFB might not be capable of handling all the advanced concepts (perspective transformation, drawing other pixmaps scaled) and the paintengines then need to fallback into the raster path, but the raster path needs to work on a QImage and this is where stuff get terrible. There will be a download of the memory (slow), there might be a change in color (ARGB -> pre multiplied ARGB?), then the fallback, and then uploading of the memory again. So even classes like QGraphicsBlurEffect go through QPixmap -> QImage -> QPixmap (or at least used to).

    So the basic problem with QPixmap and the immediate painting model is, only once you are done with painting everything, you know if starting with a QPixmap would have made sense. If Qt5 wouldn't be all about OpenGL, I would have lobbied hard to make QPixmap an internal class and use it to 'cache' QImage that have peen painted a lot.

    After all this love/hate with QPixmap there were still things I didn't know. For Qt5 I am working on the directFB lighthouse plugin and started to work on make more tests pass. The thing I did not know was that by default the QPixmap has no alpha channel, only if either a mask is set or the pixmap is filled with a color that has an alpha channel the QPixmap will end up having an alpha channel and be ARGB. This means that a lighouse plugin providing a QPlatformPixmap implementation needs to be able to provide an ARGB and a RGB based pixmap and switch between them.

    by zecke (noreply@blogger.com) at September 27, 2011 12:09 PM

    September 24, 2011

    Holger 'zecke' Freyther

    GNU Smalltalk deployment with images and image resumption

    Once up on a time I was sitting in a cold hall at the Barcelona exhibition ground, a power outage has taken down several DVB-H platforms (racks consisting of servers, streamers, RF equipment...) and once power was restored red LEDs were blinking, systems not coming up automatically, hordes of engineers trying to boot the right kernel, trying to remember the multicast routes they had typed in by hand, chaos, hectic. It was interesting to witness that as we could lay back, continue with our work, as our platform was configured to come up automatically and it did.

    One has to assume that stuff breaks, software, disk, RAM, CPU, power supply, anything. The only answer to that is be prepared, build your software to deal with failure (or nicely try to restart), make sure all systems start automatically, have backups, have a plan.

    For my GSM (telephony) in Smalltalk components I didn't do that yet, mostly because my code was not very mature, I was still building up the trust relationship and so my deployment consisted of manually running GNU screen, then GNU Smalltalk, manually loading my code, starting things up. It was about time to correct that.

    The tool of choice is the gst-remote application, it will run a GNU Smalltalk image, it can daemonize and it will listen for input from other systems. While moving to this deployment my fellow Smalltalkers were kind enough to fix some bugs on the way. There was an issue of gst-remote exiting when saving an image, the Delay class not functioning properly on resume, the wrong FileDescriptors being closed on image resumption. It is very nice to get help that fast!

    My deployment now consists of building GNU Smalltalk packages, having a Smalltalk script to load the package and call start method of that package followed by taking a snapshot and exiting. I can then resume the image and if the software is prepared to deal with image resumption it will work.


    Eval [
    | name image |
    name := Smalltalk arguments first.
    image := Smalltalk arguments second.

    (PackageLoader packageAt: name)
    fileIn;
    start.
    ObjectMemory
    snapshot: image;
    quit.
    ]

    by zecke (noreply@blogger.com) at September 24, 2011 12:38 PM

    September 20, 2011

    Nils Faerber

    Open *please*: HP - please open source (free) WebOS!

    Maemo5 is effectively not for the future - I love, don't get me wrong! And I will take a lot of care about my N900 because I still think that it is the best Linux-like mobile phone on the market yet. But Maemo as a smartphone platform has reached its end of life. There will not be any new devices and the platform will not evolve anymore.

    MeeGo is, despite the never tiring excuses of Intel, effectively almost dead too. I am pretty sure that we will not see any further new MeeGo phones except for the Nokia N9.

    And today rumors spread that Samsung is about to open source Bada, their up to now proprietory smartphone system.

    read more

    by nils at September 20, 2011 05:09 PM

    September 18, 2011

    Holger 'zecke' Freyther

    Qt, QPA and some notes to myself

    QT_QPA_PLATFORM_PLUGIN_PATH, QT_QPA_PLATFORM and QT_QPA_FONTDIR variables are used by QApplication/QPA to find the plugin. They are also available as arguments but there is no help entry for them (Qt5 needs some polishing).

    When building a plugin and Qt insists to tell you that the plugin is not there, you are likely to have some undefined symbols, the best hint is to build your plugins with -Wl,--no-undefined in the linker line. Obviously we should plan to use dlerror to also report why Qt is seeing the file but not listing it as available plugin.

    cheers

    by zecke (noreply@blogger.com) at September 18, 2011 03:24 PM

    September 13, 2011

    Paul 'pfalcon' Sokolovsky

    Links for September 2011

    Speech synthesis/TTS links, focusing on Russian:

    OpenSource:

    by pfalcon (noreply@blogger.com) at September 13, 2011 02:36 PM

    August 28, 2011

    Holger 'zecke' Freyther

    shop for SIMtrace

    The WebShop for the SIMtrace hardware can be found here. We are using a CA-Cert signed SSL certificate and your browser vendor might not like it.

    Setting up, or mostly modifying the webshop was my first encounter with rails. In some ways it is a great framework, in others with a Smalltalk background there are some tears in my eyes. This is using spreecommerce because I wanted something that is not done in PHP and is not following the OpenCore business model.

    The manual of spreecommerce is actually great from an engineering point of view, they describe the concepts, the models and how to modify it. But they are bit short on setting it up. There are some config options where no Graphical way to change them exists yet. So it is best to look into the app_configuration.rb of spree_core, e.g. to modify the default country.

    There are still some bits that I would like to change, the code for my modification can be found on gitorious.

    by zecke (noreply@blogger.com) at August 28, 2011 01:38 PM

    August 22, 2011

    Holger 'zecke' Freyther

    Going down the Sangoma rabbit hole

    I ended up needing to configure FreeSWITCH to use a Sangoma ISDN card. At first we were foolish and used the setup script to install libraries into our system.

    Cleaning up


    It took dpkg -S and manual filtering to clean this mess. On a debian system there are files in /usr/ that do not belong to packages, these can be links to /etc/alternatives, or in case of python be bytecode files (*.pyc).

    Second attempt with building packages


    The next attempt was to use checkinstall -D make install but the source distribution of wanpipe is such a mess that checkinstall refuses to work, I have created a handmade debian package with some split up. The most annoying issues are the installation of .svn, .deps, .libs directories, using /etc/wanpipe for examples and firmware (they belong somewhere else), also installing the package requires to overwrite files of other packages (Linux comes with a wanrouter.ko too). There also appears to be some fishy licensing part, the source distribution is shipping with some .o files, the module claims to be GPL though.


    First attempt with FreeSWITCH


    FreeSWITCH allows to build debian packages out of the box, and it worked, it also built the freetdm module. But my module was missing support for wanpipe, adding the wanpipe-dev, rebuilding fixed the problem.

    Second attempt with FreeSWITCH


    After configuring the ISDN card using the wancfg_fs utility (and not allowing it to mess with the free switch config, as it is breaking it), I saw the cards but I was missing a library to actually use the card for Voice Calls.

    ISDN libraries


    I needed to get the libsng-isdn library, of course without sourcecode, also without a LICENSE file at all. Who may use this library? Under which circumstances? I started with checkinstall but this does not handle shlib providers very well, so I had to package the library myself

    Third attempt with FreeSWITCH


    I was able to recompile the FreeTDM module, and I could configure the ISDN trunk and use the the fs_cli to orginate a call.


    Summary


    FreeSWITCH and FreeTDM are quite powerful, also having support for creating debian packages is great too. The Sangoma experience is less exciting.


    by zecke (noreply@blogger.com) at August 22, 2011 12:55 PM

    August 18, 2011

    Philip Van Hoof

    Avoiding duplicate album art storage on the N9

    At Tracker (core component of Nokia N9‘s MeeGo Harmattan’s Content Framework) we extract album art out of music files like MP3s, and we do a heuristic scan in the same directory of the music files for files like cover.jpg.

    Right now we use the media art storage spec which we at a Boston Summit a few years ago, together with the Banshee guys, came up with. This specification allows for artist + album media art.

    This is a bit problematic now on the N9 because (embedded) album art is getting increasingly bigger. We’ve seen music stores with album art of up to 2MB. The storage space for this kind of data isn’t unlimited on the device. In particular is it a problem that for an album with say 20 songs by 20 different artists, with each having embedded album art, 20 times the same album art is stored. Just each time for a different artist-album combination.

    To fix this we’re working on a solution that compares the MD5 of the image data of the file album-md5(space)-md5(album).jpg with the MD5 of the image data of the file album-md5(artist)-md5(album).jpg. If the contents are the same we will make a symlink from the latter to the former instead of creating a normal new album art file.

    When none exist yet, we first make album-md5(space)-md5(album).jpg and then symlink album-md5(artist)-md5(album).jpg to it. And when the contents aren’t the same we create a normal file called album-md5(artist)-md5(album).jpg.

    Consumers of the album art can now choose between using a space for artist if they are only interested in ‘just album’ album art, or filling in both artist and album for artist-album album art.

    This is a first idea to solve this issue, we have some other ideas in mind for in case this solution comes with unexpected problems.

    I usually blog about unfinished stuff. Also this time. You can find the work in progress here.

    by pvanhoof at August 18, 2011 07:20 AM

    August 17, 2011

    Holger 'zecke' Freyther

    PayPal must die

    This is another rant, today about PayPal. It all started when I tried to buy some credit for the skype callout feature. The overlords at PayPal decided that besides the Post Ident I did to open my account, the verified bank account that is stored in my data I will now need to enter my German Identity Card number. Too bad that the number they have stored is from a card that expired maybe five years ago.

    How comes they think the Number is secret after hotels, car rentals, dvd rentals, airlines, ..., started making photo copies of these documents? But to make it worse they have implemented this 'security check' in a way that prevents me of using the normal contact form.

    So I took it up with the support, and they proposed me to reset my password, they kept on proposing to reset my password. They offered me to call me, I gave them my hotel + room number but they were not able to figure out the prefix for dialing to China. After three more support emails and proposals to reset my password I know have the instruction to close my account and transfer my balance to my reference account. All they want is my first born though.

    I was a bit lazy and have not collected the information they need yet, today I wanted to buy something online, the company is using PayPal Express Checkout, and I am not allowed to pay with my VISA card as Paypal knows some combination of my name and forces me to log into my paypal account (which of course does not work).

    Please, someone, fix this payment mess.

    by zecke (noreply@blogger.com) at August 17, 2011 09:44 AM

    August 15, 2011

    Philip 'crofton' Balister

    Blog more

    OK, so I am pretty much a failure at this blogging thing. I was just looking back through my blog for an old post, and see it used to be pretty good. I'll try and do better.

    by Philip (noreply@blogger.com) at August 15, 2011 01:12 PM

    Philip Van Hoof

    Null support for INSERT OR REPLACE available in master

    About

    Last week I wrote about adding a feature to our SPARQL Update’s INSERT OR REPLACE. With that feature it’s not needed to put a DELETE upfront the INSERT to clear a field. This makes our SPARQL-ish INSERT OR REPLACE in some ways more powerful than SQL’s UPDATE. Note, however, that all of INSERT OR REPLACE is non-standard in the SPARQL language. And this new null support certainly isn’t.

    Support for null with INSERT OR REPLACE is now available in Tracker‘s master branch. How to use it is illustrated in the functional test. I’ll briefly explain the test.

    For single value properties:

    This is of course very simple.

    INSERT { <subject> nie:title 'new test' }
    INSERT OR REPLACE { <subject> nie:title null }

    If you now select nie:title for <subject> then of course you’ll get that its nie:title field is unset.

    For multi value properties:

    Begin situation:

    INSERT { <subject> a nie:DataObject, nie:InformationElement }
    INSERT { <ds1> a nie:DataSource }
    INSERT { <ds2> a nie:DataSource }
    INSERT { <ds3> a nie:DataSource }
    INSERT { <subject> nie:dataSource <ds1>, <ds2>, <ds3> }

    This will be the test query I’ll use for all cases:

    SELECT ?ds WHERE { <subject> nie:dataSource ?ds }

    For the begin situation that of course gives us <ds1>, <ds2> and <ds3>.

    With null upfront, reset of list, rewrite of new list:

    INSERT OR REPLACE { <subject> nie:dataSource null, <ds1>, <ds2> }

    This will give us <ds1> and <ds2> for the test query. The first null resets the existing list, then <ds1> and <ds2> are added. This is probably the most sensible one to use for multi value properties.

    With null in the middle, rewrite of new list:

    INSERT OR REPLACE { <subject> nie:dataSource <ds1>, null, <ds2>, <ds3> }

    This also gives us <ds2> and <ds3>. First <ds1> is added, but the null that follows clears it again. Then <ds2> and <ds3> get added. So the <ds1> there doesn’t make much sense, indeed.

    With null at the end:

    INSERT OR REPLACE { <subject> nie:dataSource <ds1>, <ds2>, <ds3>, null }

    This one doesn’t make much sense either. The <ds1>, <ds2> and <ds3> get cleared by the null at the end. So the query gives us zero results.

    With null as only element:

    INSERT OR REPLACE { <subject> nie:dataSource null }

    This one makes sense, you can use it to clear a multi value property of a resource. The query gives us zero results.

    Multiple nulls:

    INSERT OR REPLACE { <subject> nie:dataSource null, <ds1>, null, <ds2>, <ds3> }

    Again doesn’t make much sense. First the list is cleared, then <ds1> is added, then it’s again cleared, then <ds2> and <ds3> are added. So the query gives <ds2> and <ds3>.

    by pvanhoof at August 15, 2011 10:26 AM