Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B101006 protocol description #1

Open
mwdmwd opened this issue Feb 26, 2022 · 4 comments
Open

B101006 protocol description #1

mwdmwd opened this issue Feb 26, 2022 · 4 comments

Comments

@mwdmwd
Copy link

mwdmwd commented Feb 26, 2022

Hi, this Kaitai Struct description might be of some use. It is for a different protocol version, though (B101006). It's good for an old T-series inverter (don't know about the new 2022 ones). Yours likely has more fields because the messages are longer (and there's also one more packet type, "3").

meta:
  id: foxess_rs485
  endian: be
  encoding: ASCII

seq:
  - id: packets
    type: packet
    repeat: eos

types:
  unknown: {}
  device_info:
    seq:
      - id: master_version
        type: str
        size: 6
      - id: slave_version
        type: str
        size: 6
      - id: manager_version
        type: str
        size: 6
      - id: factory
        type: u2
      - id: type
        type: str
        size: 2
      - id: model
        type: str
        size: 16
      - id: capacity
        type: u2
  pv_string:
    seq:
      - id: voltage
        type: u2
      - id: current
        type: u2
      - id: power
        type: u2
  grid_phase:
    seq:
      - id: voltage
        type: u2
      - id: current
        type: s2
      - id: frequency
        type: u2
      - id: power
        type: s2
  power_info:
    seq:
      - id: grid_power
        type: s2
      - id: generation_power
        type: s2
      - id: load_power
        type: s2
      - id: grid_phases
        type: grid_phase
        repeat: expr
        repeat-expr: 3
      - id: pv_strings
        type: pv_string
        repeat: expr
        repeat-expr: 4
      - id: boost_temperature
        type: s2
      - id: inverter_temperature
        type: s2
      - id: ambient_temperature
        type: s2
      - id: generation_today
        type: u2
      - id: generation_total
        type: u4
      - id: generation_from_grid
        type: u4
      - id: generation_feed_in_1
        type: u4
      - id: generation_feed_in_2
        type: u4
      - id: generation_consumption_1
        type: u4
      - id: generation_consumption_2
        type: u4
      - id: generation_loads
        type: u4
      - id: eps_r_voltage
        type: s2
      - id: eps_r_current
        type: s2
      - id: eps_r_power
        type: s2
      - id: rev_1_4
        type: s2
        repeat: expr
        repeat-expr: 4
      - id: rev_5_10
        type: u2
        repeat: expr
        repeat-expr: 6
      - id: fault_bits
        type: u4
        repeat: expr
        repeat-expr: 8
      - id: master_state
        type: u2
  heartbeat:
    seq:
      - id: protocol_version
        type: strz
        size: 6
      - id: serial_number
        type: strz
        size: 15
  packet:
    seq:
      - id: header
        contents: [0x7e, 0x7e]
      - id: type
        type: u1
      - id: timestamp
        type: u4
      - id: data_length
        type: u2
      - id: data
        type:
          switch-on: type
          cases:
            1: device_info
            2: power_info
            6: heartbeat
            _: unknown
        size: data_length
      - id: checksum
        type: u2
      - id: trailer
        contents: [0xe7, 0xe7]

The voltage and current values are in units of 0.1 V and 0.1 A respectively and the frequencies - 0.01 Hz. The generated energy is in units of 0.1 kWh. All powers are in watts and temperatures in °C.

The checksum is CRC-16 as used in Modbus (normal polynomial 0x8005) over the complete message except the fields called header, checksum, and trailer in the above Kaitai description.

You actually don't need the wifi module at all - at least the ones that came with the old T-series are essentially dumb RS485 to TCP converters. You just need to connect your own RS485 adapter to the wifi port and interpret the messages as above, there is no need to transmit anything, the inverter sends one message every 30 seconds. Also (this might depend on firmware version) if you set MeterConfig to Comm in the inverter settings the same data will be sent out of the second RS485 port which comes with a convenient plug. It's 9600bps, 8N1.

@spmaid
Copy link

spmaid commented Feb 26, 2022

wow, this could be very good, I'll have a play tonight!

@nigelspowage
Copy link
Owner

Hi, this Kaitai Struct description might be of some use. It is for a different protocol version, though (B101006). It's good for an old T-series inverter (don't know about the new 2022 ones). Yours likely has more fields because the messages are longer (and there's also one more packet type, "3").

meta:
  id: foxess_rs485
  endian: be
  encoding: ASCII

seq:
  - id: packets
    type: packet
    repeat: eos

types:
  unknown: {}
  device_info:
    seq:
      - id: master_version
        type: str
        size: 6
      - id: slave_version
        type: str
        size: 6
      - id: manager_version
        type: str
        size: 6
      - id: factory
        type: u2
      - id: type
        type: str
        size: 2
      - id: model
        type: str
        size: 16
      - id: capacity
        type: u2
  pv_string:
    seq:
      - id: voltage
        type: u2
      - id: current
        type: u2
      - id: power
        type: u2
  grid_phase:
    seq:
      - id: voltage
        type: u2
      - id: current
        type: s2
      - id: frequency
        type: u2
      - id: power
        type: s2
  power_info:
    seq:
      - id: grid_power
        type: s2
      - id: generation_power
        type: s2
      - id: load_power
        type: s2
      - id: grid_phases
        type: grid_phase
        repeat: expr
        repeat-expr: 3
      - id: pv_strings
        type: pv_string
        repeat: expr
        repeat-expr: 4
      - id: boost_temperature
        type: s2
      - id: inverter_temperature
        type: s2
      - id: ambient_temperature
        type: s2
      - id: generation_today
        type: u2
      - id: generation_total
        type: u4
      - id: generation_from_grid
        type: u4
      - id: generation_feed_in_1
        type: u4
      - id: generation_feed_in_2
        type: u4
      - id: generation_consumption_1
        type: u4
      - id: generation_consumption_2
        type: u4
      - id: generation_loads
        type: u4
      - id: eps_r_voltage
        type: s2
      - id: eps_r_current
        type: s2
      - id: eps_r_power
        type: s2
      - id: rev_1_4
        type: s2
        repeat: expr
        repeat-expr: 4
      - id: rev_5_10
        type: u2
        repeat: expr
        repeat-expr: 6
      - id: fault_bits
        type: u4
        repeat: expr
        repeat-expr: 8
      - id: master_state
        type: u2
  heartbeat:
    seq:
      - id: protocol_version
        type: strz
        size: 6
      - id: serial_number
        type: strz
        size: 15
  packet:
    seq:
      - id: header
        contents: [0x7e, 0x7e]
      - id: type
        type: u1
      - id: timestamp
        type: u4
      - id: data_length
        type: u2
      - id: data
        type:
          switch-on: type
          cases:
            1: device_info
            2: power_info
            6: heartbeat
            _: unknown
        size: data_length
      - id: checksum
        type: u2
      - id: trailer
        contents: [0xe7, 0xe7]

The voltage and current values are in units of 0.1 V and 0.1 A respectively and the frequencies - 0.01 Hz. The generated energy is in units of 0.1 kWh. All powers are in watts and temperatures in °C.

The checksum is CRC-16 as used in Modbus (normal polynomial 0x8005) over the complete message except the fields called header, checksum, and trailer in the above Kaitai description.

You actually don't need the wifi module at all - at least the ones that came with the old T-series are essentially dumb RS485 to TCP converters. You just need to connect your own RS485 adapter to the wifi port and interpret the messages as above, there is no need to transmit anything, the inverter sends one message every 30 seconds. Also (this might depend on firmware version) if you set MeterConfig to Comm in the inverter settings the same data will be sent out of the second RS485 port which comes with a convenient plug. It's 9600bps, 8N1.

Thanks for this information, this is going to be invaluable in helping me understand the fields being communicated.

@straga
Copy link

straga commented Apr 23, 2022

Hello. How to progress.
Next week I probably got S3000. That real do own Monitoring. I want to use Grafana and Home Assistant.
I already have solax - for solax I do Meter Convertor for any meter. Foxess how I understand can for with standard chint meter.

@straga
Copy link

straga commented Apr 25, 2022

Hello
I am found.
On Gird solar inverter Modbus Protocol.pdf

Also:
macxq/foxess-ha#49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants