screekworkshop / screek-human-sensor

137 stars 29 forks source link

human-sensor-2a-stable-github.yaml can't compile with esp-idf #13

Open MStapelfeldt opened 8 months ago

MStapelfeldt commented 8 months ago

I wanted to add microWakeWord to a device which runs on human-sensor-2a firmware and noticed there are several compile errors:


/config/esphome/human-sensor-2a-stable-github.yaml: In lambda function:
/config/esphome/human-sensor-2a-stable-github.yaml:531:32: error: left operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone1_x_begin).state == 0, id(zone1_x_end).state == 0, id(zone1_y_begin).state == 0, id(zone1_y_end).state == 0){
           ~~~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml:531:57: error: right operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone1_x_begin).state == 0, id(zone1_x_end).state == 0, id(zone1_y_begin).state == 0, id(zone1_y_end).state == 0){
                                      ~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml:531:84: error: right operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone1_x_begin).state == 0, id(zone1_x_end).state == 0, id(zone1_y_begin).state == 0, id(zone1_y_end).state == 0){
                                                               ~~~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml: In lambda function:
/config/esphome/human-sensor-2a-stable-github.yaml:553:32: error: left operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone2_x_begin).state == 0, id(zone2_x_end).state == 0, id(zone2_y_begin).state == 0, id(zone2_y_end).state == 0){
           ~~~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml:553:57: error: right operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone2_x_begin).state == 0, id(zone2_x_end).state == 0, id(zone2_y_begin).state == 0, id(zone2_y_end).state == 0){
                                      ~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml:553:84: error: right operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone2_x_begin).state == 0, id(zone2_x_end).state == 0, id(zone2_y_begin).state == 0, id(zone2_y_end).state == 0){
                                                               ~~~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml: In lambda function:
/config/esphome/human-sensor-2a-stable-github.yaml:575:32: error: left operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone3_x_begin).state == 0, id(zone3_x_end).state == 0, id(zone3_y_begin).state == 0, id(zone3_y_end).state == 0){
           ~~~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml:575:57: error: right operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone3_x_begin).state == 0, id(zone3_x_end).state == 0, id(zone3_y_begin).state == 0, id(zone3_y_end).state == 0){
                                      ~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml:575:84: error: right operand of comma operator has no effect [-Werror=unused-value]
           if (id(zone3_x_begin).state == 0, id(zone3_x_end).state == 0, id(zone3_y_begin).state == 0, id(zone3_y_end).state == 0){
                                                               ~~~~~~~~~~~~~~~~~~~~~^~~~
/config/esphome/human-sensor-2a-stable-github.yaml: In lambda function:
/config/esphome/human-sensor-2a-stable-github.yaml:614:14: error: 'temperatureRead' was not declared in this scope
     unit_of_measurement: °C
              ^~~~~~~~~~~~~~~
Compiling .pioenvs/screek-human-sensor-2a/cbor/tinycbor/src/cborencoder_close_container_checked.o
/config/esphome/human-sensor-2a-stable-github.yaml: In lambda function:
/config/esphome/human-sensor-2a-stable-github.yaml:19:28: error: 'ESP' was not declared in this scope
           id(cpu_speed) = ESP.getCpuFreqMHz();
                            ^~~

some stuff like ESP.getCpuFreqMHz() or temperatureRead() could just be commented out, but the main lambda function and validation of zones is an issue. You can reproduce the issue by changing to

esp32:
  board: lolin_c3_mini
  framework:
    type: esp-idf
    version: recommended
screekworkshop commented 8 months ago

Hi, we'll investigate support for the esp-idf framework, which may be a bit more time consuming since we rarely use this framework. Our bp1 is using the esp-idf framework and it has good bluetooth-wifi concurrency. But in general we will prioritize the arduino framework, which has better compatibility.

nliviu commented 6 months ago

Replace the comma with the and operand && and it will compile with both arduino and esp-idf frameworks.

It looks like it has been fixed in the beta, but didn't make it in the stable. https://github.com/screekworkshop/screek-human-sensor/blob/9b8f9fea2788704a40f5e256787b98f10b09d615/2a/yaml/beta/human-sensor-2a-beta-github.yaml#L581

MStapelfeldt commented 6 months ago

Fixing it locally for me is easy, I know. But next one will face same issues so I hope it will be merged into stable soon.

screekworkshop commented 6 months ago

We will update this issue immediately in the next 24 hours! Thanks for the feedback.

SLboat commented 6 months ago

Fixing it locally for me is easy, I know. But next one will face same issues so I hope it will be merged into stable soon.

We Sync the beta's current content to stable, considering they've been running for over 7 months. and now it should fix the proble now.

https://github.com/screekworkshop/screek-human-sensor/commit/bad4dca45cc533831b33b24eecd22ec0411dd449