-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the program #1
Comments
Hi, thanks for the feedback. For another project (scd30) I got some good advice how to integrate that with Python. I took the following from that project that you can tailor to your need : Stay Safe, Received the following code from Aeolus1364 (credits to him) . run_command("./scd30") |
THX for your fast response and hints. I’m gonna try. 😊
Von: paulvha <[email protected]>
Gesendet: Montag, 13. April 2020 17:35
An: paulvha/SVM30_on_raspberry <[email protected]>
Cc: hockenator <[email protected]>; Author <[email protected]>
Betreff: Re: [paulvha/SVM30_on_raspberry] Using the program (#1)
Hi, thanks for the feedback.
Make sure to read the SVM30.odt on how to compile and create an object and use it from the command line.
For another project (scd30) I got some good advice how to integrate that with Python. I took the following from that project that you can tailor to your need :
Stay Safe,
Paul
…_____
Received the following code from Aeolus1364 (credits to him) .
import subprocess, shlex
def run_command(command):
process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break
if output:
print(output.strip())
rc = process.poll()
return rc
run_command("./scd30")
It was part of an issue to integrate the scd30 program in Python and capture the output. To enable this the p_printf() changes were applied (version 3.0.2). p_printf() performs a ‘fflush(stdout)’ after each write which seems to be necessary for the integration to work well. Normally a line is detected after newline (which is performed as well in do_output()).
His full code is posted on : https://github.com/Aeolus1364/SCD30_Python_Library
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHSF3BIT3YYS6JMON2TS2MDRMMWKJANCNFSM4MHA4FKQ> . <https://github.com/notifications/beacon/AHSF3BKQBTQ3OMMPWURO26DRMMWKJA5CNFSM4MHA4FK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOESEOJIY.gif>
|
Paul, thanks for your great work. I'm currently like to connect an SVM to a RasPi for an indoor tVOC sampling and logging campaign. I followed your recommended steps in compiling the bcm2835 driver. Everything was fine, but: What I have to do now? My goal is to use a SVM30 library in a python code...
I'm a little bit confused, because "a new kid on the block".
Can you give a hint please?
The text was updated successfully, but these errors were encountered: