Establishing a Websocket PUBSUB server with Redis and Asyncio
Motivation If you've been following my never-ending quest for a light-sensor setup as detailed first in this post (set up a Raspberry Pi with Python 3.5) and then in this other post (make a light sensor with an Arduino and Raspberry Pi), you would know that I've only set up the data-collection half of this project. The other half will involve getting the data to make hardware do stuff in the real world. This post in particular covers how to leverage a PUBSUB (publish-subscribe) Redis server and websockets to this purpose.
Setting Up a Light Sensor with an Arduino and a Raspberry Pi
Motivation: About three to six times a day, the sun decides to make life in our trendy, skylit San Francisco office ever so slightly painful for at least one of my colleagues, forcing them to get up and use a long metal rod to slide the fashionable skylight drapes shut. In my never-ending quest to make something in the IoT (Internet of Things) sphere that would remedy this perennial obstacle to productivity, I began with the data collection side of things. Sensors. I bought a fairly cheap Arduino-for-babies kit, grabbed the closest Raspberry Pi I could reach, and got started.
Set Up a Raspberry Pi with Raspbian, running Python 3.5
Motivation The Python Foundation has really been amping up the real-time capabilities of Python with the new asyncio library. Asyncio enables Pythonistas to write code that is asynchronous, allowing for a more event-driven approach to writing software. What platform would benefit more from this new tech than microcomputers like the Raspberry Pi, which are finding new life as lightweight, yet powerful IoT (Internet of Things) devices? In my never-ending quest to set up a feedback system in my office where light levels can be communicated to an automated shade setup, I figured this would be the very first step to get there.
Client vs. Server OAuth Flows with REST APIs
This post is part 4 of a series on using OAuth with Django REST Framework. Part 2 focused on setting up your own OAuth2 server for your application, part 3 demonstrated integrating DRF with Python social auth, and part 5 is about integrating parts 1 & 2. For a summary of my thoughts on the process, see the series overview.
Social Auth with Django REST Framework
This post is part 3 of a series on using OAuth with Django REST Framework. Part 2 focused on setting up your own OAuth2 server for your application, part 4 offers a richer explanation of server vs. client oauth flows, and part 5 is about integrating parts 2 & 3. For a summary of my thoughts on the process, see the series overview.