Bitalino Python API on the MAC OS Platform

New category requests, Website suggestions, etc.
akumiro
Posts: 11
Joined: Wed Apr 27, 2016 9:15 am

Bitalino Python API on the MAC OS Platform

Postby akumiro » Wed May 17, 2017 12:34 am

Has anyone been able to use bitalino's python API on the MAC OS platform? It seems by design it is not supported as shown in the following python snipped:

Code: Select all

    if platform.system() == 'Windows' or platform.system() == 'Linux':
        import bluetooth
        nearby_devices = bluetooth.discover_devices(lookup_names=True)
        return nearby_devices
    elif platform.system() == 'Darwin':
        // Not supported... I would like to add this!
    else:
        raise Exception(ExceptionCode.INVALID_PLATFORM)

There is a package (https://github.com/0-1-0/lightblue-0.4) that promises to allow bluetooth connection on the mac but I cannot install it. It always fails to install on my computer. Has anyone been able to use bitalino's python API on the mac?

BITalino
Site Admin
Posts: 547
Joined: Tue Aug 27, 2013 3:47 pm

Re: Bitalino Python API on the MAC OS Platform

Postby BITalino » Wed May 17, 2017 1:38 am

Hi there,

The Python API does indeed work on Mac OS as well. Instead of using the MAC address of the device (as you are using now), please use the Virtual COM Port (VCP) instead, as described in the documentation:
http://bitalino.com/pyAPI/#bitalino.BITalino

On Mac OS, the VCP will be the address /dev/tty.BITalino-XX-XX-DevB, where XX-XX will be the last 4 hexadecimal numerals on the MAC address of your device (in the case of BITalino (r)evolution devices).

You can check the actual address by opening the Terminal app and typing ls /dev/tty.BIT* (for BITalino (r)evolution devices) or typing ls /dev/tty.bit* (for BITalino devices). Note that the device needs to be paired with Mac OS (PIN: 1234).

Best regards,
The BITalino Team

akumiro
Posts: 11
Joined: Wed Apr 27, 2016 9:15 am

Re: Bitalino Python API on the MAC OS Platform

Postby akumiro » Thu May 18, 2017 7:54 am

Thanks very much!
This was helpful. I successful solved my problem based exactly on your recommendations.

BITalino
Site Admin
Posts: 547
Joined: Tue Aug 27, 2013 3:47 pm

Re: Bitalino Python API on the MAC OS Platform

Postby BITalino » Thu May 18, 2017 9:01 pm

Perfect... any further questions you have, just let us know.

Best regards,
The BITalino Team

Onlyzen
Posts: 1
Joined: Fri Jul 21, 2017 12:15 pm

Re: Bitalino Python API on the MAC OS Platform

Postby Onlyzen » Fri Aug 18, 2017 1:48 pm

hi AKumiro,

Thanks for sharing and this is what I am looking for.


Return to “Website & Forum”




cron