Closed UncleRus closed 1 year ago
I got some errors.
I (274) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (281) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (287) heap_init: At 4008C8A8 len 00013758 (77 KiB): IRAM
I (294) spi_flash: detected chip: generic
I (298) spi_flash: flash io: dio
I (303) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
E (0) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x4008637c
0x4008637c: _esp_error_check_failed at /home/aschiavon/esp/esp-idf/components/esp_system/esp_err.c:42
file: "/home/aschiavon/Projetos/IOT/esp32/hello_world/main/am2320_sensor.c" line 18
func: AM2320Read
expression: am2320_get_device_id(&dev, &dev_id)
abort() was called at PC 0x4008637f on core 1
0x4008637f: _esp_error_check_failed at /home/aschiavon/esp/esp-idf/components/esp_system/esp_err.c:43
Backtrace:0x40081426:0x3ffb81b00x40086389:0x3ffb81d0 0x4008b59a:0x3ffb81f0 0x4008637f:0x3ffb8260 0x400d27e7:0x3ffb8280 0x40088ee1:0x3ffb82f0
0x40081426: panic_abort at /home/aschiavon/esp/esp-idf/components/esp_system/panic.c:402
0x40086389: esp_system_abort at /home/aschiavon/esp/esp-idf/components/esp_system/esp_system.c:128
0x4008b59a: abort at /home/aschiavon/esp/esp-idf/components/newlib/abort.c:46
0x4008637f: _esp_error_check_failed at /home/aschiavon/esp/esp-idf/components/esp_system/esp_err.c:43
0x400d27e7: AM2320Read at /home/aschiavon/Projetos/IOT/esp32/hello_world/main/am2320_sensor.c:18 (discriminator 1)
0x40088ee1: vPortTaskWrapper at /home/aschiavon/esp/esp-idf/components/freertos/port/xtensa/port.c:131
ELF file SHA256: 785dea74c6c904c0
Rebooting...
Looks like a wiring problem. Please recheck wiring, use appropriate pull-up resistors.
I also ask you to build and flash an I2C bus scanner into your device. https://github.com/UncleRus/esp-idf-lib/tree/master/examples/i2cdev/default
Looks like a wiring problem. Please recheck wiring, use appropriate pull-up resistors.
I also ask you to build and flash an I2C bus scanner into your device. https://github.com/UncleRus/esp-idf-lib/tree/master/examples/i2cdev/default
You're right, it's a wiring problem, after adding appropriate pull-up resistors I'm able to read the temp and humidity, but I'm also getting some errors, I did do something wrong?
I (10) am2320: Model ID: 131
I (10) am2320: Version: 0
I (20) am2320: Temperature: 30.5°C, Humidity: 51.8%
E (520) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
E (520) am2320: Error reading data: -1 (ESP_FAIL)
E (1030) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
E (1030) am2320: Error reading data: -1 (ESP_FAIL)
I (1530) am2320: Temperature: 30.5°C, Humidity: 51.8%
E (2030) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
E (2030) am2320: Error reading data: -1 (ESP_FAIL)
I (2530) am2320: Temperature: 30.5°C, Humidity: 51.8%
E (3030) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
E (3030) am2320: Error reading data: -1 (ESP_FAIL)
I (3530) am2320: Temperature: 30.5°C, Humidity: 51.9%
E (4030) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
E (4030) am2320: Error reading data: -1 (ESP_FAIL)
I (4530) am2320: Temperature: 30.5°C, Humidity: 51.9%
E (5030) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
E (5030) am2320: Error reading data: -1 (ESP_FAIL)
I (5530) am2320: Temperature: 30.5°C, Humidity: 51.9%
E (6030) i2cdev: Could not write to device [0x5c at 0]: -1 (ESP_FAIL)
E (6030) am2320: Error reading data: -1 (ESP_FAIL)
Edit: I'm using the example code
I have been testing since last comment, and besides those errors, the implementation seems to be working pretty well
@trombik Sakurai-san, may I ask you to look into the problem with the driver? At the moment I, unfortunately, do not have the opportunity to program.
@UncleRus will have a look
the datasheet is the one of the worst i have ever read.
@aschiavon91 please test the new example. there should be no warnings or errors.
@trombik seems to be working pretty well now, I left it running for 10/15 minutes and no errors occurred
I (0) cpu_start: App cpu up.
I (222) cpu_start: Pro cpu start user code
I (222) cpu_start: cpu freq: 160000000 Hz
I (223) cpu_start: Application information:
I (227) cpu_start: Project name: estufa
I (232) cpu_start: App version: 1
I (237) cpu_start: Compile time: May 15 2023 22:02:05
I (243) cpu_start: ELF file SHA256: b183979af96ad6aa...
I (249) cpu_start: ESP-IDF: v5.2-dev-544-g54576b7528
I (255) cpu_start: Min chip rev: v0.0
I (260) cpu_start: Max chip rev: v3.99
I (265) cpu_start: Chip rev: v1.0
I (269) heap_init: Initializing. RAM available for dynamic allocation:
I (277) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (283) heap_init: At 3FFB2A30 len 0002D5D0 (181 KiB): DRAM
I (289) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (295) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (302) heap_init: At 4008D3E8 len 00012C18 (75 KiB): IRAM
I (309) spi_flash: detected chip: generic
I (312) spi_flash: flash io: dio
W (316) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (330) app_start: Starting scheduler on CPU0
I (335) app_start: Starting scheduler on CPU1
I (335) main_task: Started on CPU0
I (345) main_task: Calling app_main()
I (345) main_task: Returned from app_main()
I (355) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (855) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (1355) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (1855) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (2355) am2320-example: Temperature: 26.3°C, Humidity: 46.0%
I (2855) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (3355) am2320-example: Temperature: 26.3°C, Humidity: 46.0%
I (3855) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (4355) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (4855) am2320-example: Temperature: 26.3°C, Humidity: 46.0%
I (5365) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (5865) am2320-example: Temperature: 26.4°C, Humidity: 46.0%
I (6365) am2320-example: Temperature: 26.4°C, Humidity: 45.9%
I (6865) am2320-example: Temperature: 26.4°C, Humidity: 45.9%
I (7365) am2320-example: Temperature: 26.4°C, Humidity: 45.9%
I (7865) am2320-example: Temperature: 26.3°C, Humidity: 45.9%
I (8365) am2320-example: Temperature: 26.4°C, Humidity: 45.9%
I (8865) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (9365) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (9865) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (10365) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (10865) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (11365) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (11865) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (12365) am2320-example: Temperature: 26.4°C, Humidity: 45.8%
I (12865) am2320-example: Temperature: 26.4°C, Humidity: 45.7%
I (13365) am2320-example: Temperature: 26.4°C, Humidity: 45.7%
I (13865) am2320-example: Temperature: 26.4°C, Humidity: 45.7%
I (14365) am2320-example: Temperature: 26.4°C, Humidity: 45.7%
I (14865) am2320-example: Temperature: 26.4°C, Humidity: 45.7%
I (15365) am2320-example: Temperature: 26.4°C, Humidity: 45.7%
I (15865) am2320-example: Temperature: 26.4°C, Humidity: 45.7%
I (16365) am2320-example: Temperature: 26.4°C, Humidity: 45.6%
I (16865) am2320-example: Temperature: 26.4°C, Humidity: 45.6%
I (17365) am2320-example: Temperature: 26.4°C, Humidity: 45.6%
thank you so much, @UncleRus and @trombik!
Fixes #454
@aschiavon91, @sirapol, @pfuentes69 Please test