How to only activate CAN bus when needed!

Hi All,
I am working on ESPHOME and have the need of bringing in CAN bus for the project. As ESP32 will reset if no Can device exists on the network. I would like to ask your advice on how to only activate Can controller on ESP32 when other can node is online to avoid this reset of the module.
Thank you very much for your advice!