Emitting dronekit.io vehicle's attribute changes using flask-socket.io

I'm trying to send data from my dronekit.io vehicle using flask-socket.io. Unfortunately, I got this log:Starting copter simulator (SITL)SITL already Downloaded and Extracted.Ready to boot.Connecting to vehicle on: tcp:127.0.0.1:5760>>> APM:Copter V3.3 (d6053245)>>> Frame: QUAD>>> Calibrating barometer>>> Initialising APM...>>> barometer calibration complete>>> GROUND START* Restarting with statlatitude -35.363261>>> Exception in attribute handler for location.global_relative_frame...Read more

I cannot initialize Flask SocketIO with app.from_object parameter

I have an app.py file where I initialize my app. I have another file (run.py) where I run Flask server from. Everything works with a standard flask app. However I am trying to integrate flask-socketio and it keeps failing with different errors depending on how I try to initialize the app.I have tried the following ways to initialize flask-socketio:socketio = SocketIO(app.config.from_object(app_config[env_name]))socketio = SocketIO(app, **app.config[env_name])socketio = SocketIO(**app.config[env_name])Here is the relevant code from my app.py fil...Read more

flask socketio - Server to Server Communication

I'd like to know if there's a way to communicate directly between two (or more) flask-socketio servers. I want to pass information between servers, and have clients connect a single web socket server, which would have all the combined logic and data from the other servers.I found this example in JS Socket IO Server to Server where the solution was to use a socket.io-client to connect to another server.I've looked through the Flask-SocketIO documentation, as well as other resources, however it doesn't appear that Flask-SocketIO has a client comp...Read more

How to speed up flask-socketio Emit

I need to regularly send processed frames from opencv-python backed to a nodejs frontend. I am using flask-socketio for communication between nodejs and opencv-python.I am able to get the output by emitting at the end of each iteration in a while loop. But the there is latency and i am not getting good enough fps. How can i improve the FPS for real-time video processing?I have tried async_mode of flask-socketio as eventlet which only emitted for every loop when i used sleep after the emit line. Having sleep leads to further reduction in FPS. On...Read more

flask-socketio: before_send/after_send

On flask socket-io, if there are 2 users connected and user1 sends a message to user2, how can I intercept the payload being sent to user2 (on the app context of user2, in order to modify it)? I do not want to modify the payload being sent by user1 (this would be trivial).Logically, I guess there should be a way to intercept the event on the context of user2 just before the payload is being transmitted on the ws.Thanks!...Read more

Background thread gets started twice with Flask-Socketio

I have created a small Flask webapp using socketio that is supposed to visualize a brew controller. The hardware is a Raspberry Pi and the controller part (hardware binding and data collection) is done in a separate background thread which is started in create_app. I need to make sure the background thread only gets started once (even if I create multiple app objects). So I use the BrewController.get_instance()function to realize some kind of singleton pattern.import osimport timeimport threadingimport arrowfrom sqlitedict import SqliteDictfrom...Read more