Skip to content

Fix C1000 Gen 2 subscribe using the new send_command interface - #67

Merged
flip-dots merged 1 commit into
flip-dots:mainfrom
alec-pinson:fix_c1000g2_subscribe
Sep 27, 2026
Merged

flip-dots merged 1 commit into
flip-dots:mainfrom
alec-pinson:fix_c1000g2_subscribe

Conversation

@alec-pinson

@alec-pinson alec-pinson commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

_post_connect still calls _send_command with the pre-#61 signature (cmd as bytes, payload=), so the required parameters argument is never supplied:

File "SolixBLE/devices/c1000g2.py", line 62, in _post_connect
    await self._send_command(
TypeError: _send_command() missing 1 required positional argument: 'parameters'

connect() catches this, so the connection survives but the subscribe is never sent — and the Gen 2 streams no telemetry without it. Every sensor reads unavailable. Regression from 685573a, first released in 4.0.0b1.

The raw payload a10121 is parameter a1 with value 21, so it maps directly onto the new interface and the bytes on the wire are unchanged from 3.9.0.

Adds a command test asserting the subscribe builds cmd 4100 with payload a10121. It fails with the above TypeError without the fix.

Reproduced and verified on a real C1000 Gen 2 (A1763).

The new send_command() interface takes a str cmd and a parameters dict, but
_post_connect was still calling it with a bytes cmd and a raw payload. The
required parameters argument was therefore never supplied and every connection
raised TypeError, so the Gen 2 was never sent its subscribe command and streamed
no telemetry.

The raw payload a10121 is the parameter a1 with value 21, so it maps directly
onto the new interface and the bytes on the wire are unchanged.

Add a command test asserting the subscribe builds cmd 4100 with payload a10121.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ladamczyk-it

Copy link
Copy Markdown

Tested on a second C1000 Gen 2 (A1763): with 4.0.0b1 _post_connect fails as described and no telemetry is received. Sending the subscribe as _send_command(cmd="4100", parameters={"a1": {"value": "21"}}) fixes it: the station starts streaming c421/c900 telemetry immediately and all sensors decode correctly.

Note: my unit has newer firmware (capability byte 04), so it also needed the encrypted handshake from #70 to get past negotiation. With both changes it works end-to-end.

@flip-dots

Copy link
Copy Markdown
Owner

Thanks, bit of an oversight on my part (that’s what I get for meh test coverage i guess), I appreciate the fix.

@flip-dots
flip-dots merged commit 6862a70 into flip-dots:main Sep 27, 2026
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants