Today's top stories pulled from reddit
Weather forecast in our hometown of Boston, as well as reminders for the day
Today in history fun facts
We believe that there's something special about waking up and reading a good old fashioned newspaper. What we wanted to do was allow the user to print their own newspaper from home to wake up to every morning. Our solution was Daily Briefing, a web server that allows the customization of news to be printed by the user.
What it does
Every morning, it will print out a receipt slip containing top news articles that appeared overnight, as well as a joke, the weather, any reminders that you set for yourself, and a fun fact about this day in history.
How we built it
The printer is controlled from an Arudino Mega 2560, which has code on it to accept serial input, and send that to the printer. Using this Arduino software we are able to send data from anywhere over serial to the Arduino, and have it print. This makes it easy to use serialPy, a library for python which communicates over serial through the usb ports of a computer. A simple script was written to find the Arduino port based on a keyword seen every time it was plugged in. From there a program was written which pulled data from online, from sources such as reddit, wunderground, and Today in History. The python script would grab the data, convert it to a readable ASCII format for the printer, and then sent it with nice section breaks and formatting to the printer. We decided to convert a few local python scripts into a flask server, to allow users to add reminders from a form. This server is also running a RESTful API, which will send JSON files to the printer.
Challenges we ran into
We ran into several challenges with this project, including formatting the strings to be outputted by the printer, setting up the post api call from the form, and linking a relational database. When we first used the printer, the default was for it to send each character to the printer, and once it ran out of space at the end of the 32 character wide paper, it would loop to the next line. This caused words to be broken in half which severely reduced readability. Using the python script we were able to analyze the words in the inputted string, and format a new string which maintained whole words and line breaks in order to be more visually appealing and legible.
What we learned
We learned a lot about python, specifically string modification, and how python works with serial communication and ports. We also learned about managing, running, and creating sustainable flask servers with python, and using such a server to create a RESTful API that can be accessed externally.
What's next for Daily Briefing
We would like to run the python script from a raspberry Pi which would make it feasible to keep on 24/7, allowing us to use this as an actual morning briefing in our dorm room. It would also allow interfacing with other hardware such as LEDs, which could help convey information quickly using different colors or blink patterns for example. We also made it easy to implement new sections, so we could expand on those in the future. As we add more sections though we realize the paper becomes very long, so it would be nice to make an easy interface where the user could choose what they wanted to see, maybe on a day-by-day basis.