Skip to content

Instantly share code, notes, and snippets.

@johnhowe
Last active January 27, 2023 02:11
Show Gist options
  • Save johnhowe/2fc81371a62964433797992dd8350a26 to your computer and use it in GitHub Desktop.
Save johnhowe/2fc81371a62964433797992dd8350a26 to your computer and use it in GitHub Desktop.
Veriflite Portal Setup

Steps to get a basic Veriflte portal working with Python websockets

The Veriflite Portal is a tool that enables real-time communication between Veriflite sensors on a user's phone and a computer using websockets. It allows third-party developers to interface with the sensors and create applications that can respond to trampoline activity.

There are some example client applications availbale at www.github.com/veriflite. These are written in Python and can be used as a starting point for other applications and ideas.

To install Python on a Windows computer, follow these steps:

  • Go to the official Python website (https://www.python.org/) and click on the Downloads tab.
  • Under the Windows section, select the latest version of Python (3.x.x) and click on the Download button.
  • Once the download is complete, open the installer file and follow the prompts to install Python on your computer.

Image

Portal demo examples

  • Start the Veriflite app on a phone or tablet and open the Portal mode (under Labs)

  • Download the example client code from here: https://github.com/Veriflite/portal_demo/archive/refs/heads/main.zip

  • Extract the .zip file

  • Right click in the portal_demo-main directory and select "Open in Terminal" Image

  • We need to install the websockets module for Python. In the command prompt, type:

pip install websockets
  • Now we can run the example code (here we are using the raw_portal.py example), using the IP address shown in the Veriflite app:
python raw_portal.py -i <ip address>

Image

This will simply print bounce events. This requires having sensors within range of the phone or tablet, and you will see the bounce events come through when the trampoline is in use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment