Wednesday, December 31, 2014

It's new year eve again

Time fly, getting faster and faster, I still felt that yesterday is just the beginning of the year but tomorrow will be another new chapter.

What had I done in year 2014?

I left my partner and become a lonely ranger since this year. I understand no matter how great I am, I can't do everything alone, so I set up a company with few of my ex-colleagues to do PV business. Well, we manage to get few customers, but too bad that we can't proceed with the project due to SEDA quota. Anyway, we only secure a quota and manage to complete it successfully. On top of that, we finish few abandon project leftover from 2013. We are still struggling for next year and hope thing will go smooth.

My own business getting better as compared to early this year, thanks to all the people that giving their helping hand to pull me up from the deep shit. Economy getting slow nowadays, hope coming year wouldn't be too bad.

Then I have my second princess, she is just adorable. Now she is getting naughtier, must start to prepare cane now.

There are still plenty of hardwork I need to go through before I can start to rest. Time has become my most shorttage resources, capital is another one. But no worry, the spirit of cockroach is never die. No one can smash me down that easily.

There are many wishes I want to wish for year 2015; own my own office, better business, more time for my family, better cash flow, can have a long holiday, ...

Well, everyone will wish for the samething, so, maybe I should just stop wishing and start working. Hmm... let me rest for today and I come back in two days time.

WIsh you all happy and prosperous year 2015.

Saturday, July 26, 2014

Apa awak mahu lagi?

Me and most of the Bolehlander will never forget of what our newspaper put the similar title after the GE. So, what else you want? Its a frustrated question, lost communication, unsatisfied, and all those negative expressions. Basically, I am not asking the question, but I am answering it.

I had tried to post some blog since last few months, there are plenty of thoughts in my mind that I want to share with the world. But I just don't have time and correct timing to write it. This week is a long weekend for most of the people, but not for me, I got tonnes of works that I need to finish in coming week. Anyway, I just try to pamper myself to have some rest before I start to move forward.

Ok, so I have been working alone for almost 2 months, so far I still able to survive. Thanks to those friends that help me by giving me some jobs to start with, it is not a big amount, but at least I can survive with it. My time basically becomes very unpredictable, sometimes I may work at home for the whole day, and sometimes I went out to do work until late night. Sometimes these effort gives you rewards, sometimes it is just a free service. I actually start to calculate whether I am richer if I work as boss or I work as staff, and I start to value my daily rate. Those figures just slap my face. I even start to ask myself, am I insane? But I always know what I am doing, and I know my destination.

I know I will be an engineer since I was very young, and I'm happy that I manage to train myself an engineer. Now, my second question is what else I want?

I had watched the Astro documentation, its call Our Land 大地, it is about the life of Bolehland's farmers. After I saw these episodes I have to respect these farmers in holding their principle and when you look at them, are they rich? Why they are so happy with their work? It is actually very difficult to define rich, it is actually an analogy to saying very cool in physics. We all know cool is neither an energy nor a physics term, it is just a feeling; same to rich, how to define it? By money? Then how much of money is call rich? As rich as Ananda Kristnam, or as rich as Bill Gates or Warren Buffett?

When you watch those videos, you start to appreciate that money don't determine everything. Basically passion give you the energy to move forward, and the item that make you happy is not money, it is the result of what you had work on. A successful result moves you further, however a fall makes you stronger. If you ask what these farmers want, they will tell you, let them continue do what they are doing now.

So, now you know what I want? I just want to continue provide my expertise to the world, earn some money for my family, watch my daughters grow up to be a useful person to this world. Basically, these are what I want. I do not need to be very rich, but I hope that with my hands, I do not need to worry basic needs. I don't need to be like Elon Musk or Mark Zuckerberg, I just want to be an engineer that can help to bring a better life to this world.

So, apa awak mahu lagi?

Sunday, March 16, 2014

MH370

Yesterday news on MH370, a breakthrough, now all the evidences point to the pilot which also believe related to Anwar case. It never happens this way, and too bad it happens to my country. Now, everyone knows why it is neither plane crash nor terrorist activity.

If the pilot want to threaten the government, he can do it once the plane take off, but he didn't. But the question raised, if he tends to suicide, why don't he just drive the plane and crash into South China Sea? But he takes all the risks to turn back to the other side and fly through Bolehland?

Now the question is, which way he took? North or south? If he takes south, this is definitely a suicide activity, cause no one will know where this flight will landed, and no one can rescue them. But if you still think he will take south, then why don't he just take east in his original path when he is try to "disappear" the plane?

So, I believe he will take north. Now, the other question is, where he want to go? Why no one detect the flight? I believe the government already have the answer since yesterday.

I categorised the pilot in the genius zone, he knows what he is doing. If I will him and I want to suicide, I will take north. The reason is very simple, if the flight is being detected, it will be shot down by military. But if the pilot can successfully hide the flight and reach until last destination, he will be remembered as a very talented pilot, and every books will record this. All genius wants to be remembered how clever they are.

Anyway, I still hope it will be a happy ending, although the chances are extremely low.

Good luck MH370.

Wednesday, March 12, 2014

The perfect sunlight


Yesterday my small solar farm give me total of 19.338kWh of output for the day. It is so far the highest output I had recorded for the pass nearly a year. The chart shows totally no cloud yesterday, which is good news to the solar system, but bad news to all of us. We are missing the rain so much.

Based on my installation, which is 3 degree to south, the sun is nearly perpendicular to the module. We all know the equinox will be around 21/3, which is around 10 days from yesterday. Based on a simple calculation, each 6 months, sun move from the most northern part (26 deg to north) to most southern part (26 deg to south), which mean 52 degrees of changes over 6 months. For a year, it will be 104 degree changes over 365 days, therefore each day the sun move around 0.28 degree. As for yesterday the sun is around 0.28 x 10 = 2.8 degree at southern, which mean the sun is now perpendicular to my solar panels. That is the maximum solar irradiance that the panels can have.

Although it gives the best to my solar farm, but I really wish the rain can come soon, I miss the rain so much.

Monday, March 10, 2014

It's heavy weekend

I'm sick since Saturday, maybe due to haze or hot weather.

Saturday headline is a heavy news. I'm not side to any politics party, although I wish to change the ruling party last election. But, I saw very dirty and old trick sending the ruling party's greatest enemy to jail. I seriously doubt why someone is released few years back and get caught under the same accuses. Where is the consistency? Which is the correct one? Which story is real one? I don't know, but I believe this is not just a simple case, there must be some stories behind.

Then on the same day, our plane was lost in the air, until now we still don't know where is the plane, where are the 239 people gone. This tragedy is full with mystery. If this is a terrorist action, there must be a motifs and someone have to claim it, but until now, there is none. If it is a plane problem, the pilot sure will communicate with the centre, but the news said none, and the communication is lost and the weather is clear.

So, where is the plane now? What is happening? Any survival? Everyone want to know the answer, but I believe it will not be a good news. Unless the plane was "kidnapped" by alien and the alien return the human after they do some study. Anyway, just hope some miracles will arrive soon. Lets pray for MH370.

Thursday, February 13, 2014

Welcome to the family

Yes, my second princess, arrive 2 weeks early. I think she want angpao also since still Chinese New Year today.

Thanks to my wife so brave give birth naturally without any pain killer O.o

I wish my princess a happy Chinese New Year and hope you grow up happily and healthy.

Tuesday, February 11, 2014

The Humble Sid Meier Bundle


I'm a Civilization fans since I bought my very first PC when I was studying in highschool. It was the Civilization II that make me crazy about computer games. After Civilization II, I played few other series of Civilization, but time always not allow me to finish it.

This time Humble Bundle bring the Sid Meier series to everyone. Basically you just need to pay USD1 and you can have 5 Sid Meier's games, yes it is all genuine games. You may don't know who is Humble Bundle, you can read it here. Basically, it is a type of charity funding site. When you buy those games, part of the fees will be donated to the charity.

So, if you like Civilization games, or you want to try it, and at the same time you want to do some charity donation, you may go here to buy the title. I bought mine although I really don't know when I can have some spare time to play these games. Anyway, just few USD and I can have my favorite games and at the same time do some charity.

Tuesday, February 04, 2014

Plot.ly and Pi

I found Plotly since early last year, it is a very interesting online data visualization tool. I always want to use it for some logging purpose. So finally I got my Pi and I start to do a simple task, to log the CPU temperature, and here is the result.



I use Python as the programming language since it is the most famous language for Pi. If you new to Pi, here is the step to install Python.

  • sudo apt-get install python-dev
  • wget http://python-distribute.org/distribute_setup.py
  • python distribute_setup.py
  • wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
  • python get-pip.py
  • sudo pip install virtualenv

Once you have installed the Python on your Pi, the next task is to install plot.ly API.

  • pip install plotly

At the same time you can register an account with plot.ly in order to use their services.

Now everything is ready, and we need to create a Python program to get the temperature data and upload it to plot.ly. Before I continue, there is something about Python that you should know, especially C/C++ programmer.

First, you do not need to put semicolon (;) at the end of the line. It looks like a Basic code.
Second, do not mix tap and space. You will get an error if you mixed it.
Third, you do not need to declare the variable. Ok, it looks like Basic now.

I'm very new to Python with nearly zero knowledge about this language. Thanks to the Internet, you will get some examples to help you to get the code you needed.

So here is the code.

  • #!/usr/bin/env python
  • import plotly
  • import os
  • import subprocess
  • import datetime

  • def update_temp():
  •   py = plotly.plotly(username_or_email='YOUR_USERNAME', key='YOUR_API_KEY')
  •   i = datetime.datetime.now()
  •   proc = subprocess.Popen(["cat", "/sys/class/thermal/thermal_zone0/temp"], stdout=subprocess.PIPE)
  •   t = proc.stdout.read()
  •   r =  py.plot(i.strftime('%Y-%m-%d %H:%M:%S'),float(t)/1000,
  •   filename='RPiTempCont',
  •   fileopt='extend',
  •   layout={'title': 'Raspberry Pi Temperature Status'})

  • if __name__ == '__main__':
  •   import sys
  •   update_temp() 

So that is the code that get the current date, time and temperature and upload to your plot.ly account.

In order to do it automatically, you need to add the program to cron job. But before that you need to save the Python program to a location. For my case, I put it at

  • /home/pi/scripts/

To add the task to cron, you need the following commands

  • crontab -e

Then add the task

  • */10 * * * * usr/home/python /home/pi/scripts/YOUR_PYTHON_FILE.py > /dev/null

What it does is to run the Python program every 10 minutes for 24x7x365. Now you can monitor your Pi temperature in real time.

I believe you will not satisfy with this simple task only. So, my next project will be logging weather information including temperature, relative humidity and solar irradiation. Yes, you are right, solar irradiation, to monitor my mini PV farm.

Next post coming soon.

Saturday, January 11, 2014

My Pi part 2


My Pi is up with Raspbmc and communicate with my SMA inverter and update data to pvoutput.org. But I still lack of something, an USB hub, an external powered USB hub.

Initially, I went to the IT shop to seek for a cheap solution, but the price just stop me. A 4-port powered USB hub from Belkin is selling about RM70. If a Pi only cost RM111, how unreasonable if I get a hub for RM70. So, I make up my mind to do it one for myself.

The idea is very simple, you get an old USB hub that can be powered by external power supply, then you cut the power terminal that connected to the Pi, left only data line. This is to prevent unbalance voltage that might causing the Pi malfunction.



Once you have cut the power supply connection, it is safe to connect the hub to Pi. I found a 5V, 3A adaptor from my store, so it is just nice to use it, lucky :)

Now the external powered hub is ready to use. I connect back the external HDD, and I can continue enjoy the movie. Too bad that Raspbmc does not support rm/rmvb file. But that is not a major problem, just get a converter and convert it to other format will do. With the current CPU power and GPU power, it is just a few seconds job to convert rm/rmvb to avi.

Then the next task will be the remote for my Pi. I order a TSOP34138 infrared receiver from Farnell with cost of about RM5. Then I found an old VCD player remote and use it to become the remote for my Pi. STM Labs has a very detail instruction of how to use GPIO of Raspberry Pi to become IR receiver. For those that can't afford to buy a nice IR from Logitech, this is the cheapest solution that you can use.

Basically, I have done most of my tasks, but I still have more challenging task to do with my Pi. Will update once I have more detail to share.

Wednesday, January 01, 2014

My Pi

I was a fan of Raspberry Pi since beginning of the release, this credit-card-sized single board computer really attract my attention. I always want to use some simple hardware to perform some simple task, using minimum computing power to execute daily not so complicated computing task, e.g. media player, data logger, web server, home automation, NAS, etc. I have few old PC which I can use it for those function but few reasons stop me from doing that.

First of all, the power consumption of those PC is too high. For a normal Intel CPU, you are talking around 65W up to 250W which the power consumption of a monitor is not yet being included. Lets say, it takes an average of 100W and I don't need monitor. For this PC to run 24x7x365, the electricity per annual will be

100W x 24hrs x 365 days =  876kWhr/annual or 73kWhe/month

Our electricity tariff is based on the total amount of electricity you are using, the lesser you use, the lower the rate. For domestic, the tariff range from RM0.218/kWh until RM0.454/kWh (however year 2014, TNB give us the best new year gift, the maximum rate is RM0.571/kWh, thank you to all fuckers that vote blindly)
My house average monthly electricity consumption is around 400kWh, which is about RM100++ of electricity bill. If let say I use normal PC to do these additional function, I need to pay extra 73kWh x RM0.516, which is around RM38 per month, or RM450 per year. That's why I aiming for this lower power system that use very minimum power and at the same time do the job I want.

Raspberry Pi consume around 3.5W of power, which mean about 32kWh/annual or 2.6kWhr per month. That mean I need to pay extra RM16 per annual if I power my Pi for 24x7x365. Well, I believe this kind of power consumption you can't complain with.

I have been waiting a chance to buy a Pi, until recently, my wife asking me if I can buy a media player for her farther, and immediately I donate my media player to her :) and I get myself a Raspberry Pi from Farnell. It cost me RM111 for the Pi, then I get a acyclic case from ebay for around RM12.

So, what I going to do with this PC?

First of all, I need to make it a media center. This job is very easy, just go to Raspbmc and follow the instruction to install the image into a SD card. I have tried few times to make the machine up. The advice is use Lan for the installation process, once you are in the XBMC, then only you go for wireless.

The second task is to install a Bluetooth toggle to connect with my PV system and upload the data automatically to the internet. I'm using SMAspot, they got a very nice instruction of how to install and configure their program with Pi. Now I can monitor my PV system automatically from any where I go.




I still have few tasks to be completed:

1. To modify a normal USB hub to become powered USB hub. Initially, I was thinking to get a powered USB hub, but the price is too expensive, nearly RM70. So, I decided to get a power supply from my store and modify a normal USB hub into a powered USB hub so that I can connect my portable HDD to the Pi.

2. Remote control for the XBMC. Again, I will use a GPIO of the Pi to connect a infrared receiver and get a cheap Astro remote control.

3. NAS. I got few old 3.5" HDD and I thinking a way to connect it to the Pi. Will find a solution soon.

4. Adding an LCD display to the Pi. I got few 2.2" LCD with me, so will find a time to connect it to the Pi for some message display.

5. Home automation, This is a long term project. Will do it once I settle down.

Ok, a long post for the New Year.

Happy new year to everyone out there.