Building an Internet Appliance with the Raspberry Pi

A talk on the Raspberry Pi, the Web and everything else...
(not necessarily in that order)


by Jean-Claude Batista  /  @jcbatista
http://slackingcoders.com

Building Blocks

Microcontrollers or Microprocessors?

Let's talk GPIOs...

Analog vs Digital IO

IO Voltage Considerations

Digital Analog
Raspberry Pi 3.3v
BeagleBone Black 3.3v 1.8v
Arduino 5v 5v

 

Power conversion might require a "level shifter"

GPIOs

On the Pi, GPIOs are like a regular files
we can write to and read from...


# Set up GPIO 7 (Pin 26 in board) and set it to output

echo 7  > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio7/direction

# Write output
echo 1 > /sys/class/gpio/gpio7/value

# Clean up
echo 7 > /sys/class/gpio/unexport
						

Using the 'pi_piper' Ruby Gem

Building a 'Light' Web API ...

PARTY REST API

Representational state transfer (REST)


  • Create => POST
  • Read => GET
  • Update => PUT
  • Delete => DELETE

Introducing
party.rb

Our Party resource will be available at the following url:

http://192.168.xxx.yyy:8080/api/party

curl -H "Content-Type: application/json" -d '{"action":"stop"}' http://192.168.xxx.yyy:8080/api/party
					

Bottom Line

We barely scratched the surface of what's possible ...

Fin

Thanks for listening!