Pusher and PubNub are realtime backends that are commonly used for communication with Internet of Things devices, receiving geotracking updates, and many other use cases. Together with Gridarrow they can provide a very effective way to build live dashboards in Excel.
If you’re reading this blog post, you’ve almost certainly heard of the Raspberry Pi, but if not, it’s a small and affordable computer that is often used as the onboard controller for home and industrial automation. They’ve been used in everything from robotic tea pots to virtual co-pilots designed to prevent aircraft crashes.
In this blog post we’ll show how easy it is to get realtime data from internet connected devices like the Raspberry Pi to Excel using Gridarrow.
What is Gridarrow?Gridarrow is the missing server for Excel. It connects just about any data source to Excel with simple Python scripts.
Why is it awesome?
- It's real-time, so as soon as the data is updated in the Gridarrow App it's updated in Excel, no need to poll or refresh.
- It's multi-user so your colleagues can connect to the same data at the same time.
- It simplifies your spreadsheets by moving data retrieval and pre-processing into Python.
Realtime backends such as Pusher and PubNub are hosted services that can be thought of as cloud Pub/Sub broker (although they may offer certain value added features such as PubNub Functions that allow the transformation of messages in flight).
They work on essentially the same principle:
When used together with Gridarrow, the Gridarrow
App takes the role of the subscriber, listening for messages, and
Grid when it receives something of interest. This diagram should explain things:
Both Pusher and PubNub provide high quality client libraries, in a range of languages. Using Python on the client side
is very straightforward of course - you need to import the library and provide a few authentication details.
Providing the updates is then a matter of calling
Now that the messages are being published to the realtime backend from the clients running on Raspberry Pi, it’s up to the Gridarrow App to subscribe for the events and send the data to Excel. The code for doing that is pretty straightforward, but rather than going through it here, we’ve published example Apps for both Pusher and PubNub to the Gridarrow Catalog, so please check them out! We’ve also included the full source for the Pusher version below.
Finally, here’s an example where we’re simulating the Raspberry Pi client running in a few Windows cmd shells, and streaming the data via Pusher and Gridarrow into Excel: