How do I listen to all can_id
's? From the documentation I gather that setting can_id_mask
to 0 should accomplish that, but in this case I get no messages at all.
Listening to specific can_id’s works as expected.
How do I listen to all can_id
's? From the documentation I gather that setting can_id_mask
to 0 should accomplish that, but in this case I get no messages at all.
Listening to specific can_id’s works as expected.
I too am trying to receive all can_id’s
Did you find a solution?
I’m wondering if it can be done in lambda, similar to sending via lambda
This works for me:
canbus:
- platform: esp32_can
tx_pin: GPIO25
rx_pin: GPIO26
can_id: 100 # can id for transmitting frames
bit_rate: 250kbps # rv-c
on_frame:
- can_id: 0 # listen to all messages
can_id_mask: 0
use_extended_id: true
then:
- lambda: |-
char buf[29];
// DGN
// Source Address (SA)
// Priority
// Data (8 bytes)
int dgn = (can_id >>8) & 0x1ffff;
int pri = (can_id >> 26) & 0b111;
int sa = can_id & 0xff;
snprintf((char*)&buf, sizeof(buf), "%05X,%02X,%1X,%02X%02X%02X%02X%02X%02X%02X%02X", dgn, sa, pri, x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]);
id(rvc_rx).publish_state((const char*)&buf);
ESP_LOGI("can", "%s", (const char*)&buf);
it won’t work in 2024
Why won’t it work? no longer supported?
I’m interested in knowing how to do this as well, if using 0 isn’t the correct way anymore.
Hi all, any chance to listen to extended and standard at once? Battery mgmt system is sending both types of frames and example from here works only with STD or EXT - not together. Basically talking about these ranges - painful to manually create on_frame/can_id sections for all of them:
STD: 0x1B0 → 0x1DE (432 - 478 = 46 entries)
EXT: 0x1A555400 → 0x1A555440, 0x16A95470 → 0x16A95480
If not possible to listen to both types, I’d stick with all STD and its 46 frames and manually add EXT for 10+8 frames
received can message extended can_id=0x1a555420 size=8
received can message extended can_id=0x1a555421 size=8
received can message extended can_id=0x1a555422 size=8
received can message extended can_id=0x1a555423 size=8
received can message extended can_id=0x1a555424 size=8
received can message extended can_id=0x1a555425 size=8
received can message extended can_id=0x1a555426 size=8
received can message extended can_id=0x1a555427 size=8
received can message extended can_id=0x1a555428 size=8
received can message extended can_id=0x1a555429 size=8
received can message extended can_id=0x1a555460 size=8
received can message extended can_id=0x1a555461 size=8
received can message extended can_id=0x1a555462 size=8
received can message extended can_id=0x1a555463 size=8
received can message extended can_id=0x1a555464 size=8
received can message extended can_id=0x1a555465 size=8
received can message extended can_id=0x1a555466 size=8
received can message extended can_id=0x1a555467 size=8