someweisguy / esp_dmx

Espressif ESP32 implementation of ANSI-ESTA E1.11 DMX-512A and E1.20 RDM
MIT License
350 stars 37 forks source link

rdm_sensor_definition_add fails in sensor example #173

Open ebeam-bob opened 1 month ago

ebeam-bob commented 1 month ago

Love what you've done with v4.1.0, and there's so much there now that I'm still digesting it all! I built the Arduino_RDMSensor example, and from Device Info on my Botex RDM tool I see that there is one sensor (the Sub-Dev count is 0) but it does not give me the option to read the sensor. Then I put the call to rdm_sensor_definition_add into an if statement with a println, and sure enough that call is returning false. Is something awry in the example, or in that function?

ebeam-bob commented 1 month ago

The error is coming from the test "sensor_defs[definition->num].num != 0xff", but if I comment that out, the ESP32 keeps resetting with these messages: Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception). Debug exception reason: Stack canary watchpoint triggered (loopTask)

ebeam-bob commented 3 weeks ago

In rdm_register_sensor_definition, the first_time_func_called flag is false the first time this is called and so the loop that sets the sensor definition number to unused (sensor_defs[i].num = 0xff;) did not run.

ebeam-bob commented 2 weeks ago

In rdm_rhd_get_sensor_definition, the second argument to rdm_read_pd should be definition->get.request.format, not set.request.format, which is NULL.