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

[Bug] Bridge restarting, SHM, SBS, STP 15000TL not available #21

Open
funx1 opened this issue Feb 12, 2024 · 5 comments
Open

[Bug] Bridge restarting, SHM, SBS, STP 15000TL not available #21

funx1 opened this issue Feb 12, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@funx1
Copy link

funx1 commented Feb 12, 2024

Paste of Logs:

[12/02/2024, 11:01:10] [homebridge-sma-home-manager] Restarting Process...
[12/02/2024, 11:01:12] [homebridge-sma-home-manager] Launched child bridge with PID 20923
[12/02/2024, 11:01:13] Registering platform 'homebridge-sma-home-manager.SMAHomeManager'
[12/02/2024, 11:01:13] [homebridge-sma-home-manager] Loaded homebridge-sma-home-manager v1.1.8 child bridge successfully
[12/02/2024, 11:01:13] Loaded 0 cached accessories from cachedAccessories.0E925CDAD228.
[12/02/2024, 11:01:13] [homebridge-sma-home-manager] Found inverter SMA30120xxxx at SMA3012xxx.local with IPv4 address 192.168.179.182.
[12/02/2024, 11:01:14] [homebridge-sma-home-manager] Discovered SMA inverter: no
[12/02/2024, 11:01:14] [homebridge-sma-home-manager] Discovered SMA energy manager: { Model: 372, SerialNumber: 30118xxxx, FirmwareRevision: '2.13.6.R' }
/var/lib/homebridge/node_modules/homebridge-sma-home-manager/index.js:402
                                const deviceClassId = data.buffer.slice(0, 4).readUInt32BE();
                               ^
TypeError: Cannot read properties of undefined (reading 'buffer')
    at SMAHomeManager.<anonymous> (/var/lib/homebridge/node_modules/homebridge-sma-home-manager/index.js:402:32)
    at TcpPort.<anonymous> (/var/lib/homebridge/node_modules/homebridge-sma-home-manager/node_modules/modbus-serial/index.js:340:37)
    at TcpPort.emit (node:events:517:28)
    at Socket.<anonymous> (/var/lib/homebridge/node_modules/homebridge-sma-home-manager/node_modules/modbus-serial/ports/tcpport.js:77:20)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at Socket.Readable.push (node:internal/streams/readable:278:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
[12/02/2024, 11:01:14] [homebridge-sma-home-manager] Child bridge process ended
[12/02/2024, 11:01:14] [homebridge-sma-home-manager] Process Ended. Code: 1, Signal: null
[12/02/2024, 11:01:18] [homebridge-sma-home-manager] Restarting child bridge...
[12/02/2024, 11:01:21] [homebridge-sma-home-manager] Restarting Process...
[12/02/2024, 11:01:23] [homebridge-sma-home-manager] Launched child bridge with PID 20937
[12/02/2024, 11:01:23] Registering platform 'homebridge-sma-home-manager.SMAHomeManager'
[12/02/2024, 11:01:24] [homebridge-sma-home-manager] Loaded homebridge-sma-home-manager v1.1.8 child bridge successfully
[12/02/2024, 11:01:24] Loaded 0 cached accessories from cachedAccessories.0E925CDAD228.
[12/02/2024, 11:01:24] [homebridge-sma-home-manager] Found inverter SMA30120xxxxx at SMA30120xxxxx.local with IPv4 address 192.168.179.182.
[12/02/2024, 11:01:25] [homebridge-sma-home-manager] Discovered SMA inverter: no
[12/02/2024, 11:01:25] [homebridge-sma-home-manager] Discovered SMA energy manager: { Model: 372, SerialNumber: 301184xxxx, FirmwareRevision: '2.13.6.R' }
[12/02/2024, 11:01:25] [homebridge-sma-home-manager] Child bridge process ended
[12/02/2024, 11:01:25] [homebridge-sma-home-manager] Process Ended. Code: 1, Signal: null
[12/02/2024, 11:01:32] [homebridge-sma-home-manager] Restarting Process...
[12/02/2024, 11:01:34] [homebridge-sma-home-manager] Launched child bridge with PID 20951
[12/02/2024, 11:01:34] [homebridge-sma-home-manager] Loaded homebridge-sma-home-manager v1.1.8 child bridge successfully
[12/02/2024, 11:01:35] [homebridge-sma-home-manager] Found inverter SMA30120xxxxx at SMA3012001984.local with IPv4 address 192.168.179.182.
[12/02/2024, 11:01:36] [homebridge-sma-home-manager] Discovered SMA inverter: no
[12/02/2024, 11:01:36] [homebridge-sma-home-manager] Discovered SMA energy manager: { Model: 372, SerialNumber: 301184xxxx, FirmwareRevision: '2.13.6.R' }
[12/02/2024, 11:01:36] [homebridge-sma-home-manager] Child bridge process ended
[12/02/2024, 11:01:36] [homebridge-sma-home-manager] Process Ended. Code: 1, Signal: null
[12/02/2024, 11:01:43] [homebridge-sma-home-manager] Restarting Process...
[12/02/2024, 11:01:45] [homebridge-sma-home-manager] Launched child bridge with PID 20965
[12/02/2024, 11:01:45] [homebridge-sma-home-manager] Loaded homebridge-sma-home-manager v1.1.8 child bridge successfully
[12/02/2024, 11:01:46] [homebridge-sma-home-manager] Found inverter SMA30120xxxxx at SMA30120xxxx.local with IPv4 address 192.168.179.182.
[12/02/2024, 11:01:47] [homebridge-sma-home-manager] Discovered SMA inverter: no
[12/02/2024, 11:01:47] [homebridge-sma-home-manager] Discovered SMA energy manager: { Model: 372, SerialNumber: 30118xxxx, FirmwareRevision: '2.13.6.R' }```

**Config:**
<!-- Paste relevant output between the two ``` lines below -->
<!-- Remove any sensitive information, passwords, etc. -->

```json


Screenshots:

Inverter: SHM

  • Model: 2.0

Homebridge Environment:
local network

  • Node.js Version: v18.19.0
  • NPM Version: not installed
  • Homebridge Version:Linux homebridge 6.1.0-rpi8-rpi-v8 Installation failed #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux
  • homebridge-sma-inverter Version: v1.1.8
  • Operating System: Raspbian
@funx1 funx1 added the bug Something isn't working label Feb 12, 2024
@funx1 funx1 changed the title [Bug] Bridge restarting, SHM, SBS, Inverter not available [Bug] Bridge restarting, SHM, SBS, STP 15000TL not available Feb 12, 2024
@funx1
Copy link
Author

funx1 commented Feb 26, 2024

Some ideas?

@wimleers
Copy link
Owner

wimleers commented Mar 2, 2024

/var/lib/homebridge/node_modules/homebridge-sma-home-manager/index.js:402
                                const deviceClassId = data.buffer.slice(0, 4).readUInt32BE();
                               ^
TypeError: Cannot read properties of undefined (reading 'buffer')

☝️ Looking at the relevant code:

			// Read device class (U32, ENUM).
			client.readHoldingRegisters(30051, 4, function(err, data) {
				const deviceClassId = data.buffer.slice(0, 4).readUInt32BE();
				deviceType = data.buffer.slice(4, 8).readUInt32BE();
				deviceClass = SMA_DEVICE_CLASSES.get(deviceClassId) || `unknown ${deviceClassId}`;
				registerInverterDiscoveryIfComplete();
			}.bind(this));

That's blindly reading data and is ignoring err altogether 😬 This is one of the last remaining patterns of code remaining of the original codebase that I forked from (https://github.com/codyc1515/homebridge-sma-inverter).

Question: Modbus TCP/IP is enabled?

@funx1
Copy link
Author

funx1 commented Mar 8, 2024

TCP is active on the STP and SBS. Actually I can access the SBS from the HA SMA implementation but not the STP. But I was able to access values over iobroker and modus.

@wimleers
Copy link
Owner

Actually I can access the SBS from the HA SMA implementation

Last time I looked, the Home Assistant integration was scraping the inverter's web UI 😨

But I was able to access values over iobroker and modus.

How does iobroker get the data? And what is "modus"?

@funx1
Copy link
Author

funx1 commented Mar 12, 2024

I give up on this. Using now HA with modbus to read out values. Integrations I tried did not work. Previously with iobroker I was using modbus too. After switching to homebridge I lost these values. But I will start reading them with modbus again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants