wiki:Notes/RaspberryPi

Raspberry Pi

" Buy'em By The Bagful "

The Little Tavern ( a D.C. burger joint )

Got a RPi Model 3 ... even more stunning than the 'old' RPi2. However, what to do with the 'old' RPi 2 ? After thrashing back and forth on the subject, I decided on a Wifi Access Point ... plus a huge jump in integration opportunities/challenges. See #XWindowsForwarding-AsGoodAsItGets.

Should I wait for the RPi4 to come out or get another RPi3 now ? Or both ? :-)

Also see Devices/Arduino.

Always On

RP as always on home server, running:

  • DNS
  • Main Repository
  • Backup
  • Messaging Services
  • Squid

http://www.raspberrypi.org/

http://www.raspberrypi.org/documentation/

Source repository - https://github.com/raspberrypi

https://github.com/raspberrypi/documentation

https://github.com/raspberrypi/documentation/tree/master/remote-access

http://en.wikipedia.org/wiki/Raspberry_Pi

Comparison of Models - https://www.element14.com/community/docs/DOC-68090/l/raspberry-pi-zero-pi-2-b-a-compute-module-dev-kit-comparison-chart

RPi 3

A hot little beast .... hot and amazingly capable, I'm not sure what it can't do.

Even routine heavy browser graphics and scripts can send the temp sensor up into the 70C range ... it is designed to run up to 85C. Anyway, so what. The entire board with a heavy test load is consuming well under 10 watts.

https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=138193

On the RPi2, I often get caught in long waits for intensive graphics, but the new VideoCore IV processor clocked at 400MHz seems to be noticeably faster the 250 MHz GPU on the RPi2 - or at least I don't get as many inexplicably long waits with no apparent CPU bottlenecks. I figure that the CPU clock is only 33% faster, but the graphics is 60% faster, so it may not be entirely my imagination.

Update Oct 30th 2017: My 'new' RPi3 has been running continuously for 328 days, always on for almost a year ... I figure I've saved about $40 in electric bills. :-)

RPi 2 Model B

10 Reasons why the Raspberry Pi 2 Model B is a killer product -

http://www.networkworld.com/article/2887224/tech-primers/10-reasons-why-the-raspberry-pi-2-model-b-is-a-killer-product.html

RPi Zero

The "Thing" in the 'Internet of Things'.

https://www.element14.com/community/docs/DOC-79284/l/overview-of-the-raspberry-pi-zero

http://raspi.tv/2015/ethernet-on-pi-zero-how-to-put-an-ethernet-port-on-your-pi

RPi Zero W

Raspberry Pi Zero W -> https://www.raspberrypi.org/products/pi-zero-w/

The Raspberry Pi Zero W extends the Pi Zero family. Launched at the end of February 2017, the Pi Zero W has all the functionality of the original Pi Zero but with added connectivity, consisting of:

802.11 b/g/n wireless LAN
Bluetooth 4.1
Bluetooth Low Energy (BLE)

Like the Pi Zero, it also has:

1GHz, single-core CPU
512MB RAM
Mini HDMI and USB On-The-Go ports
Micro USB power
HAT-compatible 40-pin header
Composite video and reset headers
CSI camera connector

This may sound like a fairly minor upgrade, but it's major in an important way. The RP0 W is a usable no-kidding-around networked server costing $10 that consumes about 1/2 the power of a RP3 for light-level loads, like a steady stream of HTTP requests/responses. The studies comparing the RP0 W and the RP3 report roughly 150ma vs. 300ma ( @ 5V ), but I have to say that those numbers sound a bit low to me, maybe 200ma vs. 400ma would be a safer estimate.

In any case, for battery powered applications, that's double the time between charges, say 20 hours instead of 10 hours. In fact, it's not much more demanding than an Arduino with a Wifi Shield ( which allowing for numerous configuration complexities are said to consume a 45mA @ 9V and 220 mA @ 3.3V, respectively ).

All and all, the release of the Pi Zero W is another big step toward a full-featured ubiquitous 'always-on' server.

Note: From https://www.reddit.com/r/arduino/comments/19qt6n/how_long_can_an_arduino_w_wifi_shield_run_with_a/ - > " ... The current draw of the arduino will be like 25-50ma. The current draw of a wifi shield will be 60-500ma [ @ 9V ] or larger, depending on how much network traffic is sending/receiving ... "

https://www.adafruit.com/product/3400

Note: Due to popular demand, there might be some delay in shipping products containing Pi Zero W!

Still playing hard-to-get though ...

Update Oct. 2017: Got one. More amazing than stunning. See RaspberryPi/ZeroW.

Tutorials

Lots of learning projects / how-tos / etc. - https://learn.adafruit.com/category/raspberry-pi

https://learn.adafruit.com/external-drive-as-raspberry-pi-root

... copy your root filesystem to an external drive, connected via USB, and tell the kernel to use this filesystem instead of one on the SD card ...

https://www.cl.cam.ac.uk/projects/raspberrypi

https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/

Raspberry Pi Quick Start

Raspberry Pi Temperature Sensor

Science Experiments with RPii

Baking Pi – Operating Systems Development

Raspberry Pi Turing Machines

Distributed Computing with the Raspberry Pi

Image Pi – Basic image processing

Home - Physical Computing with Raspberry Pi

http://www.element14.com/community/community/code_exchange/blog/2013/01/02/c-tutorial--hello-raspberry-pi

In this tutorial series, we are going to learn modern c++ using the raspberry pi. So, what do I mean when I say modern? In August of 2011, a new version of the c++ standard was released that included some exciting new features.

C++ 11 - http://en.wikipedia.org/wiki/C%2B%2B11

Resources

http://cs.smith.edu/dftwiki/index.php/Tutorial:_Client/Server_on_the_Raspberry_Pi

http://cs.smith.edu/dftwiki/index.php/Category:Rasberry_Pi

A complete listing of self-hosting software for the Raspberry Pi -> http://www.jamesrobertson.eu/pages/2016/mar/09/a-complete-listing-of-self-hosting-software-for-the-raspberry-pi.html

Selfhosting is the process of locally hosting and managing applications instead of renting from SaaS providers.

https://github.com/vinta/awesome-python

A curated list of awesome Python frameworks, libraries, software and resources.

http://www.creativeapplications.net/tutorials/how-to-use-openframeworks-on-the-raspberrypi-tutorial/

http://openframeworks.cc/

http://www.noveldevices.co.uk/rp-gcc

http://pi4j.com/

This project is intended to provide a friendly object-oriented I/O API and implementation libraries for Java Programmers to access the full I/O capabilities of the Raspberry Pi platform.

http://raspberrywebserver.com/

Setting up a Raspberry Pi as a home web server is a great way to learn about web design and server administration.

http://raspberrywebserver.com/cgiscripting/

http://elinux.org/RPi_Hub

http://elinux.org/RPiconfig

http://elinux.org/RPi_Tutorials

http://elinux.org/Category:RaspberryPi

http://elinux.org/Raspberry_Pi_VideoCore_APIs

The Raspberry Pi contains a Broadcom VideoCore? IV GPU providing OpenGL ES 1.1, OpenGL ES 2.0, hardware-accelerated OpenVG 1.1, Open EGL, OpenMAX and 1080p30 H.264 high-profile decode. There are 24 GFLOPS of general purpose compute and a bunch of texture filtering and DMA infrastructure.

http://elinux.org/R-Pi_Troubleshooting#Sound

... Between December 2012 and February 2013 the standard raspbian wheezy distribution, and apt-get upgrade, included pulseaudio. Forum posts suggest that pulseaudio can break alsa. Whilst some members identify various workarounds, others find only removal of pulseaudio restores sound output ...

http://elinux.org/RPi_Distributions

http://elinux.org/RPi_VerifiedPeripherals

http://elinux.org/RPi_USB_Wi-Fi_Adapters

SD Cards - http://elinux.org/RPi_SD_cards

Java FX - https://wiki.openjdk.java.net/display/OpenJFX/OpenJFX+on+the+Raspberry+Pi

... The minimum recommended memory split for JFX on the Pi is 128 MBytes, with many applications requiring 256 MBytes. ...

No surprises there ...

Parts And Projects

WiFi Access Point

See page for WiFi Access Point.

Kivy Pie

http://kivypie.mitako.eu/kivy-pie.html

Kivy is a Python framework for multitouch apps. Developers can boot Kivy Pie to start working straight in ! Works with the RaspberryPI touch display ...

PipaOS distro based on Raspbian, Kivy framework ... Development tools: Editors, Git, Kivy, Support for most common input devices.

Interesting ... Python 3.4 ...

See PythonGUIApps#Kivy


Topics

Other 'pragmatic' stuff, in no particular order ...

http://www.valvers.com/open-software/raspberry-pi/

Lot of basic info about builds/make/etc.

http://www.valvers.com/open-software/raspberry-pi/step01-bare-metal-programming-in-cpt1/
http://www.valvers.com/open-software/raspberry-pi/step02-bare-metal-programming-in-c-pt2/
http://www.valvers.com/open-software/raspberry-pi/step03-bare-metal-programming-in-c-pt3/
http://www.valvers.com/open-software/raspberry-pi/step04-bare-metal-programming-in-c-pt4/

https://github.com/BrianSidebotham/arm-tutorial-rpi

http://www.penguintutor.com/raspberrypi/


http://elinux.org/RPi_USB_Ethernet_adapters

https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point?view=all

Would you like to use your Pi as a WiFi? router? Or maybe have it as a special filtering access point? Setting up a Pi as an access point (AP) is a bit more advanced than using it as a client, but its still only a half hour of typing to configure.

If you want to, this tutorial will make it so the Pi broadcasts a WiFi? service and then routes internet traffic to an Ethernet cable.

http://www.linuxuser.co.uk/tutorials/remotely-control-your-raspberry-pi

This tutorial assumes that you have flashed the latest Arch Linux ARM image (in our expert’s case archlinux-hf-2013-05-14) to an SD card.

http://computers.tutsplus.com/tutorials/take-control-of-your-raspberry-pi-using-your-mac-pc-ipad-or-phone--mac-54603

I'm going to use a service called No IP, which uses a program on your Pi to find out it’s address, to update a domain to point to this address. We’ll also need to open a port in the home router to allow connections to the Pi.

First sign up for an account at noip.com - there is a free option available, or you can opt to pay $15 a year for a service with more features.

https://jeffskinnerbox.wordpress.com/2012/11/15/getting-audio-out-working-on-the-raspberry-pi/

http://postscapes.com/raspberry-pi-wireless-options


http://www.johannesbader.ch/2014/05/installing-bittorrent-sync-on-raspberry-pi/

There are many solutions to build your own cloud like Seafile, ownCloud or clouddav. Those are great solutions, but all rely on a central server; if this server is turned off or crashes, sync will no longer work. Bittorrent Sync is different: it syncs content using peer-to-peer file sharing.

http://lifehacker.com/bittorrent-sync-keeps-your-files-in-sync-skips-the-ins-478810621

If you've ever wanted a security-focused, Dropbox-like file and folder syncing option, BitTorrent? decided to answer your wishes with BitTorrent? Sync. Previously in private alpha, BitTorrent? Sync is now available to the public for Windows, OS X, and Linux appliances.

http://mattrichardson.com/Raspberry-Pi-Flask/

... You can use Flask with other Python libraries to bring additional functionality to your site. For example, with the RPi.GPIO Python module you can create a website that interfaces with the physical world ...

https://blog.idrsolutions.com/2014/12/top-8-ides-programmers-coders-beginners-raspberry-pi/

http://www.noveldevices.co.uk/rp-gcc

https://blog.codecentric.de/en/2013/03/home-automation-with-angularjs-and-node-js-on-a-raspberry-pi/


http://macchina.io/

macchina.io is an open source software toolkit for quickly building embedded applications for the Internet of Things that run on Linux-based devices like the Raspberry Pi, Beaglebone, RED Brick or Galileo/Edison?.

macchina.io implements a web-enabled, modular and extensible JavaScript and C++ runtime environment and provides easy to use building blocks that enable applications to talk to various sensors and devices, as well as cloud services.

http://niltoid.com/blog/raspberry-pi-arduino-tornado/

http://opencv.org/about.html

OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library.


An RPi cluster !

http://www.pidramble.com/

This website is powered by Drupal 8, hosted on a cluster of Raspberry Pi 2 computers in Jeff Geerling's basement.

https://github.com/geerlingguy/raspberry-pi-dramble

https://github.com/geerlingguy/raspberry-pi-dramble/wiki

Dramble: A cluster (Bramble) of Raspberry Pis on which Drupal will be deployed using Ansible.

http://elinux.org/Bramble

Peccadilloes

Bunch of configuration stuff ... taming the RPI ?

Powering USB Drives

High priority, a very low power USB drive directly off of RPi USB, not from USB hub.

On the other hand, is an externally-powered USB drive such a big deal in the first place ?

http://www.htpcguides.com/power-2-5-hard-drive-with-raspberry-pi-b/

If you have a small portable 2.5″ hard drive that draws power from the USB port, you can make this work without the need for an external power supply with the Raspberry Pi Model B+.

You will be modifying how the GPIO pins on the Pi work, specifically turning pin 38 on (represented by 1). This means you can double the current over the USB bus from 600mA to 1200mA so you can actually power external USB devices through the Raspberry Pi itself ...

https://projects.drogon.net/testing-setting-the-usb-current-limiter-on-the-raspberry-pi-b/

https://wiki.polaire.nl/doku.php?id=raspberrypi_usb_current

Booting USB Drives

The point of the exercise above ... with a huge overall performance boost.

https://learn.adafruit.com/external-drive-as-raspberry-pi-root/overview

NodeJS

See Notes/NodeJS

http://elinux.org/Node.js_on_RPi

NodeJS maintained builds for RaspberryPi for a while ..Though you can install an even older version of Node.js using apt-get ... you can also compile the very latest yourself.

wget http://nodejs.org/dist/v0.10.2/node-v0.10.2.tar.gz
tar -xzf node-v0.10.2.tar.gz
cd node-v0.10.2
./configure
make
sudo make install

http://nodejs.org/dist/

http://www.andrewconnell.com/blog/setup-node-js-on-raspberry-pi-2-b

Recently I picked up one of new Raspberry Pi 2 Model B microcontrollers ...

Now get the latest stable node.js package available from the node-arm site:

wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb   # Chug Chug
node -v

https://ni-c.github.io/heimcontrol.js/get-started.html

Install the dependencies: Node.js and MongoDB

http://pijs.io/

Pijs.io is a cloud-platform to write embedded applications for your Raspberry Pi, in JavaScript.

http://revryl.com/2014/01/04/nodejs-raspberry-pi/

http://raspberrypi.stackexchange.com/questions/27333/problems-with-installing-node-js-npm-package

Both of above recommend installing node.js from ADAFruit repository ( probably prefereed way )

https://learn.adafruit.com/node-embedded-development/installing-node-dot-js

The first step will be to add the apt.adafruit.com package repository to your Pi's /etc/apt/sources.list file. You can do this by running the following command.

curl -sLS https://apt.adafruit.com/add | sudo bash ARMv7 Version ?

Noteworthy ->

The Raspberry Pi's GPIO pins require root privileges to access them. Why is this bad? If you run a node.js script that uses GPIO under the root account (or via sudo), and an attacker comprimised your script, they could have access to do whatever they want on your Pi. Obviously, this is a bad thing.

The solution? GPIO Admin. GPIO Admin gives you the ability to access GPIO pins from the default pi user account. The first step is to clone a copy of the GPIO Admin repository using git.

Ho Boy ...

http://weworkweplay.com/play/raspberry-pi-nodejs/

MongoDB

See Notes/MongoDB

http://c-mobberley.com/wordpress/2013/10/14/raspberry-pi-mongodb-installation-the-working-guide/

https://nikolayarhangelov.wordpress.com/2015/01/25/raspberry-pi-running-nodejs-and-mongodb-on-pi/

GPIO

Need to understand how GPIO capabilities have shaped the Linux#Raspbian operating system.

https://learn.sparkfun.com/tutorials/raspberry-gpio

http://www.pieter-jan.com/node/15

http://www.airspayce.com/mikem/bcm2835/

http://www.siongboon.com/projects/2013-07-08_raspberry_pi/index.html

Notice page layout.

XWindows Forwarding - As Good As It Gets

I've been using SSH/XWindows as a graphical interface from the RPi3 to the 'old' RPi2. XWindows forwarding ( aka XForwarding ) can be challenging at best, but a Raspbian RPi3 -> RPi2 connection is the most stable and usable I've seen so far.

There are still things you do and don't do with SSH Xforwarding . The don't dos can be particularly nasty.

Don't Dos

  • Don't log on as the same graphical user from different machines - it may work OK but it can get very confusing, with potentially tragic results. Use just one virtual desktop on one machine for each user on a remote system.
  • If using multiple sessions, don't fiddle with desktop or application settings or try to share files between the two X sessions. The shared resources between sessions just won't understand what's happening.
  • Don't run sudo on a graphical ( ssh -X ) terminal at all, never ! The ssh client can grab the sudo context and apply it to the wrong machine. Can be very messy.
  • Use only non-graphical sessions for console programs. There no reason to do otherwise and it can spare you grief.

Dos

  • Try to separate the multiple sessions for the same user by function as much as possible ( one for browsing, one for editing, etc. ). Less chance of collisions.
  • Run small desktops apps and simple, light-weight programs. I monitor activity with GKrellm and the network latency for some big graphics packages such as Eclipse and Python Spyder can be the better part of 10MB/s - almost the entire capacity of a 100Mbps router, for no good reason. Weigh resource demand against the value of what you are doing.
  • Run a resource monitor of some sort. One might assume that Open Office would be a heavy network graphics app but it's not that bad according to GKrellm.

There's a bunch of other dos and don'ts, but the above are the biggies. More to come ...

Ethernet Over USB

https://en.wikipedia.org/wiki/Ethernet_over_USB

Ethernet over USB has two meanings: Ethernet devices via USB and USB as an Ethernet network.

I mean "USB as an Ethernet network".

Hardware - Windows <-> USB OTG Cable <-> Raspberry Pi

Software - Windows Ethernet (192.168.0.3) <-> Raspberry Pi Ethernet (IP 192.168.0.4 )

In other words, a completely normal network connection, except it's using a USB cable.

https://en.wikipedia.org/wiki/USB_communications_device_class

The communications device class is used for computer networking devices akin to a network card, providing an interface for transmitting Ethernet or ATM frames onto some physical media. It is also used for modems, ISDN, fax machines, and telephony applications for performing regular voice calls.

https://msdn.microsoft.com/en-us/library/windows/hardware/ff538820(v=vs.85).aspx

No smoking gun, maybe be referring to USB Ethernet adapters and not USB USB connections.

Search with "USB CDC Windows Ethernet" -> https://www.google.com/search?noj=1&q=USB+CDC+windows+ethernet&oq=USB+CDC+windows+ethernet

Not real good news, maybe it works so easily that no one posts about it. Doubtful though.

https://en.wikipedia.org/wiki/RNDIS

The Remote Network Driver Interface Specification (RNDIS) is a Microsoft proprietary protocol used mostly on top of USB. It provides a virtual Ethernet link to most versions of the Windows, Linux, and FreeBSD operating systems.

Some hope -> https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-tweaks

Useful but going the wrong way RPi <-> Windows <-> Public Network

Being used for an RPi 0 as connection sharing client but not for an RPi 3 as connection sharing host ... so far.

The long-term idea is:

Windows (192.168.0.3) <-> Raspberry Pi (IP 192.168.0.4 ) and then by the magic of 'iptables'

Raspberry Pi (IP 192.168.1.6 ) <-> Modem / Router and Public Networks.

In other words, the Windows machine is hidden on a private network behind a well-secured Raspberry Pi - proxy servers, packet filtering, IP masquerading, whatever. And using a fairly light-weight browser from Linux via X-Windows ( if I can get it to work consistently).

#TODO

Also See

Linux#Raspbian

Linux#Pidora

Linux#ArchLinuxARM

See ( with stunned amazement ) MicrosoftWindows#Windows10

Search wiki for 'raspberry'

Last modified 6 weeks ago Last modified on 10/31/2017 12:01:45 AM