whew, another upgrade!

Yup, after months and months of downloading high-def movies….

The original specs of my PC was not really feasible after all. A single movie can size from 4.4 GB (least quality I say, 720p) to 18Gb (as a super blue-ray replication,1080p) and not to mention my all-time favorite TV series like Big Bang Theory, Glee, Chuck and Outsourced (too bad cause no more second season!) which all of them are also in a 720p HD. Last week my 1 TB drive was already out of disk space and most of the other drives are also running out of space :(

So I was forced to buy another drive for these things and luckily I had a lot of SATA slots left  in my board. Also, to save me from another upgrade (as I estimate for another 3-4 months from this day) I needed lot of space as in lot of space. Good thing the price of computer hardware are getting down reasonably. So here it is… my new Western Digital 2 TB drive.

But I had to fix my cabling first..

After that I can re-install all of my drives again

I already collected all Western Digital desktop drive series from the Blue , Green and the high performance Black edition which originally my OS drive. But I was stumbled when I discovered having a 2 pieces of value series Blue edition with RAID O configuration was twice faster as the Black one so I decided to make it just for storage drive.

Green Edition drive is Eco Friendly and consumes less than the two editions. But its also friendly to performance degradation. Oh well, I will just use it as my Movies storage drive anyway.

With a Dual-Processor onboard the drive, this is beast! with average speed not less than 100 mb/s and notice the latency/access time its really fast. If I can buy 2 of these and make it in RAID 0 this is one hell of a drive. Too bad the price of this one was more expensive than my new 2TB drive.. can you imagine that!

The Cheapest of them all (even combining the price of the two drives) and also the most fastest of them all. No doubt this is a real deal for SSD alternatives!!! just take a look on the minimum speed of it.. never touched down the 100 mb/s mark! and the burst rate- 3.8 GB/s (that can almost transfer a DVD ISO movie per second)

Atom 330 Fanless server

Wondering what’s all about the title?

Nearly 4 weeks ago I noticed my server was getting slow even having minimal load so I tried to check if my disk was already full which turns out its not. Though my desktop PC and my server is only less than 2 meters apart (besides I can see the server based on my sitting position when I’m in front of my desktop PC) I don’t really go to my server to check it physically besides having there running continously for more than 3 years already. So I installed a cpu temp diagnostic software and I saw the cpu was running between 50-60 and sometimes peaking to 65 degrees Celcius. But I didn’t get my attention because I knew summer season was started already and based on past experiences if its not running in an airconditioned room its a normal temp. Then early this morning something “seriously” happened….

I was about to prepare installing SQL Server 2008 R2 Express Edition (that’s right folks, I’m using the CLEAN and FREE MS SQL Server !! so nothing to worry about Piracy right?), running SQL Server before really bothers me especially eating almost 50% of my entire RAM so I decided to check my server if its all normal both “digitally and physically”. When I was going to put my finger to the CPU heatsink I noticed the temperature inside the server casing was not normal, then at the point I already touched the heatsink I was shocked and suprised- It’s fu@#$%ng HOT!!!, as in super HOT!!!. So I grab a flashlight to see whats going on until I stumbled to saw that the CPU Fan was not working at all!.

I instantly grab the power plug and pulled it off (sorry, I can’t imagine to go to my desktop PC and do some RDP to shutdown the server there). I took my time thinking and wondering how the hell the server survived that long without active (and passive) cooling given the point the room temp average was 30-39 Celcius. I made a conclusion to when the fan started failing and why. This is my 3rd generation and was also the longest running server-without-failure I had, fans have a life too so maybe it was his time to retire. Problem was he didn’t gave me notice (kidding) and really it was all my fault.

So.. what’s this blog all about- The extreme powerness of my Intel Atom 330! @ Php 3,500 pesos when I purchased it 3 years ago (including the Intel board and built-in graphics) it wont let you down.

Besides being the most eco-friendly server I had and the cpu was consuming only 8 watts plus 20 watts on the chipset, it was the most versatile low-power reliable processor I known. Intel should also give a credit to me for being one of the first person to implement a “micro-server” architecture long before they started to marketed it.

For now, I replace the defective CPU fan with “extrenal” active cooling solution. take a look below

My Atom 330 fanless server

My Atom 330 fanless server

If you noticed the small fan at the foreground-rightmost part of the picture that was the original CPU fan installed on the heatsink. Anyway, that will work for now :D

SMS class for GSM programming

This will be my first VB.net posting as far as I could remember.
After several hours of trial and error (good thing I had unlimited sms plan for this one) I successfully able to get it work properly. This was also my first USB programming experience. Well due to the strict “language requirements” by the academe people I’ve initially written this class from C# where it all began then converted them to a usable and clean code in VB.net. There are plenty of codes out there that tackles SMS/GSM programming. But I could not find a well suitable, as simple as possible,  stable and reliable code for VB.net. As a lot of people say that its easy for them to communicate with GSM Modems as long as you know the fundamentals of AT commands but I found more issues to consider before and one of them was getting the status result from the Phone provider after sending SMS from the modem. So here it is…

'///////////////////////////////////////////////
'SMS Class
'
' Class for sending SMS with return status
' (C)opyright 2011 by www.michael-yap.com
' All Rights Reserved.
'///////////////////////////////////////////////
 
Option Explicit On
Imports System
Imports System.Threading
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.IO.Ports
 
Public Class SMS
    Private WithEvents SMSPort As SerialPort
    Public receiveNow As AutoResetEvent
 
    Public Sub New(ByRef COMMPORT As String)
        receiveNow = New AutoResetEvent(False)
 
        SMSPort = New SerialPort
        With SMSPort
            .PortName = COMMPORT
            .BaudRate = 9600
            .Parity = Parity.None
            .DataBits = 8
            .StopBits = StopBits.One
            .Handshake = Handshake.RequestToSend
            .DtrEnable = True
            .RtsEnable = True
            .NewLine = vbCrLf
        End With
 
        AddHandler SMSPort.DataReceived, AddressOf port_DataReceived
 
    End Sub
 
    Public Sub SendSMS(ByVal CellNumber As String,
        ByVal SMSMessage As String)
        Dim MyMessage As String = Nothing
        'Check if Message Length < = 160
 
        If SMSMessage.Length <= 160 Then             MyMessage = SMSMessage         Else             MyMessage = Mid(SMSMessage, 1, 160)         End If         If IsOpen = True Then             Dim recievedData As String = ExecCommand("AT", 300, "No phone connected")             recievedData = ExecCommand("AT+CMGF=1", 300, "Failed to set message format.")             Dim command As String = "AT+CMGS=" & CellNumber & vbCr             recievedData = ExecCommand(command, 300, "Failed to accept phoneNo")             command = MyMessage + Char.ConvertFromUtf32(26) + "\r"             recievedData = ExecCommand(command, 4000, "Failed to send message")         End If     End Sub     Private Function ExecCommand(ByVal command As String, ByVal responseTimeout As Integer, ByVal errorMessage As String) As String         Try             SMSPort.DiscardOutBuffer()             SMSPort.DiscardInBuffer()             receiveNow.Reset()             SMSPort.WriteLine(command)             Dim input As String = ReadResponse(responseTimeout)             If ((input.Length = 0) Or ((Not input.EndsWith("> ")) And (Not input.Contains("OK")))) Then
                Throw New ApplicationException("No success message was received.")
            End If
 
            Return input
 
        Catch ex As Exception
            Throw ex
        End Try
 
    End Function
 
    Private Sub port_DataReceived(ByVal sender As Object, e As SerialDataReceivedEventArgs)
        Try
            If e.EventType = SerialData.Chars Then
                receiveNow.Set()
            End If
        Catch ex As Exception
 
        End Try
    End Sub
 
    Public Function ReadResponse(ByVal timeout As Integer) As String
        Dim buffer As String = String.Empty
 
        Try
            Do While (Not buffer.Contains("OK") And Not buffer.EndsWith("> ") And Not buffer.Contains("ERROR"))
                If receiveNow.WaitOne(timeout, False) Then
                    Thread.Sleep(500) ' you need to adjust this settings depending on how your modem can
                                              ' able to get response to the provider, its recommended also to use the
                                              ' thread timeout instead of adding this. sorry its a quick fix :(
                    buffer += SMSPort.ReadExisting()
                Else
                    If (buffer.Length > 0) Then
                        Throw New ApplicationException("Response received is incomplete.")
                    Else
                        Throw New ApplicationException("No data received from phone.")
                    End If
                End If
 
            Loop
 
        Catch ex As Exception
            Throw ex
        End Try
 
        Return buffer
    End Function
 
    Public ReadOnly Property IsOpen() As Boolean
        Get
            If SMSPort.IsOpen = True Then
                IsOpen = True
            Else
                IsOpen = False
            End If
        End Get
    End Property
 
    Public Sub Open()
        If IsOpen = False Then
            SMSPort.Open()
        End If
    End Sub
 
    Public Sub Close()
        If IsOpen = True Then
            SMSPort.Close()
        End If
    End Sub
 
End Class

a sample usage will be

            'send sms
            Dim Retries as Integer=1
            Dim SMSEngine = New SMS("COM3") 'replace with your actual modem USB/Serial Port
            Dim validnumber as String = "+639221234567" ' replace with your number, be sure it includes
                                                                          ' the country code
 
            SMSEngine.Open()
 
            Try
                SMSEngine.SendSMS(validnumber, textmessage)
            Catch ex As Exception
                If Retries >= 3 Then
                    Console.Write("Failed after 3 retries: " & ex.Message) 'you can customize this base on the failed result status
                Else
                    Retries + = 1
                End If
            End Try
 
            SMSEngine.Close()

BTW: I used Wavecom Fastrack GSM USB Modem as my SMS gateway.