-
Notifications
You must be signed in to change notification settings - Fork 3
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
CPM not counted on (certain) ESP32 Model (D1 Mini, ESP32-WROOM-32) #5
Comments
Thank you for sharing your experience with GGreg20_V3.
Thank you very much for your help! Regards, |
Merry Christmas! |
Hi Oleksii,
I also tried connecting ESP32 +3.3V instead of VIN+5V to GGreg20_V3 BAT + which didn‘t change the behaviour. Only by changing the values above i could bring the ESP to count CPMs. |
Hello Kedalux,
We look forward to hearing what you find. Best regards, |
Hi Oleksii, luckily i‘ve had an multi-meter with me so i could get those measurements. All the measurements you wanted, i took, but they all ended in an „Open Line“, even when putting it to 2M-Ohms measuring range. I couldn‘t measure any resistance. I also need to underline, that i‘ve tested this with GPIO23 as well as GPIO15 and the results i described initially stayed the same. Sorry i can‘t be of more help. I will order another, basic version of the ESP32 and test it out again. |
Today I spent most of the day experimenting with the usual ESP32-Wroom module in the NodeMCU format.
esp32:
board: esp32dev
framework:
type: arduino esp32:
board: esp32dev
framework:
type: esp-idf
# use_pcnt: False
# internal_filter: 190us # for SBM20 tube, for J305 tube use 180us
...
- platform: pulse_counter
pin:
#: 23
inverted: True
mode:
True input: True
# No pullup or pulldown on ESP32 side because of internal pullup set in hardware at GGreg20_V3 pulse output side
pullup: False
pulldown: False
unit_of_measurement: 'CPM'
name: 'Ionizing Radiation Power CPM'
count_mode:
'rising_edge': DISABLE
falling_edge: INCREMENT # GGreg20_V3 uses Active-Low logic
update_interval: 60s
accuracy_decimals: 0
id: my_cpm_meter
...
https://github.com/esphome/issues/issues
Compiling .pioenvs/esp32-ggreg20-v3/src/esphome/components/pulse_counter/pulse_counter_sensor.cpp.o
In file included from src/esphome/components/pulse_counter/pulse_counter_sensor.h:10,
from src/esphome/components/pulse_counter/pulse_counter_sensor.cpp:1:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/pcnt.h:15:2: warning: #warning “legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h” [-Wcpp]
15 | #warning “legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h”
| ^~~~~~~
src/esphome/components/pulse_counter/pulse_counter_sensor.cpp: In static member function 'static void esphome::pulse_counter::BasicPulseCounterStorage::gpio_intr(esphome::pulse_counter::BasicPulseCounterStorage*)':
src/esphome/components/pulse_counter/pulse_counter_sensor.cpp:32:12: warning: '++' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
32 | arg->counter++;
| ~~~~~^~~~~~~
src/esphome/components/pulse_counter/pulse_counter_sensor.cpp:35:12: warning: '--' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
35 | arg->counter--;
| ~~~~~^~~~~~~ This may also indicate that something has happened to the
# use_pcnt: False
# internal_filter: 190us # for SBM20 tube, for J305 tube use 180us I hope this information will help. |
Note: I already fixed the issue myself, but this is for users experiencing the same issue and for the staff to understand why this happens (Because i don't)
Also i've closed my duplicated issue in the wrong repo (ggreg20-v3-homeassistant-esphome-example) since it fits better here.
So i've bought two GGreg_V3 Sensors to monitor background radiation.
I use the following ESP32 Model: https://wiki.csgalileo.org/_media/projects/internetofthings/d1_mini_esp32_-_pinout.pdf
The Chip itself is labelled ESP32-WROOM-32.
I flashed the Chip using the Home-Assistant Add-On ESPHome and the Configuration from here.
Everything went smoothly until i discovered that CPM is only "counted" immediatly when the GGreg board is being connected/being turned on. I guess this has something to do with the issue.
pulse_counter always shows 0 otherwise, so radiation over time is calculated wrong too.
I could verify this because the board is beeping around 22 times a minute and always reports 0, unless connected/disconnected while the ESP is on.
If the "OUT" Pin is connected to the wrong GPIO CPM tends to be in the thousands. I discovered this playing around with my ESP.
The only thing needed to fix this is changing the yaml configuration:
The following values of the two lines need to be swapped:
Before failing_edge was INCREMENT and rising_edge DISABLE.
With this configuration the CPM counting works as expected, i verified this by counting the beeps and comparing it to the transmissioned stats.
I don't know why this happens, i don't know if it's the specific model, that treats GPIO Pins differently (Your Example is for Generic ESP32).
I did specify the correct model in ESPHome to be sure the Pinout is correct. I also checked for hardware defects with multiple ESPs from the same model and the second GGreg_V3 Board i ordered.
I also double-checked with different GPIO Pins, but the behaviour is always the same.
Maybe someone could look into it and change the readme with a note.
Merry Christmas Guys!
The text was updated successfully, but these errors were encountered: