i have a raspberry pi that is behind a firewall but has outbound http access.
any streamlit app in the community cloud is in a similar situation, but with inbound and outbound http access.
how can I send, oh say, 12 numbers from the pi to a streamlit app on the community cloud once a second, in real time?
I’ve been trying get requests with curl but streamlit is not receiving the curl command line requests with parameters. the code and problem is in another post here. but that may be the wrong approach.
what is the recommended way to get real time data into a streamlit app running in the community cloud?
Streamlit doesn’t have an API meant for non-user, externally initiated connections. All incoming connections to a Streamlit app should be users (or simulated users through something like Selenium).
If your Raspberry Pi is your source of data and you mean to just stream data while someone is viewing your app, I’d set up you Raspberry Pi to receive requests and have Streamlit reach out to your Raspberry Pi. (e.g. look at something like ngrok)
However, if you mean to use your app as a store of data across all time, I’d recommend setting up a database somewhere instead. Then just have your app pull from that database as needed.
I’ve never used ngrok or zrok or tunnelmole. these address the problem I’m facing but have their own complexity and learning curve. the pi can be setup however but inbound access is the main problem.
we’ve got a database setup already with long term storage, locally and at an online mongodb store. this is the current weather station dashboard:
It’s great, except it lacks current conditions.
I’m trying to bring in about 8-12 numbers, live, with current weather conditions straight from the sensors.
Ngrok and similar is not the most appealing. I’ll try to get a command line client to work over standard inbound http.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.