Sunday, November 1, 2015

Honda Wallpaper img imid option

To create a Wallpaper for your Honda 2015 you need to read the owner Manual and see the following limitations of the image:

Each image file can be up to 2 MB.
• The maximum image size is 1,680 x 936 pixels. If the image size is less than 420 x 234 pixels, the image is displayed in the middle of the screen with the extra area appearing in black.
• The number of files that can be selected is up to 255.
• Up to 64 characters can be displayed in the file name.

Also when you create the JPEG file you must not use progressive compression for the jpg file. By default gimp turns this on and the paint program does not.

Monday, February 2, 2015

DIY PDF Bluetooth foot pedal for Android

DIY PDF Bluetooth foot pedal for Android

Why do this:

There are many directions that someone can go to build/buy something like this , so why bother and why is this worth while ? 
I think learning and understanding how things work and why they work or don't keep people in a balanced state , IE ignorance is not good for any one, details are the only path out.
This project keeps my mind into a sample of current electronics/Android development and how new products can change the way we work and think.  Also this touches things I can use and do, IE wood work is a something I like to do, electronics is something I find fun and programming/machine building is in my blood somehow. The BT foot pedal is something that is changing how sheet music is read when playing a instrument IE no paper just a tablet and a foot pedal I play there for this is good . I found this link to a DIY foot pedal project Bluetooth-page-turner-pedal-for-sheet-music-apps .  It was a good project to find the bluefruit-ez-key which gave me the rest of my project as I built everything around it.

Designing the pedal:

 I always start with the minimum of what I need:
  • Some kind of platform to rest the foot on to trigger a switch/page turn.
  • Some kind of switch ?
  • Power the unit ? 
  • Some way to package the hole unit ?
Since most of this project will be built with the Bluefruit-ez-key unit most of the questions and design points will be answered there. Some key features of the EZ-key:
  •  Power the module with 3-16VDC, so a 9V battery will work great.
  •  Acts just like a BT keyboard, IE plug a switch to a key and it works.
  •  Sends the 4 arrow keys, return, space, etc.
It looks like all I need is a platform to hold switches and a box to hold the EZ-key and a 9V battery. I start with the platform, some major points :
  • Comfort , I don't want to be picking the foot up to hit a page turn, I wanted something to  use as a foot rest and then rotate the foot left or right. 
  • Back and forward keys will be closest and I wanted a home and end function key to act as a top of document and end of document.
  • Pitch of the pedal would be not too high and not too low so again minimal foot movement. 
  • Size of unit should be small to be able to easily pack away in a gig bag.
  • Stability of the unit no tip or chance of turning over during a session.  
I wanted a lot of pitch control on the platform so I made this with some scrap wood. Wood is something you can just form into any shape and pitch/angle would be controlled with the supports of the platform.  So I started with a shape that would be a arch that would allow the foot to pivot on the heel to each switch.  I determined a pitch that was comfortable to rest the foot on and then I cut out the pieces and glued it together.  
Pitch of the platform for resting the foot
Because the platform is small and the supports are large there isn't much space to hide a 9V battery and the EZ-key board so a external box was needed to support this, I went with plastic because it is a insulator and it is easy to cut and glue a box also I wanted clear to see the led's on the EZ-key board, again something small/strong. I added and on/off toggle to power on off the unit for convenience. 
EZ-key , battery, switch
I wired the box to the platform with some small plastic tie wraps and the wire holes in the foot switch supports.  I used monetary stomp box foot switches to do the key presses and wired them to the 4 keys and ground.  The keyboard keys I'm using are up arrow for page up, down arrow for page down, space for top and enter for max down,  See the EZ-key documentation for the keys and pins . 
Underside so that you can see supports and wiring
I wanted to use this on a Android tablet , I have a nook 9 inch with a Cyanogenmod cm11 loaded with Android 4.4.4 .  I found the pdf reader Ebookdroid which has a way to control the scroll down/up and could remap keyboard keys to do functions like top/end to space/return.  Ebookdroid is also opensource with alot of functionality in it but the documentation is not much but I was able to figure it out. There is a bit of documentation in the EZ-Key unit that I over looked and that is when paring the EZ-Key to a device you have to hit the very small button on the EZ-Key to start the pairing else it will never see it, I wasted some hours of work missing that button.  
The buttons are mapped right to left as bottom, page down, page up, top.
In general this project took months to figure out all the different pieces and to make the decisions on how I wanted it to turn out. There needs to be a top piece to the control box but for now I'm leaving it off for future debugging.  In general this is working well , but I am still in testing and will update with more results later.     

Tuesday, December 18, 2012

Asus AS U32U laptop with Linux

Asus AS U32U laptop with Linux

This is a AMD E-450 dual core, cool running CPU with these lspci:

00:00.0 Host bridge: Advanced Micro Devices [AMD] Family 14h Processor Root Complex
00:01.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Wrestler [Radeon HD 6320]
00:01.1 Audio device: Advanced Micro Devices [AMD] nee ATI Wrestler HDMI Audio [Radeon HD 6250/6310]
00:04.0 PCI bridge: Advanced Micro Devices [AMD] Family 14h Processor Root Port
00:11.0 SATA controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices [AMD] nee ATI SBx00 SMBus Controller (rev 42)
00:14.1 IDE interface: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 IDE Controller (rev 40)
00:14.2 Audio device: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices [AMD] nee ATI SBx00 PCI to PCI Bridge (rev 40)
00:15.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0)
00:15.1 PCI bridge: Advanced Micro Devices [AMD] nee ATI SB700/SB800/SB900 PCI to PCI bridge (PCIE port 1)
00:15.2 PCI bridge: Advanced Micro Devices [AMD] nee ATI SB900 PCI to PCI bridge (PCIE port 2)
00:15.3 PCI bridge: Advanced Micro Devices [AMD] nee ATI SB900 PCI to PCI bridge (PCIE port 3)
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 0 (rev 43)
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 6
00:18.6 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 5
00:18.7 Host bridge: Advanced Micro Devices [AMD] Family 12h/14h Processor Function 7
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01)
04:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 0a)
05:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller
06:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)

The only real problem area was the Realtek RTL8111/8168B Ethernet controller , I had to upgrade to Linux kernel 3.7.0 for this to work at all.  Atheros wireless works at N speed without any issues so far at kernel 3.6.6 .   

Suspend worked with "s2ram -f -a1" and X11 worked with a almost default file , sound works with a 3.6.6 kernel but mute on headphone didn't work till the 3.7.0 kernel.  Put my own 180G Intel SSD and works without any issues for the last month .  

I like the Asus build quality a lot and think this is a great laptop where you can still put standard parts in it like ssd - ide / memory with out issues unlike the ultralights out there with special ssd and memory.

Hope this helps. 

Sunday, March 27, 2011

You never get fired for buying MS/Cisco/Oracle/IBM/HP/Dell etc ?

Is this still true "you'll never get fired for buying the big brands"  ?
Is this the magic formula to a successful corporate job ?
Does corporate IT still live and breath this cry, has nothing changed in 30 years ?

Linux in the corporate environment has caused some small cracks in the above Iron, but it seems not much.  In my job I get questions like "are sure you are spending enough here", or "well that is only a AMD machine" Or "why don't we just buy all the machines now" .  In general most managers just don't understand what a corporate machine should be, thus they want to fall back to someone to defined that for them (and expert), and big brand names are more then happy to do this.  Big brands try to look at what they think the current corporate environment is and to drain as much cash from that environment, thus the model lines are developed and sold.  Is there a way to fight/counter  this madness ?  Here are some steps that might help change the corporate environment.

1) To bring in hardware that is off brand it has to work, and work well for today and into the future.
2) You need to establish a track record of the above at least 2-3 years.
3) You must then sell this to your managers and underlings all the time.
4) Mangers must understand that this is not only saving money but is better for today and the future.
5) Underlings must work with you and not against.

Why fight this fight, here are some reasons :

1) Most big brand hardware is 1-2 years behind the technical hardware curve, thus you will spend more for less advanced hardware.
2) Fast and more up to date hardware will give you a 2-3 year advantage for  performance and up time numbers.
3) You will be able to buy more hardware, faster and reliable because you can shop for the best/price point within each category .

Current examples:
1) SSD hard drives are changing everything about I/O, database access and reliability .
2) The fastest system memory is the best way to make applications run fast.
3) Mega multi core machines are creating main frames on 1U servers.
4) There are always 2-3 reasons to build your own machines, always.

Are there reason why you don't want to do this (Yes):
1) You just don't have the time.
2) You are scared of failing .
3) Non Linux software does not work well with new hardware.
4) MS licensing gives you a huge costs disadvantage to rolling your own.  

As always what do you think ?  Any more reasons to add to the list ?  What ideas do you have ?

Saturday, October 2, 2010

VDE and QEMU

Networking many qemu-kvm on one hosting machine or Virtual machines with Virtual networking

VDE - Virtual Distributed Ethernet Create a virtual switch in your machine with software.
QEMU - is a generic and open source machine emulator and visualizer
QEMU-KVM - QEMU with Linux Kernel virtual machine, using hardware in processors that support emulations (very fast).

I have been using Qemu-kvm for the last 2 years and the biggest pain is setting up networking for a group of virtual machines, there is a way to set up a tun and bridge interface for each virtual machine but it is a pain and when you display all of the network machines it is a mess to take in. VDE seems like a way to simplify this networking mess, with VDE you can set up a virtual switch that has one tun to connection and many QEMU-KVM connections to VDE. All of this is not perfect and may require some bridge creation and or FW rules.

Setting up VDE

There is a VDE daemon that must be started to bring up a switch:
vde_switch -tap tap0 -daemon
This daemon must be running to use vde to run qemu, you can bring it up when you start up your machine or with a script as you start up your qemu-kvm machines.  Please note that this will create a pipe file in /tmp/ or /var/tmp , depends on installation of vde and parm overrides.

Creating a Linux bridge interface

To get the vm machines to communicate out you can set up routing in linux with a FW SNAT or you can set up a bridge interface over you active network interface.  The bridge option is a bit easier and better if you want to connect to your virtual machines from the outside of your host machine.  You can create a br0 device through your network start up (Using your normal distro startup) or by hand (using brctl utils) then attach your active network interface to it and the tap0 device and you are done with the network setup, well almost.   Note: Distro networking is notorious confusing and worthless, yes people (in most cases people running old distros that google search works well for) do get it to work , but for the rest of us it's not worth the pain since setting it up requires us to understand the start scripts written by some bash hacker of dubious intentions.  The doc from brctl is easy to understand thus why bother with anything else.

Using vde with qemu-kde

To put all of this together you need to run qemu-kde under vde and the best way is with this format of a command:
vdeq qemu-kvm -net vde,vlan=0 -net nic,model=virtio,vlan=0,macaddr=52:54:00:00:AA:01 -curses -drive file=/space/images/linux-amd64-2.img,snapshot=off,cache=none,if=virtio,boot=on -smp 2 -m 1G -monitor telnet:127.0.0.1:9221,server,nowait
When running qemu-kvm under vdeq you can add network options IE "-net vde".  With this option qemu will connect to a free port on the vde_switch which is now bridged with the br0 device and has free access to the internet/lan . The one trick here is defining the mac address "macaddr=
, this needs to be done for each VM you inter connect to the switch, else all machines will get the same default mac address, the rest of the command is pure qemu and I leave that to the reader to figure out. 

Running multiple network interfaces

One last trick is running qemu-kde with vde and having eth[1-100].  The standard way of doing this is bring up multiple vde_switch daemons and connect to the different UNIX sockets of the multiple switch daemons and set up multiple bridges to connect to which switches and etc .  This can get very complex very fast and in most cases it is not needed.  The quick way to do this is to use the vlan=X option in vde and use the same vde_switch for each vlan option , a example :
vdeq qemu-kvm -curses -drive file=/space/images/linux-amd64-1.img,cache=none,if=virtio,snapshot=off,boot=on -smp 2 -m 1G -monitor telnet:127.0.0.1:9222,server,nowait -net vde,vlan=0 -net nic,model=virtio,vlan=0,macaddr=52:54:00:00:AA:03 -net vde,vlan=1 -net nic,model=virtio,vlan=1,macaddr=52:54:00:00:AA:04
Note the vlan=0 and vlan=1, this creates a different interface for the qemu-kvm and rides the networks on the same vde_switch, IE you networks can not conflict for this to work address/subnets/netmasks but if that is clean , as it should be, you will be running two/3/4 different networks on the same switch  ( There may be security issues with this and thus you may be forced not to do this ) .  The vlan= option gives you a easy way to simulate multiple networks between multiple VM's .

Summay

Using vde with qemu-kvm will simplify putting many qemu-kvm machines up on the same machine and make networking very straight forward for the VM's and the hosting machine.  For me its a breath of fresh air for networking simple and direct.  Anyone with any other networking gems for Linux ? Any other experiences with vde/qemu/kvm ?

Friday, August 20, 2010

Moving to corosync and pacemaker

After using Heartbeat 1.X for the last 4 years, it looked like it was time to move to the next generation. Heartbeat it's self is no longer the package it was, thus in looking at the projects out there Corosync with Pacemaker seems like the future.

Using Heartbeat

Most of the machines using Heartbeat were just 2 machine quorum type clusters sharing IP(s) between them, thus this should be a simple move, ya right not. The move to XML and configure options hell and poor examples made this a bit harder then you might think, not that Heartbeat was ever easy.  When Heartbeat would burn you it would burn hard because these were machines that were never to go down, and that is always the problem upgrading machines that were never to go down.

Finding the documentation

The heartbeat web site is mostly not being maintained any more and for the 2.X versions the doc well sucked. Corosync corosync.org site looked very nice and does give you enough to get Corosysnc up but not much else. Pacemaker site http://clusterlabs.org/ is good but there are so many options and the doc goes on and on, so it is useful but as a intro doc NOT. So it's off to Google to go looking through this and that to put something together that will get this going.

Working with and making it work

Heartbeat 1.X was only for 2 machine cluster configurations but Corosync/Pacemaker was for much more, which makes it much more interesting and challenging to work with.   In learning the configurations options of Corosync and Pacemaker I was faced with understanding the flexibility and expandability of the 2 products thus making it a slow process.  To start things you first have to get Corosync up.  Corosync has a standard configuration file /etc/corosync/corosync.conf that has a stanza format which seems popular today note the totem stanza this is important.  
 Corosync.conf:
compatibility: whitetank

totem {
        version: 2
        secauth: on
threads: 0
        interface {
                ringnumber: 0
                bindnetaddr: 192.168.254.2
                mcastaddr: 226.94.1.1
                mcastport: 5405
        }
}

logging {
        fileline: off
        to_stderr: no
        to_logfile: yes
        to_syslog: yes
        logfile: /var/log/cluster/corosync.log
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
        }
}

amf {
        mode: disabled
}
aisexec {
    user:  root
    group: root
}
service {
   name: pacemaker
   ver: 0
}



The thing to understand here is that Corosync is the networking part of the puzzle , so it's configuration cares about IP's address and secure communications and who is in the cluster at a communications layer only.  It does launch Pacemaker but that is it for the applications side .  There is still a lot of info to take in here and lots of ways to configure Corosync but I'm not going to talk about that all.

Pacemaker config overview
  
Pacemaker does not have a configurations file, it has a command line interface called crm.   Crm has it's own command language that can be used as a one line command or in a shell format.  That said I only want to talk about the new concepts that Pacemaker brings.  Pacemaker has this idea of having many cluster machines in it's cluster thus how do you control what application runs on what machine .  This is done with a priority # system that you can effect with it's control language.

group gr_haproxy IP_haproxy cf_haproxy \
        meta target-role="Started"
location cli-prefer-gr_haproxy gr_haproxy \
        rule $id="cli-prefer-rule-gr_haproxy" inf: #uname eq lb08
location loc_IP_bcom IP_bcom 75: lb08


This cut of control language defines a group , which ties together objects applications to run in a order and on the same machine.  The statement locations is a more direct way influence applications to run on a defined machine in example statements I am changing the priority # to move the applications to the LB08 machine.  There are also order statements to better order how applications should be started and what depends on what.  

A work in progress
   
So far so good as they say, I have converted our old Heartbeat machines to new Corosync/Pacemaker on about 5 clusters, with out real issues and I am  so far impressed with it's workings and speed.  I am still working on understanding how to take advantage of the power of this pair and as always looking for help , any comments or hints out there ?

Monday, June 7, 2010

Using Bluetooth on Linux

I love Linux in most cases but the bluetooth package on Linux BlueZ is just a mess. The first problem was because of a rewrite of BlueZ product to run under Dbus and UDEV and then it was expected that the applications developers would come and build GUI apps for it but the only app seems to be blueman and a kde one, and blueman sucks and I just refuse to build out kde any more, being the massive thing it is .


BlueZ http://bluez.org has like no documentation, now connecting a strange device is never easy but with no documentation it just sucks, and the debug flags are there but don't produce very many messages thus setting this up again sucks. Now if you google this you will not find a hole lot of current documentation, yes lots of doc for the old bluez but almost nothing for the new bluez.

I have connected in the past and current GPS devices using BT and rfcomm and this still seems to work without issues, but just try to create a network using pand with GN, OMG a little doc would be nice. After 2 days of work I got it working and it wasn't that hard, but if you Google stuff like this you just get people stuck in the networking end which is easy, but not the BT connecting end which is all magic with no doc. It turns out that the new Bluez still has the old daemons and utils in it, on Gentoo you need some magic flags and out they come. Now with the old daemons and utils it kinda follows the old documents and some new documents and there are even a few examples and up comes a network. The one thing that took me 2 hours was figuring out that you need to run something like a simple-agent as root on the server machine to auth the connection. Once that was found up came the network and it works, the rest is just normal Linux routing/networking which is normal/easy for me.

Of course where is my document for all of this ?  I'm just keeping it in a safe place for now ...

Some wastland posts

Some wastland posts