Hello nervlers!
I’m trying to connect a bluetooth printer (thermal ESC/POS “driverless”) to a Raspberry Pi Zero 2 W.
Nerves on the RaspBerry and BlueHeron are working fine (at least with this commit ) and I can connect to the printer via the ATT Client (as per the govee lightbulb examples in BlueHeron repo).
But from there on I’m lost, and not sure if the ATT layer alone is sufficient for this task at all.
To start with, the Govee example uses a hardcoded handle (0x0015) in the BlueHeron.ATT.Client.write/3
which I don’t know where is coming from, so I tried the connection handle itself but that gave no outcome.
The point is: the printer peripheral requires an authentication step via a PIN to be paired with the central role.
- Did anyone try/manage to pair a device via PIN with BlueHeron?
- Does that correspond to integrate the SMP layer with the ATT client?
- Can I convince my device to not require authentication?
In fact I can e.g. send data to the printer from mac OS only after first pairing it via its PIN:
This is an excerpt of the packet logs (via packetlogger) between macOS and the printer during pairing:
A lot of the mentioned packets (link policy, authentication requested, etc.) are present in the BlueHeron library but I wouldn’t know how/if they can be fitted into the ATT Client connection.
And these are the packets exchanged when I send data via a serial debugging tool from mac to the printer to have it print “hello”:
Mac OS seems to change the connection packet type (?) to RFCOMM, but the RFCOMM packet type is not mentioned at all in BlueHeron packets/modules, is there an alternative to that?
I’ll keep trying to integrate SMP, but any help around that would be much appreciated.
A big thank you to the maintainers of nerves and blue heron!!