Skip to content

[FR]: Docs: mosquitto proxy for p series #58

Open
@disconn3ct

Description

This could probably be a wiki page or a contrib/ entry.
Is your feature request related to a problem? Please describe.

The MQTT broker on the P series is .. limited. This plugin uses up 3 connections, according to ss -tp. Somewhere I saw it documented that it can only accept 5 connections in total, and certainly everyone in LAN mode has had issues with too many simultaneous connections.

Describe the solution you'd like

Mosquitto can connect to other brokers and proxy messages back and forth, using only one connection. This plugin already works usefully well that way, with the exception of the SD features. That can be disabled under Prefs -> Features.

The mosquitto config is easy. Create a 'bblp' user with the PIN as the password and then:

connection bambuprinter
# Monitor topic $SYS/broker/connection/+/state for status
address IP_ADDRESS_HERE:8883
# Fetch this with: openssl s_client -showcerts -connect IP_ADDRESS_HERE:8883 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p' | tee blcert.pem
bridge_cafile /mosquitto/cert/blcert.pem
remote_password PIN_HERE

bridge_insecure true
remote_username bblp
bridge_protocol_version mqttv311
# Do not allow weird requests because it will close the connection:
notifications_local_only true
try_private false

# Printer talks on report, we talk on request. Anything else causes connection reset.
topic device/SERIAL_NUMBER_HERE/report in
topic device/SERIAL_NUMBER_HERE/request out

Describe alternatives you've considered

Turning things on and off in the correct order, octoprint connections, the printer, the slicer, unrelated computers and routers, etc. It occasionally takes many hours of effort to get a single connection to function. This doesn't completely prevent that, but fewer sources of contention are better.
Additional context

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions