diy solar

diy solar

JK BMS CAN bus comms now possible for inverters that support Goodwe and Pylontech batteries

How did you make the connection to JK-BMS?

Are you connected to the GPS port directly or via an RS485 JK module?

Do you have another BMS or ESP32 trying to isolate the problem?
Yes I have 2 ESP (exactly the same modules...

One has the Bluetooth code
the other the Wire Code
 
Your ESP32 cannot find the IP address of your broker hostname. You probably don't have an internal DNS server.

How did you complete this part?

YAML:
 mqtt:
  broker: !secret mqtt_host
  username: !secret mqtt_username
  password: !secret mqtt_password
  id: mqtt_client
This is my mqtt configuration:

logins: []
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
active: false
folder: mosquitto

Only DNS i have running is duck DNS and below is the config settings:

domains:
- homeassistctechn2.duckdns.org, homeassistcreative2.duckdns.org
token: 0bc1e248-88b8-4992-ae40-f7a16bf04858
aliases: []
lets_encrypt:
accept_terms: true
algo: secp384r1
certfile: fullchain.pem
keyfile: privkey.pem
seconds: 300
and then finally ...here is my Batmon settings

devices:
- address: C8:47:80:08:20:D0
type: sok
alias: battery1
concurrent_sampling: false
keep_alive: true
verbose_log: false
sample_period: 1
publish_period: 2
invert_current: true
watchdog: true
expire_values_after: 20
install_newer_bleak: false
bt_power_cycle: false


regards
 
there is relation as the mqtt config is inside the jk-bms-can-wire yaml script
You are correct - if i comment api our it will not use esp so no relation
but we still have the config in the script we just want to know how it integrates using mqtt with batmon

or do you only support EspHome?
 
By the way i got the Wire working:
the only main difference for other who might get similar issue is
1. the api had encription not sure if this is related
2. i changed the GPIO to 1 and 3 for the tx / rx from the bms respectively
Spoke too soon - Can o.k but interface still says unknown for sensors , i will try flash a different unit now
 
By the way i got the Wire working:
the only main difference for other who might get similar issue is
1. the api had encription not sure if this is related
2. i changed the GPIO to 1 and 3 for the tx / rx from the bms respectively

Strange, in general we don't use these GPIOs because they are connected to uart0 for logging.

Do you use other UART connections on this board?

You should know that the ESP32 has 3 UARTs including 1 which is already used for logging, to use this 3rd UART it is necessary to release it.

So maybe, in your case this config will also work using GPIO 16 and 17 :

YAML:
# +--------------------------------------+
# | ESP32 CAN/serial port pins           |
# +--------------------------------------+
  # GPIO pins your CAN bus transceiver (TJA1050, TJA1051T or SN65HVD230) is connected to the ESP32 TX->TX and RX->RX !
  can_tx_pin: GPIO23
  can_rx_pin: GPIO22
  # GPIO pins your JK-BMS UART-TTL is connected to the ESP32 TX->RX and RX->TX !
  tx_pin: GPIO17
  rx_pin: GPIO16



logger:
  baud_rate: 0 # release 3rd UART used for logging
 
You are correct - if i comment api our it will not use esp so no relation
but we still have the config in the script we just want to know how it integrates using mqtt with batmon

or do you only support EspHome?

You have to choose between api: and mqtt:

If you use HA you should favor api:

If you don't use HA you can use mqtt:

In this case we could for example retrieve the information in Node-RED via the MQTT connection.

The JK-BMS-CAN MQTT server is the data source, other systems must subscribe to it.

HA connection

YAML:
api:

Connection with other systems

YAML:
mqtt:
  broker: !secret mqtt_host
  username: !secret mqtt_username
  password: !secret mqtt_password
  id: mqtt_client
 
JK-BMS-CAN and Batmon are two different data sources.

I don't really understand what you want to do but I can tell you that it is not possible to connect JK-BMS-CAN with Batmon.

JK-BMS-CAN can monitor your battery (like Batmon) in addition to communicating with your inverter via CAN bus.

Why do you want to use Batmon?
 
and then for Solis 3kw hybrid inverters
battery is always either stuck on 100 % or 0 %
it never tells the true value of Pylon tech settings
1708371450192.png

1708371484599.png

so one can neevr tell SOC unless we go into the jkbms software..



i know its a lot and i am a little annoying with all these .... i am a tester for your project on this aspect :) , thats what we mearnt to do ...annoy developers


regards
 
Last edited:
JK-BMS-CAN and Batmon are two different data sources.

I don't really understand what you want to do but I can tell you that it is not possible to connect JK-BMS-CAN with Batmon.

JK-BMS-CAN can monitor your battery (like Batmon) in addition to communicating with your inverter via CAN bus.

Why do you want to use Batmon?
o.k i must be confusing things now, i was with the impression that if we don't use the native api to connect to esphome we have an alternative to use mqtt to connect and display the data that the esphome would have been displaying on the Batmon....

ignore this then.
 
So i have tried the suggested GPIO still coming up with unknown
View attachment 196729

View attachment 196730

Any Ideas??
Oh My Goodness - for this issue
i feel like an ass

i have not been changing the MAC address and i am sure this is the issue , i have never used the MAc for the wire

i am going to try it now and report back

my sincere apologies

# Edit

Double Ass - i take that back

it's the jkbms we changing the MAC , so its correct
 
Yup definitely something wrong with the wire code

Swapped the code around like you advised and immediately the BLE works and the Wire show unknown

During testing BLE:
1708373466992.png


During testing Wire:
1708373510758.png

Proves both ESP32 are functional too....
 
Last edited:
and then for Solis 3kw hybrid inverters
battery is always either stuck on 100 % or 0 %
it never tells the true value of Pylon tech settings
View attachment 196793

View attachment 196794

so one can neevr tell SOC unless we go into the jkbms software..



i know its a lot and i am a little annoying with all these .... i am a tester for your project on this aspect :) , thats what we mearnt to do ...annoy developers


regards
Just to add to this topic
the settings page reflects 0%
1708373790500.png

But true value reported by BMS:

1708373962576.png


Solis Inverter:
1708374022597.png

So it makes sense that the Solis is reporting the same value as the ESP32 as this is what it tells the inverter.......which means the ESP32 is not reading the data from the JKBMS correctly - this is BLE by the way.
 
Just to add to this topic
the settings page reflects 0%
View attachment 196808

But true value reported by BMS:

View attachment 196809


Solis Inverter:
View attachment 196810

So it makes sense that the Solis is reporting the same value as the ESP32 as this is what it tells the inverter.......which means the ESP32 is not reading the data from the JKBMS correctly - this is BLE by the way.

Are you sure you are properly connected via Bluetooth? I also see strange information like the voltage of your cells at 3.9v?

These are not LFP cells?
 

diy solar

diy solar
Back
Top