Saturday, September 9, 2017

PyCon Meetup and visiting Lahore!




While browsing through my daily feed I came across this TechJuice article on an upcoming Python Pakistan conference. Being a Python fan, I just couldn't pass on the opportunity and as the call for proposals was open, I submitted a proposal for a workshop. The proposal is about Programming Robots with Python! Combining my love for robotics and my liking for Python, I thought to myself why not! 

At LearnOBots my EdTech company we have developed a cost effective programmable mobile robot for kids. We use Arduino with a graphical programming environment to teach kids how to program the robot. For PyCon I thought we could easily replace the Arduino with a Raspberry PI and start programming the robot to do cool stuff like making line following and obstacle avoidance robots, delivery robots for Warehouses etc.

So at the start of last week I received a call from the PyCon organizers that they were organizing their 3rd meetup in Lahore on Friday (Sept 8th) and asked if I would like to attend. I thought why not, summer is just about over, Fall semester is about to start, I know I would get really busy with my teaching so let's just visit Lahore on the weekend. Turns out the meet-up was mostly to discuss the organizational issues along with setting up committees to look after the conference. It started off with Badar Khushnood (of Google / Twitter) and Khurram Zafar (of LUMS Center for Entrepreneurship) sharing their experiences of organizing conferences. The proposals were also discussed and I got to express the need for my proposal. Although it still hasn't been accepted but it was cool to discuss something totally different. I was the only one talking about playing with hardware using Python. The call for proposals is still open, so if you are interested you'd better submit one right now! 

All in all I've had a good weekend trip to Lahore, met some cool people and my wife spent around 5 hours at Lahore's Liberty market trying to order Jora's for her cousin's upcoming wedding! By the way I'm assuming 5 hours as it's around 4 and a half hours already and I'm blogging from Liberty Market right now! I'm assuming she would be back in 30 mins! Here are some pictures that I took for contributing to Google Maps. These are of the recently opened Packages Mall. 






Hacking for a cause!


CERN organizes a yearly hackathon in where professionals from all over the world are selected to work on ideas. 5 teams are created with around 7-9 people in each team. For this year 2017, topics were selected by people working at Terres des Hommes, Global Humanitarian Lab, United Nations and many other NGOs in and around Geneva. Each team has been assigned a challenge along with 2-3 mentors who will helping set up the teams to work together and act as guides. 

Alhamdulillah I feel very happy and lucky to be selected this year to participate in this hackathon. My main motivation has been to visit Geneva and explore CERN. The selection process included a video interview which required answering specific questions. This is the second time I've applied, failing to be selected the first time around 3 years ago. So cool to see my profile on the Hackathon page! 

http://theport.ch/home/the-port-2017/

My team is Pier23 and the challenge that we have been assigned is to develop a wearable device;  "A new hardware device developed together with friendly user interface and big data analysis algorithms will open the door for new clinical researches such as precise efficiency evaluations of current drugs, studying the evolutions of the disease and producing new pharmaceutical products." 


Some of the requirements include real time tracking, inexpensive, compact sized with a long battery life! "It is expected to develop a real-time tracking device which is inexpensive, compact sized with a long battery life and easily accessible by any patients."  All this to be done in a few weeks and developed in 3 days. The challenge is very interesting and I'm very excited about developing a wearable device! All my Kickstarter backed microcontroller / microprocessor boards will now come into use! I will be doing a post on my Kickstarter collection as well!


So yesternight we had our first tele-conference meeting. It was pretty cool to be connected to people from all over the world belonging to different countries and cultures all coming together on a single platform to work on one problem. Some snapshots from the first meeting!




I'm pretty excited to be a part of this hackathon! Now just hoping my visa comes through so I can actually visit Geneva and CERN. 


Wednesday, August 30, 2017

Some solutions are purely simple

I've had a bad start to my day today! My Nexus 5X just died randomly. I was browsing on it when suddenly the screen turned blank! This has never happened before with this phone. I had been having a bit of trouble with the Sim card detection but this was something completely new! It did boot into the bootloader a few times, but now it's not even doing that! Looks like it's the end of the road for this guy :(.

I use an iMac in my office and with it Apple's Bluetooth wireless keyboard and magic mouse. While working my mouse kept disconnecting with the MAC. Already frustrated with my phone's death, I thought this is one of those days where nothing is going to work! Initially i thought that the mouse might be paired with some other PC somewhere on the floor and it might be connecting to it. The mouse has been used before by someone else. I tried renaming it but the problem persisted. However a simple google search led me to a helpful answer and turns out that the simplest of solutions worked and it wasn't a big problem.

https://discussions.apple.com/thread/4261715?start=0

The problem is that the magic mouse uses AA batteries. Not all of them are exactly the same size. Therefore when the mouse moves a little bit, the batteries loose their connection. Fixing a small piece of paper between the batteries did the trick! A simple solution and now I have no disconnection issues! I hope my Nexus 5x's problem can have a simple solution as well. I usually add pictures for proof of what I'm talking about, unfortunately with my cell phone dead can't do that with this post! Oh wait, maybe I can use my MAC's front camera to take a few snaps of the mouse and the dead Nexus!
Aug 30, 2017 12:05:07 PM.jpg
Aug 30, 2017 12:06:08 PM.jpg
Aug 30, 2017 12:06:42 PM.jpg

Thursday, August 24, 2017

Node-Red on the Raspberry PI

In my last post I talked about playing with Node-Red on my MacBook. My actual goal was to get started with Node-Red on my Raspberry PI to make some cool application. Turns out, Raspbian the OS for the Raspberry PI already comes pre-installed with Node-Red. So much for my observation skills.


I've been usually using a 10" HDMI touch screen for the Raspberry PI which I won in an idea competition. I haven't used a VGA monitor with the PI in a long time so the first problem I faced was using the HDMI - RGB converter with the PI. With the default settings the Raspberry PI won't show any display. A little search led me to the forums which led me to the solution. Here are the steps that I used to use an HDMI - RGB converter with the PI. 



Step 1: Open Terminal
Step 2: Navigate to /boot/
Step 3: Use sudo nano /boot/config.txt
Step 4: Navigate to the line that says #hdmi_safe=1 and uncomment it by removing the # sign.
Step 5: Also find the line #hdmi_force_hotplug=1 and uncomment it by removing the # sign. 
Step 6: Sudo reboot to restart your PI for the changes to take effect.

What is happening is that since the HDMI to RGB connector does not recognize any activity on the HDMI port it forces the display to the Video out port. Both these lines force the video output to HDMI. 

For newbies Sudo is the command that is used to gain administrator access. Without it you won't have the previliges to modify and save config.txt. nano is a text editor in which we open the file config.txt which is read by the PI at bootup time to setup it's configuration. 

References:

Wednesday, August 23, 2017

Playing with Node Red on my MAC

For this semester I'll be teaching two courses at NUST. One is an undergraduate course whereas the other is a graduate course. This is my first time with both of these courses, so there is a bit of excitement and apprehension if I'll be able to deliver my lectures in a great way. There are only a couple of weeks left in the classes so I've started playing around with technologies that I might be utilizing in delivering my lectures. Today I'm playing with Node-Red to build basic web applications. The idea is to play with it on my laptop then shift to an embedded computer like the Raspberry PI to build a practical daily use application.

The first step I did was to navigate to the node-red website and install the node and npm package using the pkg file on the website. Since I'm using MAC I needed this one.

https://nodejs.org/en/download/



Since I have npm installed on my MAC the other method of installing node-red was to use the following command in terminal


sudo npm install -g --unsafe-perm node-red

Once node-red is installed, run the node-red command to see the following output

$ node-red

Welcome to Node-RED
===================

25 Jun 22:51:09 - [info] Node-RED version: v0.17.4
25 Jun 22:51:09 - [info] Node.js  version: v6.11.1
25 Jun 22:51:09 - [info] Loading palette nodes
25 Jun 22:51:10 - [warn] ------------------------------------------
25 Jun 22:51:10 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
25 Jun 22:51:10 - [warn] ------------------------------------------
25 Jun 22:51:10 - [info] Settings file  : /home/nol/.node-red/settings.js
25 Jun 22:51:10 - [info] User Directory : /home/nol/.node-red
25 Jun 22:51:10 - [info] Server now running at http://127.0.0.1:1880/
25 Jun 22:51:10 - [info] Creating new flows file : flows_noltop.json
25 Jun 22:51:10 - [info] Starting flows
25 Jun 22:51:10 - [info] Started flows

If you see this output that means node-red was successfully installed and now you can  run it in your browser by typing the following in your browser bar

http://localhost:1880

If you know the ip address of your laptop then you can remotely run Node-red over the network. 



In order to make your first flow using node-red use the following tutorial. In fact I've followed it to explore node-red for the first time on my own and run my first two examples. 


Total credits for this blog post are to be given to : https://nodered.org/docs/getting-started/first-flow 
My next step to follow the same tutorial to deploy Node-Red on a Raspberry PI and make some physically interactive application. Till then Allah Nigehbaan!


Monday, August 7, 2017

DOS Games for the boring Meetings

In my last post I wrote about how I re-utilized an almost dead slow windows XP Acer netbook by installing Linux Mint on it. My next task was to make it ready for the boring departmental meetings that I'm faced with every day as a university teacher. So the first step was to install Dos Box and download a few dos games that I played while growing up.  Here are the steps that I followed:

Step 1: Install DosBox
https://community.linuxmint.com/software/view/dosbox
Just clicking on the install button will install DosBox and create a shortcut menu in the Games tab

Step 2: Download a few Dos Games
https://www.emuparadise.me/Abandonware_Games/51 
[Disclaimer: I do not support piracy. Download at your own risk]

Step 3: Unzip and mount the game on DosBox
Once you have downloaded the zip file, unzip it and mount it after launching DosBox. Once you can see the Dos prompt you can use the command intro mount to see how to mount a game director to DosBox. The first game I downloaded and installed was Duke Nukem 3d.


  • Unzip Duke Nukem 3d to let's say Desktop
  • Use the mount command on DosBox " mount c ~/Desktop/DN " , here DN was the folder to which I unzipped my Duke Nukem zip file. "c" is the name of the virtual drive to which the folder DN will be mounted to. 
  • Once the folder is mounted you can navigate to that director just like in DOS by typing c:
  • Now using dir lists all the executable files. You need to run setmain or setup first to setup Duke Nukem run settings like sound and keyboard
  • Once that is done, simply type duke3d to play the game
  • Make sure you don't play this game in a meeting



Here is a video preview. My music is playing but something is wrong with the sound effects. Need to figure that out. Enjoy!




Linux MINT on an Acer Netbook

I had an old Acer Aspire One with an Intel Atom processor. Since the notebook is an old model with an SD card as a hard drive, it was pretty slow and became obsolete. The last user was my Dadi (paternal grandmother) who used Skype on it to talk to my aunts abroad. Since my Dadi hadn't used a computer before, therefore she wasn't as frustrated with the slow speed of this netbook as any other user would be. Then she bought an iPad and the netbook became obsolete.

I really wanted to do something with it and tried installing Arduino but on windows it was almost impossible to use with its slow interface. I looked online for something to do with it and found that Linux Mint is a good distribution to use with the Acer netbook. I followed a few tutorials and installed Linux mint on it. It became quite a useful notebook which I could use for simple browsing and checking emails. Here are some pictures of the Acer Aspire One Netbook which is doing very well as an email checking device for boring meetings. With a battery backup of around 1.5 hours, its a perfect companion to play games during boring meetings.





It has the following specifications.
Acer Aspire One usual specifications:
  • 1.6GHz N270 Intel Atom Processor.
  • 1GB DDR2 533MHz.
  • Windows XP Home SP3.
  • 8.9″ 1024 x 600 WSVGA glossy LED backlit display.
  • 120GB 2.5″ 5400RPM Hitachi Hard Drive (with SDHC storage expansion slot)  Mine has 16GB SD storage (which made it really slow with Windows XP)
  • 802.11b/g Atheros Wireless.
  • 3-Cell 23Wh battery.
  • Size: 9.75″ x 6.625″ x 1.28″

Here is a demo video in action. Next step installing and running Doom for those boring departmental meetings.