Back

Realtime alternative for python

  • 0
  • Self Hosted
  • Databases
  • Realtime
fadkeabhi
31 Aug, 2023, 14:13

I am working on an IOT application. For which I am using appwrite for server less features. Where I have to update information in a raspberry pi (python) in realtime as they change on the appwrite database. Here I have option to pool the appwrite database at a certain interval of time, but that may be request heavy. Is there any other alternative.

TL;DR
The user is asking for a realtime alternative for Python that can update information on a Raspberry Pi in realtime. Some suggestions mentioned include using webhooks, creating a secondary service with ngrok, setting up an endpoint on the Raspberry Pi and calling it from a cloud function triggered by an event, and using JavaScript with a local web server. The solution suggested is to set up a web server on the Raspberry Pi to handle events and use an Appwrite webhook to send the data to the Raspberry Pi. Another suggestion is to use JavaScript with Appwrite functions and events.
Guille
31 Aug, 2023, 15:44

What about functions with events? https://appwrite.io/docs/events

Guille
31 Aug, 2023, 15:46

Oh You want to get that changes in the raspi

Guille
31 Aug, 2023, 15:53

As server SDK doesn't have realtime support, there is any chance you can use javascript? maybe just to get the data in realtime

Drake
31 Aug, 2023, 20:00

you can set up a web server on your raspberry pi to handle the various events. then, set up an Appwrite Webhook to send the data to your raspberry pi.

https://appwrite.io/docs/webhooks

fadkeabhi
1 Sep, 2023, 01:09

The problem with javascript is that, I will have to set up the local web server and keep the browser always open. As even for javascript server side doesn't support realtime.

fadkeabhi
1 Sep, 2023, 01:15

Will try this method, Thank you for the suggestion

fadkeabhi
1 Sep, 2023, 01:16

Tried but how to send data to pi is the question.

Guille
1 Sep, 2023, 01:31

Will you raspi have a static ip?

Guille
1 Sep, 2023, 01:33

I was thinking that maybe you can create and endpoint in your raspi and call it from a cloud function triggered from a event 🤔

fadkeabhi
1 Sep, 2023, 13:08

I don't think that it will have static IP.

fadkeabhi
1 Sep, 2023, 13:11

I also thought of using ngrock. But it's free plan changes the domain name of our endpoint.

Guille
1 Sep, 2023, 13:19

That would be a painless option, the solution at the moment will always have a secondary service to communicate with the IOT device

fadkeabhi
1 Sep, 2023, 13:26

Ya I think the same way. Will create an secondary service, make it available through ngrock and will set an webhook to that link.

Guille
1 Sep, 2023, 13:29

It would make things easier for you

Guille
1 Sep, 2023, 13:29

Would be great to have a solution from appwrite side

VincentGe
1 Sep, 2023, 22:24

Webhooks

VincentGe
1 Sep, 2023, 22:24

😉

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more