I'm receiving the weather data from my weather station with a dongle on my raspberry pi, that has internet connection via wifi. Now I want to send this data to a rails api/app to save it there in a database. The rails app runs on another server, so I want to post the data via http.
How can I do this. I can't add the curl dependency to the rtl_433 project (https://github.com/merbanan/rtl_433) to send the data directly to my backend. Am I able to run the rtl_433 for example with a python script like:
rlt_433 -F json and take that output to send it to my backend or how can I realize that?
rtl_433 on raspberry pi: Send data to api via http post
1.6k Views Asked by st3ffb3 At
2
There are 2 best solutions below
4
Leo
On
You should be able to execute rtl_433 as a subprocess using the subprocess module. Normally you would just use subprocess.run, but since rtl_433 produces output until it is killed, you will need to use subprocess.Popen and parse the output.
Another option is to pipe the output of rtl_433 to your program and using input() or sys.stdin.readline() to read lines. Like rtl_433 -flags | python3 script.py.
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in RUBY-ON-RAILS
- How to display legend box in tooltip text for amCharts 5 in Rails application?
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- rails minitest not picking up fixture properly, instance variable not percolating
- Duplicate GET requests - Rails & Heroku
- How to stub out current_user in JWT model for Rspec?
- NameError in Home#index
- Verifying Google Identity OAuth2 token with Ruby
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- why is mission_control-jobs erroring with load path error?
- Rescuing validation errors from a polymorphic association
- New error on random number assigned to local variable , Rails
- How to fix error in model with gem lockbox
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- controller test_methods generating two errors intermittently
Related Questions in HTTP
- Handling both JSON and form values in POST request body with unknown values in Golang
- Why can't I use PUT requests?
- nginx set up reverse proxy from subfolder to a port
- Async Web Server RP2040 returning ERR_CONNECTION_REFUSED?
- Getting `FormatException: Missing extension byte (at offset 6)` exception for accessing `response.body` from a server deployed in Vercel
- Retrieving list of values from MYSQL data base based on input value(LARAVEL 10 )(GET HTTP METHOD)
- Unable to add request headers via CHttpFile - C++/MFC
- Why do we call all http services 'Web Api/Web Service'?
- How to correctly read POST REQUEST body on ESP32?
- on linux gitclone issue remote server error showing fatal error with proxy n port
- Elasticsearch - cascading http inputs from Airflow API
- How to clean the html pages opened in a session?
- UTF-8 is not a valid encoding name
- I dont get the Result i expected when i want to get my Telegram Chatbot id
- NextJS 14 SSE with TransformStream() sending messages in a single response
Related Questions in RASPBERRY-PI
- Raspberry Pi Sense Hat with Pyinstaller
- Waiting for several hours before resuming execution
- Using compositor in Gstreamer to merge imagesequence with video/audio stream
- How to make this sensor keep taking readings once its when_in_range function has been activated?
- Emulating an HID device with a raspberry pi 5
- How to stream PCM audio to a speakers both on mac and linux in Node.js?
- I want to use NRF24L01 transceiver with raspberry pi but some GPIO pins are already occupied by 3.5 inch display how do i connect transceiver
- voron 2.4 mainsail kiauh error install crowsnest (solved problem)
- Pi4J minimal example's LED doesn't blink
- How can I connect and send data from react-native to raspberry pi
- Xpt 2046 Display with Pn532 RFID reader
- Google SDK for Raspberry pi
- How to use a RaspberryPi camera with the cv2.videoCapture() function?
- How do I capture audio from the system bus in a node app (or from sox) on a raspberry pi?
- Can't open /dev/mem: Operation not permitted Raspberry Pi
Related Questions in RTL-SDR
- pymodes Modeslive throws ValueError: ctypes objects containing pointers cannot be pickled
- GNU Radio RTL-SDR command syntax
- Using `async for` inside a timeout function in Python
- Terminating an asyncio loop with RTL-SDR after N seconds
- Can not get any time/freq domain plots to show after execution
- Installing SoapySdr modules for RTL-SDR or AirSpy
- Problems during the installation of rtl-sdr drivers in linux
- Gnuplot: plot not updated
- Gnuplot: line 0: no previous plot
- rtl_433 command output will not pipe to php script
- Issues with QPSK modulation & Demodulation
- What are the settings for receiving signals in MIMO mode with META information on BladeRF
- SoapySDR rust bindings reading samples
- have any one used plutoSDR via python
- How to shift IQ stream using numpy?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I figured it now out, how to get the data from the subprocess and listen to it all the time:
I installed
python 3.8to use thedatetimelibrary correctly. This approach is supported withversion >= python 3.7I created a python script, taht is listening to the output of my
rtl_433command. As you can see I'm using:rtl_433 -f 868.300M -F json.here is my
listener.py:after that I can use:
python3.8 listener.pyand get all the data that is sent by the weather station