CanBus Meanwell NPB1700 ESP32 MCP2515

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

Screenshot 2023-08-17 112127
Screenshot 2023-08-17 101023
Screenshot 2023-08-17 100944

Hallo Udo,

ist schon einige zeit her, aber hast du das problem lösen können?

lg

Hallo,

das Problem ist mittlerweile gelöst.
Nach langem hin und her funktioniert es nun.

Gruß Udo

would you be able to elaborate ? I’m about to pull the trigger on this charger, so knowing any issues in advance would be great.

1 Like

Hi @Grisu74,
ich versuche aktuell ebenfalls ein NPB von Meanwell per CAN und esphome anzusteuern, leider funktioniert es bisher noch nicht. Wie hast Du es zum laufen bekommen? Kannst Du deine YAML vielleicht hier zur Verfügung stellen?
Gruß

In einem anderen Forum hat @Grisu74 beschrieben, wie er das Problem gelöst hat: Can Bus interface reagiert nicht. Was mache ich falsch? - Mikrocontroller.net und Can Bus interface reagiert nicht. Was mache ich falsch? - Mikrocontroller.net