Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use Device SDK with Django (Python) app

I wanted to show real-time heart rate on my Django app, but I am also using the web API to show various summaries.

 

How can I use both to get to the desired goal?

Best Answer
0 Votes
4 REPLIES 4

The Web API doesn't provide real-time data. It only updates after the device syncs, which can be every 20 minutes or so.

If you really want real-time data, you'll need to use the device and companion APIs. You'll probably also need to write some server code to receive the data (perhaps within your Django app). The comms are difficult.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thank you for a quick response.

I have not been able to find any way to integrate Companion API with my Django project. It would be great if you could guide me in the right way.

Best Answer
0 Votes

The companion can only communicate using fetch() or WebSocket. WebSocket is probably better suited to real-time streaming. You'll need to write server code somewhere to receive the fetch() requests or WebSocket messages.

 

Be warned that you may need to use https/wss, rather than http/ws, depending on where the server is running.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thank you so much for the help. I will try it out and get back to you if it worked.

Best Answer
0 Votes