Hello,
I hope I can get help here.
I have an ESP32 with MCP2515.
A can bus is supposed to run over it.
The receiver is a Meanwell NBPB-1700 charger.
Unfortunately, I get no response from the charger.
Here’s my code.
esphome:
name: canempfaengertest
friendly_name: CANEmpfaengerTest
esp32:
board: nodemcu-32s
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Canempfaengertest"
password: ""
captive_portal:
spi:
id: McpSpi
clk_pin: GPIO18
mosi_pin: GPIO21
miso_pin: GPIO22
time:
- platform: sntp
on_time:
- seconds: /5
then:
- canbus.send:
# Extended ID explicit
use_extended_id: true
can_id: 0x000C0000
data: [0x00, 0x80,0x00,0x00,0x00,0x00,0x00,0x00 ]
canbus_id: my_mcp2515
remote_transmission_request: True
#remote_transmission_request: true
canbus:
- platform: mcp2515
id: my_mcp2515
spi_id: McpSpi
cs_pin: GPIO5
use_extended_id: true
can_id: 0x000C0000 #Controller
bit_rate: 250KBPS
on_frame:
- can_id: 0x000C0100 #vom Charger
use_extended_id: true
then:
- lambda: |-
std::string b(x.begin(), x.end());
ESP_LOGD("can id 1", "%s", &b[0] );
Thanks Udo