Skip to content
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

Add SPI Support for BMP388 and BMP390 #2680

Closed
shingle01 opened this issue Apr 8, 2024 · 11 comments · Fixed by esphome/esphome#6652 · May be fixed by esphome/esphome#6722
Closed

Add SPI Support for BMP388 and BMP390 #2680

shingle01 opened this issue Apr 8, 2024 · 11 comments · Fixed by esphome/esphome#6652 · May be fixed by esphome/esphome#6722

Comments

@shingle01
Copy link

Describe the problem you have/What new integration you would like

As per feature request #1321

BMP388 and BMP390 sensors supports I2C as well as SPI but ESPHome currently supports only I2C for it. It would be great if SPI support was added for this sensor as well.

Please describe your use case for this integration and alternatives you've tried:

Same as above

Additional context

Same as above

@shingle01 shingle01 changed the title Add SPI Support for BMP388 Add SPI Support for BMP388 and BMP390 Apr 8, 2024
@latonita
Copy link

@shingle01 do you own i2c or spi?

@shingle01
Copy link
Author

shingle01 commented Apr 28, 2024 via email

@latonita
Copy link

latonita commented Apr 28, 2024 via email

@latonita
Copy link

latonita commented Apr 28, 2024

@shingle01
try new PR. please test both modes

esphome:
  name: bmp3xx-test

esp32:
  board: esp32dev
  framework:
    type: arduino

# esp8266:
#   board: nodemcuv2

logger:
  level: DEBUG


external_components:
  - source: github://pr#6652
    refresh: 10s
    components: [bmp3xx_base, bmp3xx_i2c, bmp3xx_spi]

spi:
  clk_pin: 19
  mosi_pin: 20
  miso_pin: 21

i2c:
  sda: GPIO14
  scl: GPIO26
  scan: true
  frequency: 5kHz

sensor:
  - platform: bmp3xx_spi
    cs_pin: 13
    temperature:
      name: "Outside Temperature"
      oversampling: 16x
    pressure:
      name: "Outside Pressure"
    update_interval: 60s
  - platform: bmp3xx_i2c
    address: 0x77
    temperature:
      name: "Outside Temperature"
      oversampling: 16x
    pressure:
      name: "Outside Pressure"
    update_interval: 60s

@shingle01
Copy link
Author

shingle01 commented May 11, 2024

Sorry for the delay. Testing SPI only I get an error:

[13:30:09][C][bmp3xx.sensor:151]: BMP3XX:
[13:30:09][C][bmp3xx.sensor:152]: Type: Unknown Chip Type (0xFF)
[13:30:09][E][bmp3xx.sensor:163]: BMP3XX has wrong chip ID (reported id: 0xFF) - please check if you are really using a BMP 388 or BMP 390
[13:30:09][C][bmp3xx.sensor:172]: IIR Filter: OFF
[13:30:09][C][bmp3xx.sensor:173]: Update Interval: 60.0s
[13:30:09][C][bmp3xx.sensor:175]: Temperature 'Outside Temperature'
[13:30:09][C][bmp3xx.sensor:175]: Device Class: 'temperature'
[13:30:09][C][bmp3xx.sensor:175]: State Class: 'measurement'
[13:30:09][C][bmp3xx.sensor:175]: Unit of Measurement: '°C'
[13:30:09][C][bmp3xx.sensor:175]: Accuracy Decimals: 1
[13:30:09][C][bmp3xx.sensor:176]: Oversampling: 16x
[13:30:09][C][bmp3xx.sensor:179]: Pressure 'Outside Pressure'
[13:30:09][C][bmp3xx.sensor:179]: Device Class: 'pressure'
[13:30:09][C][bmp3xx.sensor:179]: State Class: 'measurement'
[13:30:09][C][bmp3xx.sensor:179]: Unit of Measurement: 'hPa'
[13:30:09][C][bmp3xx.sensor:179]: Accuracy Decimals: 1
[13:30:09][C][bmp3xx.sensor:180]: Oversampling: 16x
[13:30:09][E][component:082]: Component bmp3xx_base is marked FAILED

@latonita
Copy link

@shingle01 please test new PR for SPI

  • source: github://pr#6722

@shingle01
Copy link
Author

shingle01 commented May 11, 2024 via email

@latonita
Copy link

latonita commented May 11, 2024 via email

@shingle01
Copy link
Author

shingle01 commented May 11, 2024 via email

@latonita
Copy link

@shingle01 apologies, its hard to read the log, it is deformed
would you please paste it in via ``` signs in the github ui, not via email. thanks

@shingle01
Copy link
Author

[09:40:41][C][bmp3xx.sensor:151]: BMP3XX:
[09:40:41][C][bmp3xx.sensor:152]:   Type: BMP 388 (0x50)
[09:40:41][C][bmp3xx.sensor:172]:   IIR Filter: OFF
[09:40:41][C][bmp3xx.sensor:173]:   Update Interval: 60.0s
[09:40:41][C][bmp3xx.sensor:175]:   Temperature 'Outside Temperature'
[09:40:41][C][bmp3xx.sensor:175]:     Device Class: 'temperature'
[09:40:41][C][bmp3xx.sensor:175]:     State Class: 'measurement'
[09:40:41][C][bmp3xx.sensor:175]:     Unit of Measurement: '°C'
[09:40:41][C][bmp3xx.sensor:175]:     Accuracy Decimals: 1
[09:40:41][C][bmp3xx.sensor:176]:     Oversampling: 16x
[09:40:41][C][bmp3xx.sensor:179]:   Pressure 'Outside Pressure'
[09:40:41][C][bmp3xx.sensor:179]:     Device Class: 'pressure'
[09:40:41][C][bmp3xx.sensor:179]:     State Class: 'measurement'
[09:40:41][C][bmp3xx.sensor:179]:     Unit of Measurement: 'hPa'
[09:40:41][C][bmp3xx.sensor:179]:     Accuracy Decimals: 1
[09:40:41][C][bmp3xx.sensor:180]:     Oversampling: 16x
[09:41:16][VV][scheduler:226]: Running interval 'update' with interval=60000 last_execution=4294952051 (now=44761)
[09:41:16][V][bmp3xx.sensor:189]: Sending conversion request...
[09:41:16][VV][bmp3xx.sensor:202]: measurement time 67
[09:41:16][VV][scheduler:032]: set_timeout(name='data', timeout=67)
[09:41:16][VV][scheduler:226]: Running timeout 'data' with interval=67 last_execution=44776 (now=44844)
[09:41:16][VV][bmp3xx.sensor:349]: data ready status 8
[09:41:16][D][bmp3xx.sensor:212]: Got temperature=-849.3°C pressure=-19404.6hPa
[09:41:16][V][sensor:043]: 'Outside Temperature': Received new state -849.316772
[09:41:16][D][sensor:094]: 'Outside Temperature': Sending state -849.31677 °C with 1 decimals of accuracy
[09:41:16][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 2259435129
  state: -849.317
  missing_state: NO
}
[09:41:16][V][sensor:043]: 'Outside Pressure': Received new state -19404.640625
[09:41:16][D][sensor:094]: 'Outside Pressure': Sending state -19404.64062 hPa with 1 decimals of accuracy
[09:41:16][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 3243141300
  state: -19404.6
  missing_state: NO
}
[09:41:16][W][component:237]: Component bmp3xx_base took a long time for an operation (89 ms).
[09:41:16][W][component:238]: Components should block for at most 30 ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants