Tuesday 16 July 2019

IOT101 Now Includes Raspberry Pi 4

With the recent release of the brand new Raspberry Pi 4, we are happy to announce that we are including the Raspberry Pi 4 in our next run of the IOT101 course. In this 2 day course, you will learn how to get started with various IoT projects using the Raspberry Pi and a wide range of sensors.

Some key projects that you will learn are:
    - Web Server and Simple Database Administration
    - Fingerprint Scanning
    - Displaying Live Stock Market Prices on 16x2 LCD & Dot Matrix Display
    - Building your own CCTV Camera Surveillance System using Webcam and Pi Camera
    - MQTT and Various IoT Communication Protocols
    - And Many More!


The good news is, at the end of the course, you get to keep your personal IoT101 Development Kit.



We had a lot of fun with participants from our previous IOT101 class in June. Here are some photos of our class! Hope to see you in September!

Course Details: learn2develop.net








Thursday 3 January 2019

Thursday 25 January 2018

Building an Ethereum Mining Rig

In December 2017, I decided to build my very own Ethereum Mining Rig. With the sky rocketing prices of Ethereum, I have made some quick calculations that a mining rig can reap a good amount of passive income.

To begin with building a mining rig, you will first have to fork out a certain sum of money to invest in a mining rig. In Singapore, there are various online websites that sell custom mining rigs to keen crypto currency miners. However, their prices are rather expensive and you could get components with better specifications if you sourced for your own components with the same amount of money. So that was what I did! I took a trip down to Sim Lim Square, which you might have heard of, is a computer geek's paradise. They sell you any computer hardware under the sun that you could think of!

For a mining rig that mines Ethereum, the most important component is the Graphical Processing Unit (GPU). The GPU does all the complex mathematical computing or generally known as "mining" and it determines how much money you can make in a day. For the rest of the computer components, such as the CPU, RAM or hard disk, they don't really make significant improvements in mining as compared to the GPU, therefore it is okay to use an older system, or any system you might have laying on your shelf. However, if you want to build a mining rig with 1 or more GPU, you might have to look into a newer motherboard or specialised mining motherboards that accept 6 or more GPUs. I know of a mining motherboard that accepts 19 GPUs (THAT'S CRAZYYYYY!!!) Personally, I do have an old motherboard laying on my shelf, but after much testing, it could only support up to 2 GPU.

In this rig that I'm building, I'm looking to build a mining rig that can support up to 6 GPUs.



My Ethereum Mining Rig Parts

1) 850W 80-Plus Gold Seasonic Power Supply Unit
2) Biostar TC250-BTC Pro Motherboard
3) Intel Pentium G4400 Processor
4) 4GB Crucial DDR4 Memory
5) 3x GPU Risers
6) 2x Sapphire RX570 Nitro+ 8GB
7) 1x Sapphire RX570 Nitro+ 4GB
8) Cheap Hand-built Mining Frame from Daiso




Challenges Faced

1) Insufficient Supply and Increasing Costs of GPUs in the Market

Due to the crazy popular demand of building mining rigs, GPUs are usually out of stock in Sim Lim Square, and even if you are lucky to find one, their prices are usually very expensive due to markups from the high demand. An actual fact, a Sapphire RX570 Nitro+ 8GB card that I've bought on 16 Dec 2017 cost me SGD $409 and today (23 Jan 2018), the price of the card from the same store I got it from cost SGD $640! An increase of 56% over a month is insane!!! However, I was quick to get my hands on 3 GPUs in the first week before the price increased.

2) GPU modding and Overclocking

When I started off building this mining rig, I had zero knowledge on tweaking the GPU to maximise the mining performance. I don't even know that tweaking the GPU was necessary until I ran my miners with stock settings. Poof! I was getting 19MH/s for each of my card! With a quick research online, my card can do 28 MH/s with the correct tweaking and overclocking. So I spent my entire week at home trying to tweak the BIOS clock speeds of the card and having trial and errors with the overclocking so that my rig runs stable at high hash rates and does not crash. After a painstaking week, my rig is now running at 80.5 MH/s on average and each card produces around 27 MH/s without any crashes for the past month. At the same time, there is another important process which is undervolting. Undervolting allows you to reduce the power draw of your GPUs, significantly reduce your monthly electrical bill by a fair bit.



Cons of Running a Mining Rig

In Singapore when the temperature is around 30 deg celcius all year round, running a mining rig that generates a lot of heat is not really a good idea after all. I host my mining rig in my study room for the past one month and I placed it on a table right beside my window. Since I don't leave my windows open at night when I sleep, the heat is trapped in the room for the entire night and the next morning, my room feels like a sauna. The air in the room is legit warm. So I have to open the window and blast my fan in the room for a while so that it could dissipate the heat trapped in the room. The ideal place to host a mining rig is in an air con environment so that it could cool down your rig.



Statistics of my Rig

Hashrate: 80.5 MH/s (avg)
Earnings per day : $10.69 (1 ETH = SGD $1387 as of 25 Jan 2018)
Power Consumption: 485W (avg)
Electrical Cost per day (24 hours) : SGD $2.51 (21.56 cents per kWh tariff)
Profit: $8.18 a day

Miner: Claymore Miner
Mining Pool: Ethermine (Asia)

Again, the profit is determined by the price of Ethereum and the mining difficulty of mining.





* All prices mentioned in this post are in Singapore Dollars (SGD)




Thursday 17 August 2017

Modifications to the New Raspbian Stretch OS (NOOBS v2.4.3)

Just today, Raspberry Pi Foundation released a new version of its Raspbian Operating System, version 2.4.3. If you have been using OS 2.4.2 and below, you will notice that today's new launch of the OS breaks the APT-GET repository link for your Raspberry Pi. I've been struggling with this problem for the entire afternoon, just before I got to know that a new OS has been released. The issue for the broken APT-GET repository link was likely due to the renaming of its OS from Jessie to Stretch.




TL:DR, there are two ways to quickly fix this problem for users running OS 2.4.2 and below:

1) You can DOWNLOAD the new OS from Raspberry Pi

OR 

2) Manually updating the repository link by performing the following command

Change the word "jessie" you see in the following text documents to "stretch"

sudo nano /etc/apt/sources.list


sudo nano /etc/apt/sources.list.d/raspi.list


After saving the text documents, perform the following commands

sudo apt-get update


sudo apt-get dist-upgrade



Sunday 25 December 2016

Running Raspbian OS natively on your Mac / PC

If you haven't read up on the newest blog article from Raspberry Pi, Raspbian OS now supports natively on your Mac / PC / Linux machine!

I have created a short how-to video on how you can get started with running the Raspbian OS on your Mac using VMWare Player.

Sunday 7 August 2016

MySQLTips: Raspberry Pi MySQL Workbench Refusing to Accept Remote Connections

Ever had this problem when you set up a MySQL database on your Raspberry Pi and you are trying to remotely connect to your database from another client but the connection refuses to establish? This problem to many people seems to be a frustrating problem. However, please do not confuse this article with remote connections from a client outside of your own network. For that, you will have to perform port forwarding (Port: 3306) on your router to enable access from clients outside of your network.

In this article, I will show you a simple fix for this problem! I will be using a Raspberry Pi as my MySQL server and NANO as my text editor. The version of NOOBS I'm using is 1.9.2 and I believe that this article will work for previous versions of the operating system.

Thanks to the following articles for helping solve my problems:

http://serverfault.com/questions/586651/mysql-refuses-to-accept-remote-connections

http://stackoverflow.com/questions/14779104/how-to-allow-remote-connection-to-mysql



Step 1:
$ sudo nano /etc/mysql/my.cnf

Modify the bind-address section under the [mysqld] header from



bind-address = 127.0.0.1

to

bind-address = 0.0.0.0



Step 2:
$ sudo service mysql restart

Step 3:
On your MySQL Workbench on your server, create the following queries:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH PRIVILEGES;

Select on APPLY.

Step 4:
Now you should be able to access your MySQL database remotely from your local clients.






Sunday 26 June 2016

IoT Article on Code Magazine

Recently, I've co-authored an article together with Wei-Meng Lee about the Internet-of-Things on Code Magazine. I will leave the link to this article at the bottom of this post. In the article, you will get a quick jump start into the world of IoT, what are the devices available to get started with, and what are some of the simple Python applications you can write to communicate with various sensors, such as a PIR motion sensor.

An application that we included in the article allows you to detect motion on your Raspberry Pi and sending a push notification to your Android devices programmatically.


Link to Code Magazine's IoT article : http://www.codemag.com/Article/1607071

Tuesday 3 May 2016

IOT 101 now comes with more sensors and a 7" Touch Display!



Past participants for the IOT101 course were deluged with the various sensors and equipment; it is now going to be worse! We are adding a large number of sensors as well as the official Raspberry Pi 7" Touch Screen Display (with 10 Finger Capacitive Touch) to the IOT Kit. That is to say, you are going to get a box of gadgets that are going to keep you busy for the next one week after the course!

What's more, we are using the latest Raspberry Pi 3, which comes with Bluetooth LE and WiFi built in.

Here are the additional sensors you will get on top of the standard IOT Kit:

  • Small passive buzzer module
  • 2-color LED module
  • Hit sensor module
  • Vibration switch module
  • Photo resistor module
  • Key switch module
  • Tilt switch module
  • 3-color full-color LED SMD modules
  • Infrared emission sensor module
  • 3-color LED module 
  • Mercury open optical module
  • Yin Yi 2-color LED module 3MM
  • Active buzzer module 
  • Temperature sensor module
  • Automatic flashing colorful LED module
  • Mini magnetic reed modules
  • Hall magnetic sensor module
  • Infrared sensor receiver module
  • Class Bihor magnetic sensor
  • Magic light cup module
  • Rotary encoder module
  • Optical broken module
  • Detect the heartbeat module
  • Reed module
  • Obstacle avoidance sensor module
  • Hunt sensor module
  • Microphone sound sensor module
  • Laser sensor module
  • 5V relay module
  • Temperature sensor modules
  • Linear magnetic Hall sensors
  • Flame sensor module
  • Sensitive microphone sensor module
  • Temperature and humidity sensor module
  • XY-axis joystick module
  • Metal touch sensor module

Friday 4 March 2016

Tip: Installing Windows 10 on a PC with SSD & HDD configuration

Just a tip to all Windows users trying to install/reinstall windows on your PC. If your PC has a SSD and a HDD and you plan to use your SSD as its primary boot drive and HDD for your secondary files storage, please ensure that you remove your HDD during Windows installation. A problem I had was a normal regular installation of Windows with both my SSD and HDD connected and Windows worked fine for the past few months, until my HDD crashed. Like any normal user would react, my reaction to that was to simply remove the HDD and replace it with another drive and I would only lose the files I had on the HDD. 

No. It turned out that Windows would not even boot on the standalone SSD even it contained the primary Windows boot files. Through an intensive search online, I got to know that Windows will automatically set a small partition on your secondary drive (my HDD in this case) for System Reserved Partition instead of partitioning it on your primary drive (my SSD) during the initial Windows installation. This small partition is an important partition and your computer would not boot up Windows if this partition is missing! That was what happened and in the end, I had to reinstall my entire computer, but this time round, I removed the HDD during the installation process. This allows Windows to set the System Reserved Partition locally on the SSD instead of any other drives.

Wednesday 27 January 2016

Non Responsive Task Bar in Windows 10 Build 10586

After recently updating to the Windows 10 Build 10586, my Windows Start Menu and Task Bar became unresponsive to mouse clicks. After researching on various forums, most users recommend a fix via the Powershell commands, but it did not work on my PC. However I managed to find a forum comment that recommended a simple fix by using the Command Prompt. This solution worked for me:

Step 1) Run Command Prompt as Administrator.

Step 2) Enter the following command: sfc /scannow

Step 3) Reboot your PC and after rebooting, you should see that the taskbar and start menu is now responding.