{"id":351,"date":"2014-11-17T01:54:48","date_gmt":"2014-11-17T05:54:48","guid":{"rendered":"http:\/\/jimlund.org\/blog\/?page_id=347"},"modified":"2014-11-17T01:54:48","modified_gmt":"2014-11-17T05:54:48","slug":"pi","status":"publish","type":"page","link":"https:\/\/jimlund.org\/blog\/?page_id=351","title":{"rendered":"Raspberry Pi Setup"},"content":{"rendered":"<p>1) SD card.<\/p>\n<p>Download SD card formatter for OS X: <a href=\"https:\/\/www.sdcard.org\/downloads\/formatter_4\/eula_mac\/\">sdcard.org<\/a><br \/>\nRun it, using &#8216;Overwrite&#8217; option.  This takes a long time.<\/p>\n<p>Then download a Raspberry Pi OS.  I downloaded NOOB.  Unzip it.  Copy all the files in the unzip dir to the SD card.<\/p>\n<p>2) Insert SD card, plug in HDMI to monitor, cell phone charger to power, mouse to USB port.<\/p>\n<p>On power up, select the debian OS install.  After it installs, the Pi reboot.  Unplug the mouse and plug in a keyboard.  Finish the setup using the menu.  After setup, it drops the user to a command line.<\/p>\n<p>3) Setup the WiFi.  I want it to connect by DHCP using WEP automatically.<br \/>\nin  &#47;etc&#47;network&#47;interfaces, enter:<\/p>\n<p><code>auto lo<\/p>\n<p>iface lo inet loopback<br \/>\niface eth0 inet dhcp<\/p>\n<p>auto wlan0<br \/>\nallow-hotplug wlan0<br \/>\niface wlan0 inet dhcp<br \/>\n        wireless-essid edimaxx<br \/>\n        wireless-key s:xxxx<br \/>\niface default inet dhcp<br \/>\n<\/code><\/p>\n<p>See <a href=\"http:\/\/www.gc-linux.org\/wiki\/WL:Wifi_Configuration\">WiFi config<\/a>for other encryption setups.<\/p>\n<p>Type:<br \/>\n<code>sleep 5 (amp)(amp) service networking restart<br \/>\n<\/code><br \/>\nUnplug the keyboard and plug in the Wi-Pi Wifi dongle.<br \/>\nNetworking restarts, the dongle is recognized and the blue power light comes on.  It recognizes and logs in to the router.<\/p>\n<p>Connect to the Pi by SSH:<br \/>\n<code>ssh pi (at) 192.168.2.128<\/code><\/p>\n<p>4) Set up the bluetooth keyboard (Rii mini RT-MWK02+):<br \/>\napt-get update<br \/>\napt-get install bluetooth bluez-utils blueman<br \/>\napt-get install bluez-compat<\/p>\n<p>But the rest isn&#8217;t clear&#8211;a need a GUI or keyboard to setup the bluetooth keyboard.<\/p>\n<p>5) Fixing error from loss of power \/ bad shutdown.<\/p>\n<p>Compile dostools from source to have the fix supported:<\/p>\n<p><code>git clone http:\/\/daniel-baumann.ch\/git\/software\/dosfstools.git<br \/>\n Cloning into 'dosfstools'...<br \/>\ncd dosfstools<br \/>\nmake<\/p>\n<p>sudo .\/fsck.fat -trawl \/dev\/mmcblk0p5<\/code><\/p>\n<p>5) Camera<br \/>\nPlug in camera with blue back side of the connector against the white connector lock.<\/p>\n<p><a href=\"http:\/\/www.raspberrypi.org\/documentation\/raspbian\/applications\/camera.md\">Camera docs<\/a><br \/>\n<a href=\"http:\/\/www.raspberrypi.org\/documentation\/usage\/camera\/raspicam\/raspistill.md\">raspistill docs page<\/a><\/p>\n<p><code>sudo apt-get install imagemagick<br \/>\nsudo apt-get install fbi links2<\/code><\/p>\n<p>6) Allow scp of images without a login.<br \/>\nOn the Pi:<br \/>\nssh-keygen<\/p>\n<p>Copy the .ssh\/id_rsa.pub key to ~&#47;.ssh&#47;authorized_keys on the destination computer.<br \/>\nMake sure perms are set:<br \/>\nchmod 0600 ~&#47;.ssh&#47;authorized_keys<\/p>\n<p>7) WiFi disconnects when it loses connection.  Add a cron script to restart it.<\/p>\n<p><a href=\"https:\/\/blog.arevindh.com\/solved-raspberry-pi-wifi-disconnect-problems.html\">WiFi cron script<\/a><\/p>\n<p>Start cron logging to check that this works:<\/p>\n<p>sudo vi &#47;etc&#47;rsyslog.conf<\/p>\n<p>and uncomment the line<\/p>\n<p># cron.*                          &#47;var&#47;log&#47;cron.log<\/p>\n<p>After that, you need to restart rsyslog via<\/p>\n<p>&#47;etc&#47;init.d&#47;rsyslog restart<\/p>\n<p>and you will find the cron logs in &#47;var&#47;log&#47;cron.log<\/p>\n<p>8) Stop screen sleeping.<\/p>\n<p>\/etc\/lightdm\/lightdm.conf<\/p>\n<p>Add the following lines to the [SeatDefaults] section:<br \/>\n&#8212;<br \/>\n# don&#8217;t sleep the screen<br \/>\nxserver-command=X -s 0 dpms<br \/>\n&#8212;<\/p>\n<p>9) Install python libs.<\/p>\n<p>sudo apt-get install python-dev<br \/>\nsudo apt-get install python-rpi.gpio<\/p>\n<p>10) Camera streaming.<br \/>\nAdd to \/boot\/config.txt<br \/>\n#Turn off camera LED<br \/>\ndisable_camera_led=1 <\/p>\n<p><a href=\"http:\/\/raspi.tv\/2013\/how-to-stream-video-from-your-raspicam-to-your-nexus-7-tablet-using-vlc\">Streaming instructions link<\/a><\/p>\n<p>Install VLC on Pi:<br \/>\nsudo apt-get install vlc<\/p>\n<p>Install VLC Beta on an Android device.<\/p>\n<p>To start streaming:<br \/>\naspivid -o &#8211; -t 99999 -hf -w 640 -h 360 -fps 25|cvlc stream:\/\/\/dev\/stdin &#8211;sout &#8216;#standard{access=http,mux=ts,dst=:8090}&#8217; :demux=h264<\/p>\n<p>And on the Android device in VLC, open network stream:<br \/>\nhttp:\/\/192.168.2.128:8090<\/p>\n<p>11) Camera pictures on a phone.<\/p>\n<p><a href=\"http:\/\/www.fotosyn.com\/berrycam-support\/\">Pi Sight (Android), BerryCam (iOS)<\/a><\/p>\n<p>12) I2C EEPROM access<\/p>\n<p><a href=\"http:\/\/www.netzgewitter.com\/projects\/speer-samsung-printer-eeprom-resetter\/\">Installed Speer<\/a><\/p>\n<p>git clone https:\/\/github.com\/nharrer\/speer.git<\/p>\n<p>I\u00b2C is not enabled by default in Raspbian. Enabling i2c:<\/p>\n<p>a) Add the i2c modules i2c-bcm2708 and i2c-dev. Edit \/etc\/modules:<br \/>\nsudo nano \/etc\/modules<\/p>\n<p>Add:<br \/>\ni2c-bcm2708<br \/>\ni2c-dev<\/p>\n<p>b) Now comment out the module in \/etc\/modprobe.d\/raspi-blacklist.conf (only necessary if the files exists):<br \/>\nsudo nano \/etc\/modprobe.d\/raspi-blacklist.conf<\/p>\n<p>Put a # in front of the following line:<br \/>\nblacklist spi-bcm2708<\/p>\n<p>Pinout for CLP-415NW EEPROM cartridge has four contacts:<br \/>\nNnnn Gnd, SCL, SDA, Vcc (3.3v needed, 5v tolerant)<\/p>\n<p>c) apt-get install python-smbus<\/p>\n<p>Samsung EEPROM access is not working:<\/p>\n<p>Try resetting i2c baudrate:<br \/>\nsudo modprobe -r i2c_bcm2708<br \/>\nsudo modprobe i2c_bcm2708 baudrate=100010<\/p>\n<p>List active i2c buses: i2cdetect -l<br \/>\nProbe for active devices: i2cdetect -y 1<\/p>\n<p>13) Using a USB-to-serial converter to connect to a UART<\/p>\n<p>On OS X:<br \/>\nscreen \/dev\/tty.Keyserial1 9600<\/p>\n<p>To quit the screen app, tyoe control-A, then control-.<\/p>\n<p>or use minicom<\/p>\n<p>14) Using a Raspberry Pi as a media server<br \/>\nhttp:\/\/mymediaexperience.com\/raspberry-pi-xbmc-with-raspbmc\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1) SD card. Download SD card formatter for OS X: sdcard.org Run it, using &#8216;Overwrite&#8217; option. This takes a long time. Then download a Raspberry Pi OS. I downloaded NOOB. Unzip it. Copy all the files in the unzip dir to the SD card. 2) Insert SD card, plug in HDMI to monitor, cell phone [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-351","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/pages\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=351"}],"version-history":[{"count":0,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/pages\/351\/revisions"}],"wp:attachment":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}