Archive

Archive for July, 2011

Dual boot Windows7 and Ubuntu on my Netbook

17 July 2011 Leave a comment

Added Linux to my Netbook that came with Windows pre-installed.

As I use mostly Linux at home, but occasionaly need Windows (e.g my plugwise gadgets came with a windows only software). As I do not want to install ‘home’ software on my Windows 7  ‘work’  laptop, I decided to keep this Windows on a small partition, as I paid for it’s license anyway, and could be usefull.

This Windows 7 is a ‘starter edition’, i.e. cheap, but did not encounter a real limitation. Well I can not ‘RDP’  into it, but that is also not possible with the Windows 7 home versions.

Well, next step was to get Ubuntu Linux on it (I use that version on my ‘main’ home desktop computer). To not re-invent the wheel while making it dual-boot, I looked for and found a nice tutorial for this. Must say it works well that way.

The basic steps involved are:

  • Shrink the windows partition to a workable minimum to make room for the linux partitions.
  • Install EasyBCD in windows to configure the windows bootmanager
  • Install ubuntu, make sure to put ‘grub’ in the linux bootpartition, not the disk bootsector
  • Add ubuntu to the windows bootmanager (and make it the default)

Job done…

I made this entry, so I can find the tutorial again, just in case I need it.

 

PS.

A restriction in Excel 2010 Starter I bumbed into was that there is no option to connect to an SQL or Access database. Well this is ‘advanced’  usage, so logical it is missing.

Advertisements
Categories: Linux, Windows

Plugwise Protocol Analysis, Part 5 (Date/Time)

3 July 2011 4 comments

More and more details become clear in the plugwise protocol. In Plugwise Unleased Maarten made this post, that describes a timesync between the modules and the computer. There is also a second DateTime format in use.

I also found a third field, that is also represent a time format. This is in the 003F response and the 0016 command.

In this post I describe what I found for future reference. I use color to make references to the same type of timestamp more clear. To make the messages fit, I removed the MAC-addresses ((…) in those commands.

Date-time format – Packed for archive

This date-time format is used when storing data in the buffers for data logging. It only registers down to the minute level. This is sufficient, as the data is archived on an hourly base, i.e. the power consumption of a device is measured for one hour and the accumulated power usage for that hour is archived. Commands that use this format are 0016/0000 and 0023/0024.

SEND    0016 ... 0B0540DB FFFFFFFF FFFF 0C2B13 04    [2011-05-12 12:43 UTC]
RECV    0000 ...

SEND    0023 ...
RECV    0024 ... 0B0540DB 00045278 01 85 653907014023 4CCEC0C2 02    [2011-05-12 12:43 UTC]

The Archive DateTime ‘stamp’ is used in the read-buffer sequence 0048/0049

SEND    0048 ... 00045140
RECV    0049 ... 0B05378C 00002564 0B0537C8 00002574 0B053804 0000259E 0B053840 00002592 00045140

Codesample in VBscript to decode this (e.g: 0B05378C)

Function DecodePWpackeddate(ByVal strPWdate) 
Dim intYear, intMonth, lngMinutesMonth 
Dim intDay, intHour, intMinute 
If strPWdate <> "FFFFFFFF" Then 
intYear = CInt("&H" & Mid(strPWdate,1,2)) + 2000 
intMonth = CInt("&H" & Mid(strPWdate,3,2)) 
lngMinutesMonth = CLng("&H" & Mid(strPWdate,5,4)) 
intDay = CInt(lngMinutesMonth \ (60*24) ) +1 
intMinute = CInt(lngMinutesMonth Mod (60*24) ) 
intHour = CInt(intMinute \ 60) 
intMinute = CInt(intMinute Mod 60) 
DecodePWpackeddate = (intYear) & "-" & Right(("00" & intMonth),2) &_ 
"-" & Right(("00" & intDay),2) & " " & Right(("00" & intHour),2) &_ 
":" & Right(("00" & intMinute),2) & " UTC" 
Else 
DecodePWpackeddate = "0000-00-00 00:00 UTC" '* no date 
End If 
End Function

DateTime format – ASCII-format

This format is used where more real-time clock data is needed. You also have seconds resolution. The  04 is a weekday indicator (already documented my Maarten, who documented this earlier. I did read that, but forgot when writing this entry).

SEND    0028 ... 194312 04 120511    [2011-05-12 12:43:19 UTC]
RECV    0000 ...

SEND    0029 ...
RECV    003A ... 204312 04 120511    [2011-05-12 12:43:20 UTC]

DateTime format – HEX-format

Below the command and reply (to a different command), 0016 / 003F that also has time information, but this time a different notation. Now there are three groups of hex-numbers that (after conversion to decimal) are hh, mm ss values. I have marked them in pink. The 04 value here is again a Day of Week value.

SEND    0016 … 0B0540DB FFFFFFFF FFFF 0C2B13 04

RECV    0000 ...

SEND    003E ...
RECV    003F ... 0C2B15 04 01457A

Codesample in VBscript

Function DecodeHexTime(ByVal strHexDoW, Byval strHexTime)
Dim intDoW
Dim intHour, intMinute, intSecond
intDoW = Cint("&H" & strHexDoW)
intHour = Cint("&H" & MID(strHexTime,1,2))
intMinute = Cint("&H" & MID(strHexTime,3,2))
intSecond = Cint("&H" & MID(strHexTime,5,2))
DecodeHexTime = Right(("00" & intHour),2) & ":" & Right(("00" &_
intMinute),2) & ":" & Right(("00" & intSecond),2) &_
" UTC (" & DayOfWeek(intDoW) & ")"
End Function

The other unknown value of the 003F response does not change much. I did see different values in 003F responses when setting a ‘schema’, but it’s meaning  is still a mystery for me.

So that concludes this post.

Categories: Domotica Tags: ,