Skip to main content

A management API for connecting and managing Clients via websocket connections.

Project description Server Overview

This project aims to create a lightweight and intuitive system for connecting IoT devices to a central server for small IoT system implementations and hobbyists.

The framework focuses on providing easy to use system of libraries so the end user does not need to understand the protocol implementation, though this also is fairly simple.

The format of the framework is somewhat reminiscent of Socket.IO where handlers functions are defined and executed and run as events are triggered.

Quickstart Guide (Server)

This is an example of a simple IoTManager instance which accepts a "EhcoClient" and will print every message the client sends out to console.

from flask import Flask
from iotio import IoTManager, DeviceType, IoTClient

# create a flask app
app = Flask(" demo app")

# create an instance of the IoTManager
manager = IoTManager(app)

# define our EchoClient device
class EchoClient(DeviceType):
    # announce clients connecting
    def on_connect(self, client: IoTClient):
        print("New Ping Client Connected! ID: " +

    # define a handler for when the client recieves a "message" event
    def on_message(self, message: str, client: IoTClient):
        print("Message from Client with ID '" + + "': " + message)

        # respond by sending a message to the client's 'message' event handler
        return message

    # announce clients disconnecting
    def on_disconnect(self, client: IoTClient):
        print("Echo Client Disconnected! ID: " +

# add the device type to the manager

# run the server
if __name__ == "__main__":
    from gevent import pywsgi
    from geventwebsocket.handler import WebSocketHandler
    server = pywsgi.WSGIServer(('', 5000), app, handler_class=WebSocketHandler)

If you would like to see the matching quickstart guide for an example client go here.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size (9.0 kB) File type Egg Python version 3.8 Upload date Hashes View
Filename, size (10.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size (8.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page