{"id":873,"date":"2016-10-14T06:13:36","date_gmt":"2016-10-14T14:13:36","guid":{"rendered":"http:\/\/fox-gieg.com\/tutorials\/?p=873"},"modified":"2020-06-25T09:31:25","modified_gmt":"2020-06-25T17:31:25","slug":"raspberry-pi-setup","status":"publish","type":"post","link":"https:\/\/fox-gieg.com\/tutorials\/2016\/raspberry-pi-setup\/","title":{"rendered":"Raspberry Pi Setup"},"content":{"rendered":"<p>1. Current lineup is:<br \/>\n* $20 for RPi A+ (1 x 700MHz, 256MB RAM)<br \/>\n* $40 for RPi 2B (4 x 900MHz, 1GB RAM).<br \/>\nThey both have the same GPU, but the 2B is by far the best value because you can assign the GPU much more RAM. This guide is for a 2B with at least 8GB storage.<\/p>\n<p>2. Basic RPi 2B kit with power supply, case, SD card, wifi dongle, and some cables can be had for $60-70. I used a Canakit. Generally cheaper than acquiring each accessory separately. Good for a fast first-time setup; if you need to, you can invest in better components later.<\/p>\n<p>3. Some useful hardware accessories; a compatility list is maintained at &#8230;<br \/>\n* faster SD cards can greatly improve system performance.<br \/>\n* The image quality of the in-house PiCam camera accessory isn&#8217;t exceptional, but with a  direct bus connection it&#8217;ll run faster than third-party USB cameras. It also comes in an infrared version.<br \/>\n* An HDMI dummy dongle fools the OS into thinking a monitor is connected, which can speed things up when running headless and sharing the main display.<\/p>\n<p>4. NOOBS is the boot utility, Raspian is the OS. If your RPi didn&#8217;t ship with a preformatted SD card, you&#8217;ll need to install it yourself from &#8230; Default install settings are fine.<\/p>\n<p>5. The first time you set up, you&#8217;ll need a keyboard, mouse, and monitor. (Well, strictly speaking the mouse is optional.)<\/p>\n<p>6. First thing, run sudo rpi-update (firmware) and then sudo apt-get update\/upgrade.<\/p>\n<p>7. Then run raspi-config:<br \/>\n* Change the default password<br \/>\n* Enable ssh<br \/>\n* increase GPU memory to 1\/4 of total (if working with graphics). You can go higher by editing the config file &#8230;<br \/>\n* Change hostname (don&#8217;t use an underscore, or you&#8217;ll have to fix the hostname by editing the config files &#8230; and &#8230; )<br \/>\n* Enable camera, if you have one.<\/p>\n<p>8. Wifi will not autostart the first time. Add auto wlan0 to config &#8230; now it will try wifi at boot.<\/p>\n<p>9. If you&#8217;d like to preload ssids to connect to, enter them into the config file &#8230;<\/p>\n<p>10. Reboot and test your network connection and ssh.<\/p>\n<p>11. Install vnc server. Most guides use tightvncserver, which lets multiple users connect to their own desktops but can&#8217;t share the main screen. For most cases x11vnc, which shares only the main screen and runs much faster, is a better choice; <\/p>\n<p>12. Add lines &#8230; to config &#8230; so vnc will run on boot.<\/p>\n<p>13. Reboot and test vnc.<\/p>\n<p>14. To connect headless more easily, you can set a static IP. Or if you have access to your router, you can reserve one for the Pi&#8217;s ethernet or wifi MAC address.<\/p>\n<p>15. Right now, no popular RPi VNC viewer will let you view OpenGL graphics&#8211;apps will run, but the window will be invisible to you. To work with OpenGL you&#8217;ll need a monitor connected.<\/p>\n<p>OPTIONAL<br \/>\n16. Vnc without a firewall is extremely insecure; even if you keep nothing of value on the RPi, it could still be used to attack your network. So install ufw.<\/p>\n<p>17. Before starting ufw, tell it to allow the ports you&#8217;ll be using&#8211;for example, 22 and 80. (But don&#8217;t allow the unencrypted VNC port, usually 5900 or 5901&#8211;we want to block that!) You can also tell uwf to allow all ports on a trusted local network.<\/p>\n<p>18. Start ufw. If you get something wrong and lock yourself out, connect a keyboard,  mouse, and monitor and check ufw status. If you get stuck you can always disable ufw; it&#8217;ll stay off until you enable it again.<\/p>\n<p>19. Reboot and confirm that you&#8217;re asked for your user and pass when you start a VNC session over SSH.<\/p>\n<p>20. Reboot once more and confirm that everything&#8217;s working. Now you can disconnect your keyboard, mouse, and monitor and run your RPi headless.<\/p>\n<p>21. Hard part&#8217;s over. Next, add some software tools, for example:<br \/>\n* Btsync<br \/>\n* Gphoto<br \/>\n* ffmpeg<br \/>\n* VLC<br \/>\n* imagemagick<br \/>\n* PureData<\/p>\n<p>22. Finally, set up dev environments for your favorite programming languages. The RPi comes with Python, but here are some more options:<\/p>\n<p>* JavaScript:<br \/>\nChromium<br \/>\nNode.js<br \/>\nSublime Text<\/p>\n<p>* Ruby<\/p>\n<p>* C++:<br \/>\nopenFrameworks<br \/>\nCodeBlocks<\/p>\n<p>* Java:<br \/>\nProcessing<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Current lineup is: * $20 for RPi A+ (1 x 700MHz, 256MB RAM) * $40 for RPi 2B (4 x 900MHz, 1GB RAM). They both have the same GPU, but the 2B is by far the best value because you can assign the GPU much more RAM. This guide is for a 2B with [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[24],"tags":[],"_links":{"self":[{"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/posts\/873"}],"collection":[{"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/comments?post=873"}],"version-history":[{"count":1,"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/posts\/873\/revisions"}],"predecessor-version":[{"id":874,"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/posts\/873\/revisions\/874"}],"wp:attachment":[{"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/media?parent=873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/categories?post=873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fox-gieg.com\/tutorials\/wp-json\/wp\/v2\/tags?post=873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}