Thursday, 22 November 2007

GPL3 Questions and Implications

It has been suggested by Shane Martin Coughlan following a gently heated discussion on the discussion@fsfeurope.org mailing list, that a collection of questions relating to the GPL3 be collated and put to the FSF authors.

* Shane Martin Coughlan wrote, On 21/11/07 20:14:
Suggestion:

How about we make a list of concerns that people have and I email BrettSmith with them? That way we consolidate the concerns into onesubmission and potentially speed up the process of obtaining answers.MJ, Sam, perhaps you could coordinate the list of questions.

This page is setup for that purpose.

Readers: feel free to add comments or questions relating to GPL3 or AGPL, a compilation of which will be sent to Brett Smith by Shane.

My personal proposal is the creation of a list of implications of choosing a specific license to help prospective licensors choose (or avoid) a license according to their requirements.

My proposed implication is:

The GPL is widely considered a share-alike license where licensors have understood that the same terms will propagate throughout the distribution chain.

With the GPL3 this is not true: at some time in the distribution chain, derived works may have certain additional restrictions added, thus licensing the combined work under the AGPL such that when an original contributor receives the derived work with enhancements to his own work, he may not distribute any combination of his work with any of those enhancements unless he does so with the additional restrictions of the AGPL.
If the licensor finds this disparity objectionable then he may prefer to use the GPL2.

I believe that this implication is not widely understood and because ealier versions of the GPL are widely known to prohibit the addition of extra restrictions, this implication is also unexpected.

Wednesday, 14 November 2007

Derek Cooper Special Award 2007

Here’s my nomination for the Food and Farming Awards 2007 Derek Cooper Special Award

Ray Gunge
Hardtack Hall, Hardtack Lane, Noshleigh
(no phone number, sorry)

With long service to the nation as chairman of the British Catering Council and other industry associations, and awarded the Confrerie des Snacquevins, few can have done more to make a healthy diet more important to the nation, or a varied diet more interesting.

Rather than continuously trotting out last years healthy but but unwelcome fad, Ray has always been at the forefront of culinary development and research, but so as to keep it relevant to the changing fashions and demands of the consumer.

Unlike many academic experts Ray has practiced this philosophy across the entire range of food establishments, un-abashed by ill-informed criticism, and without pandering to the artificial requirements of many so-called food awards, he has worked tirelessly to bring his vision of making quality food available to the paying masses in a way that they can appreciate.

His story is well known to Mr Cooper and it it is hoped that jealous parties have been prevented from infiltrating the selection committee this year, where they have so often prevented Mr Gunge from receiving deserved and much over-due recognition.

His story should be dramatized and re-told on BBC radio.

Think about it, and God bless!

Published selected episodes from the life of Ray Gunge sold out, but discerning and appreciative readers will no doubt manage to get a copy of this well written account.

Wednesday, 19 September 2007

Can Black Rod Prevent Tasered Students?

International websites, and American TV news have all covered the incident where a student was tasered by American police while resisting officers who tried to prevent him asking a long rambling political question, even after John Kerry being asked the question said he would answer.

Whatever your take on this particular situation, this is the continuation of bad trend that started before designation "safe protest zones" well away from the political figuring being protested to.

So how can Black Rod save the day? The answer lies in the power of political ritual and ceremony to keep certain ideas alive.
Purloining freely from Wikipedia:

State Opening of Parliament


Black Rod is best known for his part in the ceremonies surrounding the State Opening of Parliament and the Throne speech. He summons the Commons to attend the speech and leads them to the Lords. As part of the ritual, as Black Rod approaches the doors to the chamber of the House of Commons to make his summons, they are slammed in his face. This is to symbolise the Commons’ independence of the Sovereign. Black Rod then strikes the door three times with his staff, and in reply to the challenge "Who is there?" answers "Black Rod". He is then admitted and issues the summons of the monarch to attend. This ritual is derived from the attempt by Charles I of England to arrest five members in 1642, in what was seen as a breach of privilege, though strictly the King was entitled to enter the chamber. After that incident, the House of Commons has maintained its right to question the right of the monarch’s representative to enter their chamber, though they can not bar him from entering with lawful authority.

The ceremony maintains the right.

From this day forth, a new tradition (like the famous Slashdot "first post") must begin.

The first question asked at any political rally, or convention must be a ceremonial question:"The police aren’t going to arrest or taser us if we ask unpopular questions, are they?"

Let the asking of this ceremonial question be offered to distinguished guests as a token of politeness, or to student body presidents, or the rotary club president, or the mayor.

And then the police, or the host will give the ceremonial answer: "No, not even if you are courteous or impolite, but we respectfully ask you to be courteous and polite to our guests and others present".

Maybe the questions need improvement, but the main thing is that it happens.

Make it happen, have the suggestion posted in every student handbook and newspaper, have it asked every time.

The maintenance of your liberty depends on the regular performance of this new ceremony.

New Lyrics


Lyrics to "He’s not Heavy. He’s my brother", anyone want to make a recording?

To the tune of "He ain’t heavy"

I may be wrong
with many a foolish thought
that leads me to who
  knows where
who knows where
If I’m wrong
show me that you care
please don’t taze me, please my brother

I hope you know
I welcome your point of view
don’t have to agree
to hear
or to share

for I know
the law preserves our liberty
please don’t taze me, please me brother

If I’m learning
  at all
I’m learning
  with sadness
that every tyrants heart
is-a filled with the badness
and hate
for free opinion

it’s a long long road
I fear there is no return
and we’re on the way
to hell
were nearly there

and the law
shouldn’t weigh us down at all
please don’t taze me, please me brother

( please my brother

  please don’t taze me

  please my brother
)

Wednesday, 18 July 2007

UPDATE: Fix status timeout: status=0xd0 { Busy }

I got a nice Acer laptop for not much from PC World, but it has a sucky TSSTcorpCD/DVDW TS-L632D, ATAPI  CD/DVD-ROM drive. The manufacturers have released a firmware update, but not for my OEM. Bah!

Gareth and Gareth have explained how to do a firmware update which (as it works for me) is a better solution:

See https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/75295

My own solution below is buggy and prone to calling the atapi reset TWICE (hanging the machine). I have a fix (not with me as I edit this now) which prevents the atapi reset being called twice in one minute, but I think the better solution is the firmware update.

As a consequence if the moon shakes a bit too much or one of the electrons gets a bit too hot, the CDROM drive stops responding. For windows users it disappears from My Computer altogether and they have to reboot.

Linux users are both better and worse off. Worse because the system hangs 4 seconds out of 5 and the syslog fills up with messages like "/dev/hdc: status timeout: status=0xd0 { Busy }"

If you can bear to slowly get a command window, a bit of "sudo hdparm -w /dev/hdc" will fix it, but thats too painful.

So, this script will fix it. You need to modify /etc/syslog.conf to add this line "kern.* /var/log/kern.fifo" to log kernel messages to a named pipe from which the script will read.

Install the script in /usr/local/sbin/fixhdc, and run it from /etc/rc.local with: "setsid /usr/local/sbin/fixhdc &"

#! /bin/bash
# /usr/local/sbin/fixhdc
# by Sam Liddicott
# Monitor kernel messages to see if the cdrom is jiggered
# If so do an atapi reset
# First add this line to /etc/syslog.conf
# kern.* /var/log/kern.fifo
# Then run this script from /etc/rc.local with:
# setsid /usr/local/sbin/fixhdc &

KERNFIFO=/var/log/kern.fifo
CDROM=hdc

CDROM_NODE="/dev/$CDROM"

daemon() {
  while read logline
  do
    case "$logline" in
      *"$CDROM: status timeout: status=0xd0 { Busy }"*)
        hdparm -w "$CDROM_NODE"
        logger -t ‘kern.crit’ — "$0 reset $CDROM"
      ;;
      *) echo "Ignore $logline";;
    esac
  done
}

while :
do
  if test -p "$KERNFIFO" || mkfifo "$KERNFIFO"
  then daemon < "$KERNFIFO" &
       # restart syslog now we have the pipe open
       /etc/init.d/sysklogd reload
       # it probably won’t finish till syslog does
       wait
       logger — "Restarting $0"
  else echo "Can’t make fifo $KERNFIFO"
       exit 1
  fi
done

Thursday, 12 July 2007

Windows-only IP camera on linux

I got a nice panning VGA camera for £69.00, but it’s one of those cameras from hell that only supports internet explorer on windows and crashes windows a lot.

As far as I can tell generically it is an SQ IP Cam or a GP-280 IP Camera.

I want to use it on linux, so out comes ethereal to do some packet sniffing and here is what I get:

I can get a video stream (special header and concatenated JPEG’s) with this URL:

http://192.168.1.69/cgi-bin/Stream?Video?Acc=USERNAME?Pwd=PASSWORD?webcamPWD=RookCookies00000

Possibly the RootCookies bit is important, perhaps related to a login that occurred earlier.

I can move the camera wth:
http://192.168.1.69/motor_control_right?webcamPWD=RootCookie00000

http://192.168.1.69/motor_control_left?webcamPWD=RootCookie00000

http://192.168.1.69/motor_control_up?webcamPWD=RootCookie00000

http://192.168.1.69/motor_control_down?webcamPWD=RootCookie00000

For horizontal and vertical centre

http://192.168.1.69/motor_control_auto_h?webcamPWD=RootCookie00000

http://192.168.1.69/motor_control_auto_v?webcamPWD=RootCookie00000

Full centre

http://192.168.1.69/motor_control_center?webcamPWD=RootCookie00000

To stop

http://192.168.1.69/motor_control_stop?webcamPWD=RootCookie00000

The special header on the video stream is a 40 byte header. I’m expecting certain values so they were easy to find:

Stream Header
Offset Format Data
0×16-0×17 16 bit integer LSB size of jpeg in bytes, or in other words, the number of bytes to read after this header before the start of the next header
0×1a-0×1b 16 bit integer LSB jpeg width in pixels
0×1c-0×1d 16 bit integer LSB jpeg height in pixels
0×28- Start of JPEG header

So stripping off the first 40 byte with
dd if=stream of=1.jpeg bs=1 skip=40

leaves me a jpeg (with loads more jpegs on the end, ech prefixed by the same 28 byte header).

So I can control the camera and rip video from it, now to make it like zoneminder.

UPDATE:

I can watch a video stream with VLC using:

wget -O /dev/stdout http://192.168.1.69/cgi-bin/Stream?Video?Acc=USERNAME?Pwd=PASSWORD?webcamPWD=RookCookies00000 |dd  skip=40 bs=1 | vlc -

I modified axmjpeg so it can split images from my camera too.

Update: 20 Sept 2007
This patch has been reworked applied to the standard axmjpeg project. (a while ago!)

This script can be used to control the camera from zoneminder:

#! /bin/bash
preset=home
presets="nothing motor_control_auto_h motor_control_auto_v motor_control_stop motor_control_center"

while test -n "$1"
do
  case "$1" in
    --address=*) address="${1##--address=}";;
    --address)   address="$2"; shift;;
    --command=*) command="${1##--command=}";;
    --command)   command="$2"; shift;;
    --preset=*)  preset="${1##--command=}";;
    --preset)    preset="$2"; shift;;
  esac
  shift;
done

url_base="http://$address/"
url_tail="?webcamPWD=RootCookie00000"

case "$command" in
  # home goto
  preset_home) url_command="motor_control_center";;
  preset_goto) set $presets; shift "$preset"; url_command="$1";;
  # right left down up
  move_rel_*) url_command="motor_control_${command##move_rel_}" ;;
esac

url="$url_base$url_command$url_tail"
wget -O /dev/null "$url" 2>/dev/null


UPDATE snapshot

I found a URL that can be used for a single snapshot (based on this http://ultradigital.freshdesk.com/support/solutions/articles/77478-comment-acc-der-au-flux-vid-o-d-une-cam-ra-ip-9060-i-9060-o-ou-9060a-mp):

http://192.168.1.69/snapshot.jpg?account=admin&password=password

Also related source code here: http://read.pudn.com/downloads65/sourcecode/internet/webserver/235705/Net_apps/httpd/api/HttpFileSystem.c__.htm

UPDATE streaming

I can play the stream like this:

ffplay -f mjpeg -probesize 40 -i 'http://192.168.1.69/cgi-bin/Stream?Video?Acc=admin?Pwd=password?webcamPWD=RookCookies00000&f=file.mjpg'

tip from http://www.lavrsen.dk/foswiki/bin/view/Motion/MplayerMjpegStreamViewing

but it seems more reliable to use axmjpeg to remove the extra data and output just a concatenation of jpegs:

axmjpeg -N -o /dev/stdout  'http://192.168.1.69/cgi-bin/Stream?Video?Acc=admin?Pwd=password?webcamPWD=RookCookies00000' | ffplay -f mjpeg /dev/stdin

Wednesday, 27 June 2007

$150 Bounty: 0402:5602 m560x webcam driver

I bought a fancy refurbished Acer laptop at a nice price. Ubuntu Feisty Fawn likes it all except the webcam, which is identified as 0402:5602, also known as m560x.

Well, I want it to work. I also want to improve the linux kernel, but I won’t be the one writing the driver, so instead I’ll use some of what I saved on this laptop to offer a bounty to the chap who does it.

I’ll pay by paypal $150 when Greg Kroah-Hartman of the usb-devel mailing list, or one of his deputies (e.g. Jiri Kosina) accepts working patches for this webcam and commits them for the upstream kernel; and where with the said patches I can get xawtv, ekiga and the like to enjoy the video source. like any other standard video source. The patches must be licensed under the GPL2, or GPL2 or later. The author retains copyright (naturally) or assigns it to the FSF.

To qualify, the patch, and earlier patch candidates (yes, they will make you tweak it and re-submit) must be submitted on the usb-devel mailing list, and excepting complications, the paypal payment will be to the email address comprising the Signed-off line in the patch submitted on said mailing list. I’ll split the bounty as joint contributors can agree or failing that, at my discretion. I expect one developer will leave a clear trail on the mailing list, terminating with the accepted patch, making recognition of the deserving author and subsequent payment easy.

The bounty offer will end after a valid claim has been made.

In any case it’s my intent to pay up to $150 to encourage development of such a driver and to pay it to those who write it and release it for kernel.

(It’s been suggested that this may involve working on sane-devel as well as usb-devel, in which case patches may need to be accepted for upstream submission by maintainers of both projects to qualify).

Information for starters:

Of course I’ll post the bounty notice in some of these places too.

UPDATE
I’m advised by one of the developers that more likely two drivers, m5602 and m5603 will hit the kernel; unknown timescales.
As long as the 5602 is supported I don’t mind splitting the bounty fairly between contributors of both drivers; in my view it is a common work that is now more conveniently expressed as two modules instead of one.
I expect other contributors will feel the same was as long as their device is supported.

Wednesday, 20 June 2007

Terminal Servers

I recently bought a Chase IOLAN RACK+ on ebay, only to find the built in switched mode PSU was clicking away like a broken thing.

The vendor generously offered a refund and let me keep it to repair or dipose of.

I then bought what I thought was another Chase IOLAN RACK+, but it fact it was the non-rack DB25 version with external PSU.

I decided they probably had the same voltages, so I could swap the PSU around, and with a bit of metal bending get things working for the RACK model.

While prodding the RACK+ PSU with my voltmeter to work out how to splice in the new PSU it suddenly started working; I guess the problem is most likely dry joints.

Next I find that my RJ45-DB9 cisco console cables don’t work. I find the Cisco pinout at http://www.technick.net/public/code/cp_dpage.php?aiocp_dp=pincabser_cisco_9 and by conferring with the Chase manual, come up with this  colour mapping.

IOLAN / Cisco Cable mappings
IOLAN CISCO RJ45 Names RJ45 DB9 DB9 Names
2 Black RTS 1 8 CST
8 Brown DTR 2 6 DSR
4 Red TXD 3 2 RXD
6 Orange GND 4 5 GND
  Yellow GND 5 5 GND
5 Green RXD 6 3 TXD
3 Blue DSR 7 4 DTR
7 White/Grey CTS 8 7 RTS

I cut off the RJ45 from the Cisco cables and make my own, which work fine!

So, as I crimp on a new RJ45, my colour mapping is:
NONE, BLACK, BLUE RED GREEN ORANGE WHITE BROWN
with yellow dangling/

Hurrah! I can now control 16 devices at once using debian’s cylcades-serial-client; all much more satisfactory that USB com ports which have given me no end of trouble.