@ben_nuttall Ben Nuttall ● Software Engineer at BBC News Labs ● Former Community Manager at Raspberry Pi ● Creator of gpiozero & piwheels ● twitter.com/ben_nuttall ● github.com/bennuttall
@ben_nuttall GPIO Zero v1.6 ● Python library ● Simple interface to GPIO devices ● New v1.6 release featuring rotary encoder thanks to the talk from Tony Smith last month! ● gpiozero.readthedocs.io
@ben_nuttall Mythic Beasts ● Competent & trustworthy UK based hosting provider – Raspberry Pi OS downloads – Raspberry Pi apt archive ● UK based, data centres in UK, EU & US ● Range of support options
@ben_nuttall Mythic Beasts Pi Cloud ● Raspberry Pi 3/4 hosting service ● Netbooted (no SD cards) with network storage ● IPv6-only connectivity ● IPv4 proxy ● IPv4 SSH access ● Billed monthly or on-demand ● Reinstall at any time
@ben_nuttall piwheels ● Automated compilation of Python packages for Raspberry Pi hardware ● Makes "pip install" fast ● Raspberry Pi OS pre-configured to use piwheels.org ● First announced at Raspberry Pint in 2017 ● www.piwheels.org ● github.com/piwheels/piwheels
@ben_nuttall piwheels setup ● 1 x Pi 4 (previously Pi 3) with 2TB storage - controller software and web server ● 5 x Pi 3 (building packages for Stretch) ● 3 x Pi 4 (building packages for Buster) ● 1 x VM (previously Pi 3) running postgres database
@ben_nuttall Getting started 1. Create a Mythic Beasts account 2. Create an API key 3. Install hostedpi 4. Configure API keys as environment variables 5. Test your API connection
@ben_nuttall CLI - Pi management commands ● hostedpi cancel ● hostedpi off ● hostedpi on ● hostedpi power ● hostedpi reboot ● hostedpi show ● hostedpi status
@ben_nuttall CLI - Pi management commands $ hostedpi on mypi mypi powered on $ hostedpi off mypi2 mypi2 powered off $ hostedpi reboot mypi3 mypi3 rebooted $ hostedpi power mypi4 mypi4: powered on $ hostedpi status mypi mypi: live $ hostedpi cancel mypi5 mypi5 cancelled
@ben_nuttall Python recipe - access a web page from hostedpi import PiCloud import requests cloud = PiCloud() pi = cloud.pis['somepi'] r = requests.get(pi.url) with open('pi.html', 'w') as f: f.write(r.text)
@ben_nuttall Project status / what next? ● Continual feedback loop with Mythic Beasts ● This is a beta - API/CLI subject to change until v1.0 release ● Test suite in progress ● Integrate into piwheels - auto scale builders up/down and auto re-image