All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Bastien Nocera <hadess@hadess.net>, linux-bluetooth@vger.kernel.org
Subject: Re: Bluetooth printer connection error
Date: Wed, 9 Dec 2020 22:45:57 +0100	[thread overview]
Message-ID: <8066fc64-5528-0952-e23a-49026bea39fc@vivier.eu> (raw)
In-Reply-To: <50264b155ddf8b677125b87a703a628f76518457.camel@hadess.net>

Le 09/12/2020 à 21:27, Bastien Nocera a écrit :
> On Wed, 2020-12-09 at 20:04 +0100, Laurent Vivier wrote:
>> Le 09/12/2020 à 12:34, Bastien Nocera a écrit :
>>> On Wed, 2020-12-09 at 12:14 +0100, Laurent Vivier wrote:
>> ...
>>>>> If the printer has uses the SPP or HCRP printing profiles, you
>>>>> should
>>>>> see it when using:
>>>>> /usr/lib/cups/backend/bluetooth
>>>>> without any arguments.
>>>>
>>>> As I don't see it once it is paired, I guess it is not using one
>>>> of
>>>> these profiles.
>>>
>>> I don't remember how this used to work, but you'll probably only
>>> see
>>> something if the printer is visible.
>>>
>>> You might be able to get the printer to work by adding:
>>> bluetooth://DC0D309023C7
>>> as a printer in the printer settings of your favourite desktop
>>> environment, if it actually uses SPP.
>>>
>>> running the cups backend with:
>>> /usr/lib/cups/backend/bluetooth --get-deviceid
>>> bluetooth://DC0D309023C7
>>>
>>> should show you whether it can get autoconfigured for CUPS use.
>>>
>>
>> Thank you Bastien, it's exactly what I needed to know.
>>
>> Correct me if I'm wrong but it seems there is a bug in the
>> cups/bluetooth
>> command:
> 
> Sigh. No, it's not a bug, it's just that the cups tool was never ported
> from the bluez 4.x to the current bluez 5.x API...
> 
> Until that's ported (if ever, given the low number of Bluetooth
> printers around...), you could try to extract the IEEE1284 ID using:
> sdptool records DC:0D:30:90:23:C7

$ sdptool records DC:0D:30:90:23:C7
Service Name: SPP Dev
Service RecHandle: 0x10001
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100

It doesn't seem to provide an IEEE1284 ID.

> 
> But I'm not certain that this working is necessary to actually try a
> print. Have you tested that?
> 

Not sure what to do...

If I try to add the printer using the GUI, it doesn't appear in the list and I cannot add it
manually (Fedora 33/GNOME 3.38.2) in GUI.

If I add it with the following command line:

  lpadmin -p M02 -E -v bluetooth://DC0D309023C7 -P /usr/share/cups/model/Phomemo/Phomemo-M02.ppd.gz

It doesn't print anything.

But I had some selinux related error:

setroubleshoot[13488]: SELinux interdit à bluetooth d'utiliser l'accès connect sur le
bluetooth_socket Inconnu.Pour des messages SELinux exhaustifs, lancez sealert -l
965e2270-948f-4791-93f0-3b856c162cea
setroubleshoot[13488]: SELinux interdit à bluetooth d'utiliser l'accès connect sur le
bluetooth_socket Inconnu.
...

So I ran:

  ausearch -c "bluetooth" --raw | audit2allow -M my-bluetooth
  semodule -X 300 -i my-bluetooth.pp

And now what I have in the syslogs is:

cupsd[1185]: REQUEST localhost - - "POST /printers/M02 HTTP/1.1" 200 499560 Print-Job successful-ok
DC0D309023C7[14310]: sdp_send_req_w4_rsp: Error sending data:Permission denied
DC0D309023C7[14310]: sdp_service_search_attr_req: Unexpected end of packet
DC0D309023C7[14310]: sdp_send_req_w4_rsp: Error sending data:Permission denied
DC0D309023C7[14310]: sdp_service_search_attr_req: Unexpected end of packet
cupsd[1185]: Can\'t get service information
DC0D309023C7[14310]: sdp_send_req_w4_rsp: Error sending data:Permission denied
DC0D309023C7[14310]: sdp_service_search_attr_req: Unexpected end of packet

Thanks,
Laurent


  reply	other threads:[~2020-12-09 21:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 21:25 Bluetooth printer connection error Laurent Vivier
2020-12-09 11:00 ` Bastien Nocera
2020-12-09 11:14   ` Laurent Vivier
2020-12-09 11:34     ` Bastien Nocera
2020-12-09 19:04       ` Laurent Vivier
2020-12-09 20:27         ` Bastien Nocera
2020-12-09 21:45           ` Laurent Vivier [this message]
2020-12-10  9:35             ` Bastien Nocera
2020-12-10  9:41               ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8066fc64-5528-0952-e23a-49026bea39fc@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=hadess@hadess.net \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.