meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
groups:mg:private:resonatoren:mg:temperture_monitoring:start [2022/02/15 15:30] – [Temperature, Pressure and Humidity of the Frequencycomb] fienegroups:mg:private:resonatoren:mg:temperture_monitoring:start [2024/03/20 09:37] (current) – Admin: Syntax-Update (Migration from deprecated "fontcolor" plugin to "color" plugin) klaus
Line 74: Line 74:
  
 <blockquote> <blockquote>
-<fc #008000>//#!/usr/bin/python3//</fc>+<color #008000>//#!/usr/bin/python3//</color>
  
-**<fc #008000>import</fc> <fc #6495ed>board</fc> \\ +**<color #008000>import</color> <color #6495ed>board</color> \\ 
-<fc #008000>import</fc> <fc #6495ed>busio</fc> \\ +<color #008000>import</color> <color #6495ed>busio</color> \\ 
-<fc #008000>import</fc><fc #6495ed> adafruit_bmp280</fc>**+<color #008000>import</color><color #6495ed> adafruit_bmp280</color>**
  
 i2c = busio.I2C(board.SCL, board.SDA)\\ i2c = busio.I2C(board.SCL, board.SDA)\\
 bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c, address=0x76) bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c, address=0x76)
  
-<fc #008000>print</fc>(<fc #ff0000>"Temperature: %0.1f C"</fc> % bmp280.temperature)\\ +<color #008000>print</color>(<color #ff0000>"Temperature: %0.1f C"</color> % bmp280.temperature)\\ 
-<fc #008000>print</fc>(<fc #ff0000>"Pressure: %0.1f hPa"</fc> % bmp280.pressure)+<color #008000>print</color>(<color #ff0000>"Pressure: %0.1f hPa"</color> % bmp280.pressure)
 </blockquote> </blockquote>
  
Line 282: Line 282:
 magnesium: influxMG magnesium: influxMG
 </code> </code>
-This is the username and password for any external collectd services to authenticate with the influxdb database.+This is the username and password for any external collectd services to authenticate with the influxdb database.\\ 
 +To load InfluxDB with your new configurations, enter
  
 +<code>
 +echo $INFLUXDB_CONFIG_PATH /etc/influxdb/influxdb.conf
 +</code>
 +
 +and start the process with ''influxd'' or - as a second option - start the process always with ''influxd -config /etc/influxdb/influxdb.conf''.
  
 === types.db === === types.db ===
Line 443: Line 449:
  
 <blockquote> <blockquote>
-<fc #008000>//#!/usr/bin/python3//</fc>+<color #008000>//#!/usr/bin/python3//</color>
  
-**<fc #008000>import</fc> <fc #6495ed>board</fc> \\ +**<color #008000>import</color> <color #6495ed>board</color> \\ 
-<fc #008000>import</fc> <fc #6495ed>busio</fc> \\ +<color #008000>import</color> <color #6495ed>busio</color> \\ 
-<fc #008000>import</fc> <fc #6495ed>adafruit_bmp280</fc>\\ +<color #008000>import</color> <color #6495ed>adafruit_bmp280</color>\\ 
-<fc #008000>import</fc> <fc #6495ed>sys</fc>\\ +<color #008000>import</color> <color #6495ed>sys</color>\\ 
-<fc #008000>import</fc> <fc #6495ed>Adafruit_DHT</fc>\\+<color #008000>import</color> <color #6495ed>Adafruit_DHT</color>\\
  
 i2c = busio.I2C(board.SCL, board.SDA)\\ i2c = busio.I2C(board.SCL, board.SDA)\\
Line 460: Line 466:
  
 \\ \\
-**<fc #008000>print</fc>(<fc #ff0000>"Pressure: %0.1f hPa"</fc> % pressure)**\\+**<color #008000>print</color>(<color #ff0000>"Pressure: %0.1f hPa"</color> % pressure)**\\
 \\ \\
-**<fc #008000>if</fc> humidity <fc #008000>is not</fc> <fc #ff00ff>None</fc> <fc #008000>and</fc> temperature <fc #008000>is not</fc> <fc #ff00ff>None</fc>: **\\+**<color #008000>if</color> humidity <color #008000>is not</color> <color #ff00ff>None</color> <color #008000>and</color> temperature <color #008000>is not</color> <color #ff00ff>None</color>: **\\
 \\ \\
 **temperature = (bmp280.temperature + temperature)/2\\ **temperature = (bmp280.temperature + temperature)/2\\
-<fc #008000>print</fc>(<fc #ff0000>"Temperature: %0.1f C"</fc> % temperature)\\ +<color #008000>print</color>(<color #ff0000>"Temperature: %0.1f C"</color> % temperature)\\ 
-<fc #008000>print</fc>(<fc #ff0000>"Humidity: %0.1f g/m3"</fc> % humidity)**\\+<color #008000>print</color>(<color #ff0000>"Humidity: %0.1f g/m3"</color> % humidity)**\\
 \\ \\
-**<fc #008000>else</fc>:\\+**<color #008000>else</color>:\\
 \\ \\
-      print(<fc #ff0000>"Failed to read AM2302 sensor! Check connections!"</fc>)\\+      print(<color #ff0000>"Failed to read AM2302 sensor! Check connections!"</color>)\\
       sys.exit(1)**\\       sys.exit(1)**\\