Accent
Accent is a smart picture frame with a pop of color and noย cables. Read more about it on Medium.
Client
The Accent client uses the PlatformIO Arduino toolchain for the Waveshare ESP32 board. See the client control flow for a high-level overview of the client code.
To push the client code to the board:
- Configure the IDE or CLI with
platformio.ini
. - Pick one display type via
build_flags
inplatformio.ini
:- GDEW075Z09 (7.5" 640x384 3-color)
- GDEW075Z08 (7.5" 800x480 3-color)
- GDEH075Z90 (7.5" 880x528 3-color)
- GDEY1248Z51 (12.48" 1304x984 3-color, requires DESPI-C1248 adapter)
- GDEY073D46 (7.3" 800x480 7-color, comes with DESPI-C73 adapter)
- If you want to point the client to a custom server, change
kBaseUrl
inClient.cpp
. - Compile and upload with
pio run -t upload
.
Follow the on-screen instructions to connect the client to a Wifi access point. The settings will be preserved across uploads and can be reset manually. See the setup documentation for details.
Server
The Accent server is built on Google App Engine using the Python 3 runtime in the standard environment. See the server control flow for a high-level overview of the client code.
The database backend uses Cloud Firestore. User-specific data is stored in the users
collection with each user identified by a key generated by the client to identify it.
/users/<USER_KEY>/home
- The home address used for the local time, the weather, and the commute origin./users/<USER_KEY>/work
- The work address used for the commute destination./users/<USER_KEY>/travel_mode
- The commute travel mode./users/<USER_KEY>/schedule
- The content schedule./users/<USER_KEY>/google_calendar_credentials
- The OAuth credentials for Google Calendar.
To populate the cross-user data after setting up:
- Obtain an API key for Google Maps and add it the
api_keys
collection under/api_keys/google_maps/api_key
. Ensure that the Maps Static API, Directions API, Geocoding API, Maps Elevation API, and Time Zone API are all enabled and added to the key's restrictions. The Cloud Vision API and Google Calendar API also need to be enabled, but they do not need a key. - Obtain an API key for OpenWeather and add it in the
api_keys
collection under/api_keys/open_weather/api_key
. - Obtain an OAuth client ID for the Google Calendar API with scope
https://www.googleapis.com/auth/calendar.readonly
in the OAuth consent screen. You will either need to make your OAuth app public or add your account to the list of test users. Configure the full/oauth
URL of your App Engine app as an authorized redirect URI for the OAuth client. Write OAuth Client ID and Client Secret to theclient_id
andclient_secret
fields of thegoogle_calendar
document in theoauth_clients
Firestore collection (/oauth_clients/google_calendar
).
To test and deploy the server:
- Install the Google Cloud SDK, create a project, and authenticate with a service account.
- Run
cd server && python3 -m venv venv && . venv/bin/activate
. - Run
pip install -r requirements.txt
(which also builds the C extension). - Run the server locally with
export GOOGLE_CLOUD_PROJECT=$(gcloud config get-value project) && python main.py
. - Test the local server with:
- /hello/<USER_KEY> for the settings UI to edit user-specific data.
- /next?key=<USER_KEY> for the time in milliseconds until the next schedule entry.
- /epd?key=<USER_KEY> for the currently scheduled client image used by the e-paper display.
- /gif?key=<USER_KEY> for a GIF version of the currently scheduled image for testing.
- /artwork?key=<USER_KEY> to bypass the schedule and get the artwork image directly.
- /city?key=<USER_KEY> to bypass the schedule and get the city image directly.
- /commute?key=<USER_KEY> to bypass the schedule and get the commute image directly.
- /calendar?key=<USER_KEY> to bypass the schedule and get the calendar image directly.
- /everyone?key=<USER_KEY> to bypass the schedule and get the everyone image directly.
- /wittgenstein?key=<USER_KEY> to bypass the schedule and get the wittgenstein image directly.
- Deploy the server with
gcloud app deploy
.
Frame
Files describing the Accent frame hardware include:
- A Blender project for simulating materials:
frame.blend
- A blueprint with basic dimensions:
frame.pdf
- A Shaper Origin design:
frame.svg
- A FreeCAD project:
frame.FCStd
- A G-code file for CNC milling:
frame.gcode
- 3D models in STEP and STL formats:
frame.step
&frame.stl