Link Search Menu Expand Document

arena-py API v1.0.1

arena.arena_mqtt

class ArenaMQTT:

Wrapper around Paho MQTT client and EventLoop.

ArenaMQTT( web_host='arenaxr.org', realm='realm', network_latency_interval=10000, on_msg_callback=None, end_program_callback=None, video=False, debug=False, headless=False, **kwargs)
scene = None
device = None
auth = None
debug
username
remote_auth_token
mqttc_id
config_url
config_data
mqtt_host
topicParams
latency_topic
ignore_topic
can_publish_obj
mqttc
on_msg_callback
end_program_callback
event_loop
mqtt_connect_evt
subscriptions
msg_queue
def generate_client_id(self):

Returns a random 6 digit id

def network_latency_update(self):

Update client latency in $NETWORK/latency

def run_once(self, func=None, **kwargs):

Runs a user-defined function on startup

def run_after_interval(self, func=None, interval_ms=1000, **kwargs):

Runs a user-defined function after a interval_ms milliseconds

def run_async(self, func=None, **kwargs):

Runs a user defined aynscio function

def run_forever(self, func=None, interval_ms=1000, **kwargs):

Runs a function every interval_ms milliseconds

def run_tasks(self):

Run event loop

def stop_tasks(self):

Stop event loop

async def sleep(self, interval_ms):

Public function for sleeping in async functions

def on_connect(self, client, userdata, flags, rc):

Paho MQTT client on_connect callback

def do_subscribe(self, client, topic, callback):
def on_message(self, client, userdata, msg):
def on_message_private(self, client, userdata, msg):
async def process_message(self):
def on_subscribe(self, client, userdata, mid, granted_qos, properties=None):
def on_disconnect(self, client, userdata, rc):

Paho MQTT client on_disconnect callback

def disconnect(self):

Disconnects Paho MQTT client

def message_callback_add(self, sub, callback):

Subscribes to new topic and adds callback

def message_callback_remove(self, sub):

Unsubscribes to topic and removes callback

def rcv_queue_len(self):

Return receive queue length

def pub_queue_len(self):

Return publish queue length

def client_id(self):

Return client id


Table of contents