NOTICE: This forum has been archived (i.e. registration and posting is disabled).

Please go to the new forum at https://forum.kylegabriel.com

Bosch BME680 Issues
 
Notifications
Clear all

Bosch BME680 Issues

Page 1 / 3

lemonsquash11
(@lemonsquash11)
Trusted Member
Joined: 9 months ago
Posts: 67
Topic starter  

I'm running into some issues when using a BME680 sensor via I2C.

The Temperature is stuck at 34.15°C and the humidity at 100% after every backend restart, none of the values change, even over a longer period of time.

When running adafruit's test script, which utilises their BME680 python library instead of pimoroni's, i get comparable values to the SHT31 that is connected on the same breadboard. Running this test script while Mycodo is running instantly makes the correct values show up in Mycodo too.

Could someone please create an input module for the BME680 that uses Adafruit's library, as Mycodo's default input-module for the bme doesn't seem to work correctly?

 

cheers


Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

I'll see what I can put together and provide an Input module you can import and test. 


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

Give the attached input module a try by renaming from txt to py, then importing it on the Configure -> Custom Inputs page.


ReplyQuote
lemonsquash11
(@lemonsquash11)
Trusted Member
Joined: 9 months ago
Posts: 67
Topic starter  

@kylegabriel

I can't save the data input, i get following error:

"

  • Error: Modify Input: Error: Humidity Oversampling: Invalid range. Need one of ['OS_NONE', 'OS_1X', 'OS_2X', 'OS_4X', 'OS_8X', 'OS_16X']
  • Error: Modify Input: Error: Temperature Oversampling: Invalid range. Need one of ['OS_NONE', 'OS_1X', 'OS_2X', 'OS_4X', 'OS_8X', 'OS_16X']
  • Error: Modify Input: Error: Pressure Oversampling: Invalid range. Need one of ['OS_NONE', 'OS_1X', 'OS_2X', 'OS_4X', 'OS_8X', 'OS_16X']
  • Error: Modify Input: Error: IIR Filter Size: Invalid range. Need one of ['FILTER_SIZE_0', 'FILTER_SIZE_1', 'FILTER_SIZE_3', 'FILTER_SIZE_7', 'FILTER_SIZE_15', 'FILTER_SIZE_31', 'FILTER_SIZE_63', 'FILTER_SIZE_127']"

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

Here's test v02. Delete your input, delete the imported module, then import the attached module.


ReplyQuote
lemonsquash11
(@lemonsquash11)
Trusted Member
Joined: 9 months ago
Posts: 67
Topic starter  

@kylegabriel

still the same issue, but the error now reads

  • Error: Modify Input: Error: Humidity Oversampling: Invalid range. Need one of [0, 1, 2, 4, 8, 16]
  • Error: Modify Input: Error: Temperature Oversampling: Invalid range. Need one of [0, 1, 2, 4, 8, 16]
  • Error: Modify Input: Error: Pressure Oversampling: Invalid range. Need one of [0, 1, 2, 4, 8, 16]
  • Error: Modify Input: Error: IIR Filter Size: Invalid range. Need one of [0, 1, 3, 7, 15, 31, 63, 127]

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

v03 test.


ReplyQuote
lemonsquash11
(@lemonsquash11)
Trusted Member
Joined: 9 months ago
Posts: 67
Topic starter  

Getting following error when i try to deactivate the input, also no data showing up:

  • Error: Could not deactivate Input controller with ID 1b600e28-30da-493c-a314-d67f53a8bcac: 'NoneType' object has no attribute 'stop_input'

 

Log:

2021-02-23 0122,747 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0137,669 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0144,688 - ERROR - mycodo.daemon - Could not deactivate Input controller with ID 1b600e28-30da-493c-a314-d67f53a8bcac: 'NoneType' object has no attribute 'stop_input'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/mycodo_daemon.py", line 341, in controller_deactivate
    self.controller[cont_type][cont_id].stop_controller()
  File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 109, in stop_controller
    self.pre_stop()
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 516, in pre_stop
    self.measure_input.stop_input()
AttributeError: 'NoneType' object has no attribute 'stop_input'
2021-02-23 0151,520 - WARNING - mycodo.daemon - Cannot activate Input controller with ID 1b600e28-30da-493c-a314-d67f53a8bcac: It's already active.
2021-02-23 0152,693 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'

 


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

You've copied log lines after the input has already crashed and you didn't include the relevant error. You need ot include the line of the input activating and the relevant error will be between that line and the ones you copied.


ReplyQuote
lemonsquash11
(@lemonsquash11)
Trusted Member
Joined: 9 months ago
Posts: 67
Topic starter  
2021-02-23 0132,597 - INFO - mycodo.daemon - Mycodo daemon v8.8.8 starting
2021-02-23 0133,125 - INFO - mycodo.outputs.on_off_python_e6495c9f - 2021-02-23 01 ID: e6495c9f-eb02-4942-89c6-cdbba610ce85: OFF
2021-02-23 0133,125 - INFO - mycodo.outputs.on_off_python_e6495c9f - Initialized in 192.8 ms
2021-02-23 0133,584 - INFO - mycodo.outputs.mqtt_ea2352b4 - Initialized in 457.8 ms
2021-02-23 0133,585 - INFO - mycodo.controllers.controller_output - Activated in 767.6 ms
2021-02-23 0134,086 - INFO - mycodo.daemon - All activated Conditional controllers started
2021-02-23 0134,086 - INFO - mycodo.daemon - All activated Trigger controllers started
2021-02-23 0134,465 - ERROR - mycodo.controllers.controller_input_1b600e28 - initialize_variables() Exception: 'int' object is not callable
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 72, in run
    self.initialize_variables()
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 338, in initialize_variables
    self.measure_input = input_loaded.InputModule(self.input_dev)
  File "/home/pi/Mycodo/mycodo/inputs/custom_inputs/bme680_cp.py", line 181, in __init__
    self.initialize_input()
  File "/home/pi/Mycodo/mycodo/inputs/custom_inputs/bme680_cp.py", line 192, in initialize_input
    self.sensor.humidity_oversample(self.humidity_oversample)
TypeError: 'int' object is not callable
2021-02-23 0134,471 - INFO - mycodo.controllers.controller_input_1b600e28 - Activated in 235.3 ms
2021-02-23 0134,471 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0134,471 - INFO - mycodo.daemon - All activated Input controllers started
2021-02-23 0134,472 - INFO - mycodo.daemon - All activated Math controllers started
2021-02-23 0134,472 - INFO - mycodo.daemon - All activated PID controllers started
2021-02-23 0134,472 - INFO - mycodo.daemon - All activated LCD controllers started
2021-02-23 0134,472 - INFO - mycodo.daemon - All activated Custom controllers started
2021-02-23 0134,555 - INFO - mycodo.controllers.controller_widget - Activated in 82.4 ms
2021-02-23 0135,556 - INFO - mycodo.daemon - Mycodo daemon started in 2.956 seconds
2021-02-23 0135,561 - INFO - mycodo.daemon - 41.47 MB RAM in use
2021-02-23 0100,406 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0104,412 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0119,433 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0134,354 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0149,376 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'
2021-02-23 0104,397 - ERROR - mycodo.controllers.controller_input_1b600e28 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

Thanks. v04 test.


ReplyQuote
lemonsquash11
(@lemonsquash11)
Trusted Member
Joined: 9 months ago
Posts: 67
Topic starter  

no data yet unfortunately 

2021-02-23 0144,733 - ERROR - mycodo.controllers.controller_input_b8979366 - initialize_variables() Exception: Invalid oversample
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 72, in run
    self.initialize_variables()
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 338, in initialize_variables
    self.measure_input = input_loaded.InputModule(self.input_dev)
  File "/home/pi/Mycodo/mycodo/inputs/custom_inputs/bme680_cp.py", line 181, in __init__
    self.initialize_input()
  File "/home/pi/Mycodo/mycodo/inputs/custom_inputs/bme680_cp.py", line 192, in initialize_input
    self.sensor.humidity_oversample = self.humidity_oversample
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bme680.py", line 185, in humidity_oversample
    raise RuntimeError("Invalid oversample")
RuntimeError: Invalid oversample
2021-02-23 0144,737 - INFO - mycodo.controllers.controller_input_b8979366 - Activated in 201.2 ms
2021-02-23 0144,737 - ERROR - mycodo.controllers.controller_input_b8979366 - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

v05 contains a debug line.


ReplyQuote
lemonsquash11
(@lemonsquash11)
Trusted Member
Joined: 9 months ago
Posts: 67
Topic starter  

@kylegabriel

Here's the latest log:

2021-02-23 0808,228 - DEBUG - mycodo.inputs.bme680_cp_3869853c - HO: <class 'str'>, 0, TO: <class 'str'>, 0, PO: <class 'str'>, 0, FS: <class 'str'>, 
2021-02-23 0808,228 - ERROR - mycodo.controllers.controller_input_3869853c - initialize_variables() Exception: Invalid oversample
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 72, in run
    self.initialize_variables()
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 338, in initialize_variables
    self.measure_input = input_loaded.InputModule(self.input_dev)
  File "/home/pi/Mycodo/mycodo/inputs/custom_inputs/bme680_cp.py", line 181, in __init__
    self.initialize_input()
  File "/home/pi/Mycodo/mycodo/inputs/custom_inputs/bme680_cp.py", line 198, in initialize_input
    self.sensor.humidity_oversample = self.humidity_oversample
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bme680.py", line 185, in humidity_oversample
    raise RuntimeError("Invalid oversample")
RuntimeError: Invalid oversample
2021-02-23 0808,231 - INFO - mycodo.controllers.controller_input_3869853c - Activated in 189.8 ms
2021-02-23 0808,231 - ERROR - mycodo.controllers.controller_input_3869853c - Error while attempting to read input: 'NoneType' object has no attribute 'next'
Traceback (most recent call last):
  File "/var/mycodo-root/mycodo/controllers/controller_input.py", line 391, in update_measure
    measurements = self.measure_input.next()
AttributeError: 'NoneType' object has no attribute 'next'

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 7 years ago
Posts: 0
 

v06


ReplyQuote
Page 1 / 3