Saturday, February 14, 2015

Auto hot dater for Singles Appreciation Day (SAD)

Out of luck, out of love, but definitely not out of job! On this fateful day (14feb15), yours truly come to realized one by one the brethren have left to join the dark side. Rather unfortunately, there is still one last man standing, holding the ground resisting the "social norms" to sign on the dotted line.

In certain parts of the world with chinese populations 光棍节 (guang1 kun2 jie1) aka singles day is celebrated every 11november (11.11) of the year. However, in the other part of the world, it seems to yours truly singles are not celebrated. Yours truly celebrate Singles Appreciation Day aka S.A.D on 14Feb by making auto hot dater powered by arduino!!

So, how do singles mingle??? What are the laws of attraction between male and female humans? What are the grounds two humans decided to stay together and till death do us part?? These are questions yours truly ponder upon but yet to have answers to them. Until recently, one of the "bro"was acquainted with a girl via dating apps on social media (tinder, paktor, and so many more. Yeah, he is a trawler). Quickly they become an item and subject to much gossip; which unfortunately yours truly is in the party and have to GIGO (Garbage In Garbage Out). Having heard the experience of him using dating apps, perhaps there is a way to quantify how human hookup. The biggest face palm moment is when "bro" mentioned he "swiped right" at every single female profile.

From the above conversation, yours truly assumed other parameters such as profile picture on dating app, human attributes are held equal and have formulated some hypotheses. These hypotheses are: male have to swipe right more often [1] and be less selective of the female profiles [2] in hope of getting a higher count of "matched" (both male and female swiped right at the other's profile);  a set of preferred female pictures of the said male subject can be trained into a mathematical model, then feed into image recognition system via openCV where test data is acquired from the dating app's female profile picture; automated decision making is done within openCV and then instruction to swipe left or right is achieved with an arduino.

To answer the above hypotheses, an experiment has to be setup. The following parts needed are part1 of the experiments: swiping left or right using arduino with random 50-50 chance, and increased swiping frequency per hour in hope for a higher count of "matched".

parts list
1. Arduino (an uno is used here)
2. Regular servo motor
3. smart phone with a stylus (note3 is used out of convenience) or without a stylus.
3a. Stylus can be made by referring to this URL http://www.instructables.com/id/DIY-Capacitive-Stylus/
4. dating app of choice (tinder is used out of popularity with "bro")
5. jig to hold the smart phone, and servo with stylus. (a 3D printed PCB vice is inverted out of convenience)

Step1: stylus and servo


1. assemble the stylus on the "zero" position of the servo motor. Servo will be moving from 0 to 90deg, or 0 to -90deg
2. an apparatus to hold the stylus. Being cheap, yours truly have used some blue-tac, but the effect is not good. Will elaborate more at observation.















Step2: Arduino programming
0. pin7 of arduino is wired to the servo.
1. random 50-50 to swipe left or right.
2. servo to rotate L or R depending on the random value 0 or 1
code here: 

Step3: Setting up the jig
1. align the smartphone with the stylus on servo contraption at the apex of the servo rotation.

The final setup is in the following picture














Step4: Enjoy!


Observations:
The cheapo contraption of stylus on servo needs a rework, e.g with a L-R clicker type of setup. If the alignment for the current setup is not aligned properly or out of the way as observed from the video above, it will swipe left irregardless of the random value calculated within the program.

Final Note: Ego might be dented, but NO humans are harmed in this setup. The profile on dating apps are fictitious, and deleted after this experiment.

Thursday, February 5, 2015

setting up IoT server with ThingSpeak on Ubuntu 12.04

installing IoT server with thingspeak on ubuntu 12.04.

some time back yours truly has did some IoT inspired device, by streaming temperature sensor data using ESP8266 to the Internet; the receiving side of the sensor data is the FREE ThingSpeak server, courtesy of iobridge. details of the IoT streaming data setup here http://shin-ajaran.blogspot.sg/2015/01/iot-streaming-temperature-data-acquired.html


The ability to display IoT sensor data in a chart on the Internet is extremely useful. The following screenshot depicts the "public view" of my thingspeak sensor data chart that can be shared on web presence eg a blog or website; data collected can be used for processing/detecting/predicting. Note the LHS of the chart as compared to the "pattern" on the RHS. analyzing outliers, yummsss.



















The free thingspeak server allows for sensor update once very 15sec per channel ref here: http://community.thingspeak.com/documentation/api/ ; in other words, if a sensor (or many sensors) is required to send data at shorter interval eg every second, the free thingspeak server is not able to accommodate. thanks to open source software by iobridge, humans now can install thingspeak on their own computing resources, and customize according to their requirements.













picture above depict thingspeak server running off a VM on my "server" behind a simple network in my office. It is not publicly accessible.













picture above depict thingspeak server running off a VM on the R&D cloud in T931 behind a myriad of ACLs. It is not publicly accessible.

The step by step guide from the source repo is available here https://github.com/iobridge/thingspeak

The major software components needed on ubuntu 12.04 to use with thingspeak are mysql, ruby, rails, and major pkg updates. Assuming the server is behind a simple network with only a router-to-internet, setting up thingspeak is a breeze. There are open source bash scripts, eg https://gist.github.com/abythell/8225124 to help to manage the installation, originated from this blog post http://angryelectron.com/how-to-install-a-thingspeak-server/ Don't you just love open source software??

The complexity comes when 
1. installing on a VM that sits in the cloud that is behind a myriad of ACLs
2. scaling up the thingspeak server in the cloud as a PAAS, and clustering the resources.

your truly had his fair share of frustrating after office hours trying to fix some of the installation issues due to the complexity of the network and also the unfamiliarity with ruby, gems, and rails (first time installing it). nonetheless, the main gripe is documented in the gist below which address BADSIG from apt-get update, git to use https, gpgkeys: HTTP fetch error 7: couldn't connect: Network is unreachable, packages cannot be authenticated!, etc.

the screenshot of thingspeak server is running













the expanded installation bash from the user mentioned above is available here


now, let's start to do some IoT inspired stuff by streaming some data to thingspeak

Wednesday, February 4, 2015

3D printer with Cloud computing for one touch 3D printing over the cloud

3D printer with Cloud computing for one touch 3D printing over the cloud

Some time back, yours truly wrote about how to prepare a rep rap 3D printer for 3D printing over the cloud computing infrastructure. the  details of cloudify the rep rap 3D printer url here: http://shin-ajaran.blogspot.sg/2014/05/cloudify-setup-reprap-3d-printer-with.html

"The process to 3D print a 3D model can be quite an obstacle, i.e need to have physical access to the 3D printer and a SD card handy, power hog, heat emission, UFP emission. What if we can remotely send a 3D model (in *.STL) to be 3D printed on a 3D printer and also observe the 3D printing process over the Internet? Definitely it is going to be convenient as everything can be done at the fingertips; godsend piece of technology for those can’t wait for the 3D printers to be locked down in a facility equipped with exhaust and medical grade filter that is capable of filtering Ultra Fine Particles (UFP) in the range of 100 nanomether that is much finer than PM2.5. The purpose of this article is to share a step by step guide of setting up 3D printer to print remotely."

The process mentioned in the earlier post of using octoprint and slic3r is still not transparent to the end user details here: http://shin-ajaran.blogspot.sg/2014/05/operate-3d-printing-on-reprap-3d.html
user still have to process the gcode and submit it via octoprint.

 thanks to the good work rendered by FEW cloud FYP members Fahadh, Ehan, Wei quan, now we can 3D print over the cloud with a single click. Check out the youtube video. For best effect, please choose HD for video settings.