{"id":1841,"date":"2013-07-27T16:30:54","date_gmt":"2013-07-27T12:30:54","guid":{"rendered":"http:\/\/nayarweb.com\/blog\/?p=1841"},"modified":"2013-07-27T16:30:54","modified_gmt":"2013-07-27T12:30:54","slug":"hands-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2013\/hands-on-raspberry-pi\/","title":{"rendered":"Hands on Raspberry Pi"},"content":{"rendered":"<p>Had ordered a raspberry pi last Saturday. Received the parcel this Thursday at home.<\/p>\n<p><a href=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130725162053639.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130725162053639-300x225.jpg\" alt=\"Raspberry Pi\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1842\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130725162053639-300x225.jpg 300w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130725162053639-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Took a 2GB micro SD card and tried to flash raspbian on it using dd command on linux. But it was saying the card is read only or something. Went on windows and downloaded the flashing tool and it flashed correctly.<\/p>\n<p>Putting the card into the raspberry and powering it up would make the pi flash eight times indicating something&#8217;s wrong. The firmware was not able to connect to the sdram. Had to sacrifice my 32GB micro sd to be able to flash the NOOBS on it as it requires 4GB. I could flash my card from linux itself this time.<\/p>\n<p>The raspberry pi finally booted! The problem is i don&#8217;t have a usb keyboard at home. Lent a keyboard from my cousin to just setup the system and allow ssh connections. Then i&#8217;d control it using my laptop or phone\/tablet.<\/p>\n<p>I was able to install webiopi. I could control the GPIO pins using a web interface. Then i tried writing a python script (RPi.GPIO) for automating a change in voltage for a pin.<\/p>\n<p><code>import RPi.GPIO as GPIO<br \/>\nimport time<br \/>\nGPIO.setup(23, GPIO.OUT)<br \/>\nmasaw = False<br \/>\nfor num in range(0,10):<br \/>\n\tif(masaw == False):<br \/>\n\t\tmasaw = True<br \/>\n\telse:<br \/>\n\t\tmasaw = False;<br \/>\n\tGPIO.output(23, masaw)<br \/>\n\ttime.sleep(2)<\/code><\/p>\n<p>It worked like magic :3<\/p>\n<p><a href=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130726144521914.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130726144521914-300x225.jpg\" alt=\"GPIO on Raspberry\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1843\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130726144521914-300x225.jpg 300w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2013\/07\/CameraZOOM-20130726144521914-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I need to have some switch relays to be able to control real life objects such as my home lights, my washing machine and stuffs. The possibilities are endless.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Had ordered a raspberry pi last Saturday. Received the parcel this Thursday at home. Took a 2GB micro SD card and tried to flash raspbian on it using dd command on linux. But it was saying the card is read only or something. Went on windows and downloaded the flashing tool and it flashed correctly. &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2013\/hands-on-raspberry-pi\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">Hands on Raspberry Pi<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[61,84,167,118],"class_list":["post-1841","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-linux","tag-programming","tag-raspberry-pi","tag-windows"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=1841"}],"version-history":[{"count":2,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1841\/revisions"}],"predecessor-version":[{"id":1845,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/1841\/revisions\/1845"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=1841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=1841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=1841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}