How integrate bluetooth printer in Kivy ?

254 views
Skip to first unread message

naresh Yarramsetti

unread,
Oct 1, 2022, 11:23:01 PM10/1/22
to Kivy users support
How integrate  bluetooth printer in Kivy ?

platforms : osx, iOS, android, windows
Kivy not supporting  pybluez.

plyer.platforms.macosx.bluetooth can help only for bluetooth is on/off info only, It won't help on connecting, printing, but even this is also not working. :(
Plyer OSXBluetooth coming as None  
<plyer.platforms.macosx.bluetooth.OSXBluetooth object at 0x117ca4df0>


from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from kivy.uix.boxlayout import BoxLayout


Builder.load_string('''
#:import bluetooth plyer.bluetooth
<BluetoothInterface>:
bluetooth: bluetooth
orientation: 'vertical'
padding: '50dp'
spacing: '20dp'
BoxLayout:
orientation: 'horizontal'
size_hint_y: 0.3
Button:
text: 'Get Bluetooth status'
on_release:
root.get_info()
Label:
text: str(root.text)
Label:
text: str(root.info)
''')


class BluetoothInterface(BoxLayout):
'''Root Widget.'''

info = ObjectProperty()
text = StringProperty()

text = "Bluetooth: "

def get_info(self):
self.info = str(self.bluetooth.info)


class BluetoothApp(App):
bt = BluetoothInterface()
def build(self):
return self.bt
def on_pause(self):
return True


if __name__ == "__main__":
BluetoothApp().run()

Elliot Garbus

unread,
Oct 2, 2022, 12:22:50 AM10/2/22
to kivy-...@googlegroups.com

Bluetooth is orthogonal to kivy.  Is there a specific problem using kivy with pybluez?  I would expect it would be simple to integrate.

 

I did a quick search and found this list of Bluetooth libs: https://github.com/ukBaz/python-bluezero/wiki

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/af925869-4f25-432f-bd8b-10c96b1daa8en%40googlegroups.com.

 

naresh Yarramsetti

unread,
Oct 2, 2022, 7:29:34 AM10/2/22
to kivy-...@googlegroups.com
getting  ModuleNotFoundError: No module named 'lightblue' in macbook air M1. 


[INFO   ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
 Traceback (most recent call last):
   File "/Users/yarramsettinaresh/PycharmProjects/gorakaPOS/main1.py", line 28, in <module>
     import bluetooth as bt
   File "/Users/yarramsettinaresh/my-kivy-ios/lib/python3.8/site-packages/bluetooth/__init__.py", line 47, in <module>
     from .macos import *
   File "/Users/yarramsettinaresh/my-kivy-ios/lib/python3.8/site-packages/bluetooth/macos.py", line 1, in <module>
     import lightblue
 ModuleNotFoundError: No module named 'lightblue'

Elliot Garbus

unread,
Oct 2, 2022, 10:55:30 AM10/2/22
to kivy-...@googlegroups.com
This is not a kivy issue, but it looks like you are missing a dependency of the bluetooth library.


It looks like you need to pip install lightblue




Reply all
Reply to author
Forward
0 new messages