Forum PHP Paris, 21 nov 2013
var me = {
"user": "Ronan"
, "age": 35
, "origin": "Brittany"
, "twitter": "@arno_u_loginlux"
, "repo": "github.com/ronanguilloux"
, "work": "cto@lespolypodes.com"
, "tags": [
"dad"
, "bearded web developer"
, "foss supporter"
]
}
PHP Appreciation Society Member
since 1999
1/3: Raspberry Pi is...
not a production environment,
not scalable,
not safe for work
not entreprise-ready
and it's OK.
So...
or STFU
2/3: PHP is serious IT after all. Raspi is not.
(or not)
~
(& vice-versa)
3/3: by design...
PHP is not for Hardware
(integrated circuits, controllers, sensors...)
~
Raspberry Pi is 100%
for learning & playing
with electronic hardware!
So this is how it started:
I bought a Rasberry Pi.
The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn (python) programming.
http://www.raspberrypi.org/faqs
The idea behind a tiny and cheap computer for kids came in 2006, when Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft, based at the University of Cambridge’s Computer Laboratory, became concerned about the year-on-year decline in the numbers and skills levels of the A Level students applying to read Computer Science. From a situation in the 1990s where most of the kids applying were coming to interview as experienced hobbyist programmers, the landscape in the 2000s was very different; a typical applicant might only have done a little web design.
http://www.raspberrypi.org/about
Raspi are manufactured in the UK,
at Sony's manufacturing facility in Pencoed, Wales.
1 million sold a year, since 2012.
$35 / 32.72 €
(26 € exc. VAT)
Power supply or SD cards are not included
a regular 5V / 1A smartphone charger
with mini micro USB cable
a regular USB Wireless Dongle
a SD CARD
(optional) a USB flash drive
Mind the box case!
a box case!
see Adafruit
check the community documentation:
http://elinux.org/RPi_VerifiedPeripherals
keyboards, bluetooth dongles, soundcards, 3G, IR, GPS, HDMI/DVI/VGA cables & converter boxes, webcams, TV tuners,...
To buy one of these monitors, search eBay for "Car TFT" and there will be loads of results. It should cost about £10 ($16). It requires a 12V power supply, since it is designed to be powered by a car battery, but you can power it with a regular power adaptor.
Note the handy slot for the 26-pin IDC cable!
Playing cards box is exactly the right size!
Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform (...), and a development environment for writing software for the board.
In 2011: 95% of smartphones, 90% of hard disk drives, 40% of digital televisions and set-top boxes, 15% of microcontrollers and 20% of mobile computers
GOOD NEWS: ARM is now actively targetted by many distro/packages providers: PHP, NodeJs,...
Microsoft Surface, ASUS Eee Pad, Apple iPads, iPhones & iPods, Samsung Galaxy S2/S3/S4, Google Nexus 4/5/10, Google Chrome Book, Blackberry smartphones, Canon PowerShot A470 digital camera, Nintendo DS game console, TomTom GPS...
Texas, 1942 (Wikimedia Commons)
maker [ˈmeɪkə] - n.
people who hack hardware, business-models, and living arrangements to discover ways of staying alive and happy even when the economy is falling down the toilet.
Cory Doctorow, Makers, October 2009, [read it for free]
related: Dreamers, scientists, hackers, self-replicators, teachers, troublemakers, laser-lovers, scouts
The maker subculture is a contemporary subculture, representing a technology-based extension of DIY culture.
related: DIY, electronics, robotics, 3-D printing, home-automation / domotique, open-source-hardware, fablabs, cnc tools, metalworking, woodworking, knitting, traditional arts and crafts, no-patents
Check this talk from the author, Chris Anderson, formally of WIRED
The new e-Health sensor platform adds sensing capability for nine different biometric parameters, such as pulse, blood pressure, oxygen in blood (SPO2), electrocardiogram (EKG), airflow, glucometer, galvanic skin response (GSR), patient position and body temperature, to give the Arduino and Raspberry Pi Community a way to develop new e-Health applications and products.
The new e-Health sensor platform adds sensing capability for nine different biometric parameters, such as pulse, blood pressure, oxygen in blood (SPO2), electrocardiogram (EKG), airflow, glucometer, galvanic skin response (GSR), patient position and body temperature, to give the Arduino and Raspberry Pi Community a way to develop new e-Health applications and products.
Combining these ingredients:
= Have my lights switched on and off automatically based on a schedule I create in Google Calendar.
See e how-to, using Despotify
See also: github.com/Hexxeh/spotify-websocket-api (python)
A Raspberry Pi Remote Mains Switcher
aonsquared.co.uk/the_dark_pi_rises
Also check pi-cars.com
See instructables.com/id/Picopter
Also check Tricopter with Picopter Flight Control - Fpv Flight
&Picopter code shared on Github
Revelation #0
~
Wiring a simple LED with a resistor
# modprobe w1-gpio
# cd /sys/class/gpio/
# ls
# export gpiochip0 unexport
# GPIO=17
# cd /sys/class/gpio/gpio$GPIO
# echo $GPIO > export
# ls -l
total 0
--w------- 1 root root 4096 nov. 21 09:45 export
lrwxrwxrwx 1 root root 0 nov. 21 09:45 gpio17 -> ../../devices/virtual/gpio/gpio17
lrwxrwxrwx 1 root root 0 nov. 21 09:44 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
--w------- 1 root root 4096 nov. 21 09:44 unexport
Notice on the first ls that gpio17 doesn't exist,
echo "in" > direction
cat value
You can configure the GPIO for output and set the value as well.
echo "out" > direction
echo 1 > value
accessing hardware, the right way.
With default settings the files in /sys/class/gpio are owned by user root and group root. Only the root user will have read/write permissions. We can change this with a udev rule. We create a file in /etc/udev/rules.d that contains the line:
KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/usr/local/bin/hipi-expin gpio /sys%p"
~
=> Create a PHP LED blinker & allow Apache2 to run it
But WARN! Permissions make sens
$ sudo visudo
www-data ALL=NOPASSWD:/path/to/the/blinker
~
https://github.com/ronanguilloux/php-gpio
https://github.com/ronanguilloux/php-gpio-web
Questions ?
This presentation is available on
ronanguilloux.github.com/Raspi-ForumPHP-2013
Attendies, thanks for feedback on joind.in!