macOS StartupProject

Hello,

Regarding StartupProject with macOS (10.13.6) I do not understand what is going wrong.
cf . https://github.com/mbientlab/MetaWear-SDK-iOS-macOS-tvOS/blob/master/StarterProject/macOS/ScanViewController.swift

Scan works very well but impossible to get LED on or OFF...
Indeed, it looks like if "device.connectAndSetup().continueOnSuccessWith" was not working with macOS... not even an error...
It looks strange as device is well selected after double-click ; device.name value corresponding to the selected row.

Thanks for your attention
Patrice

NB : my 3 metamotion-R are running with version 1.4.2 and are running perfectly with iOS 12.

Comments

  • edited September 2018

    Add error handling to the async task and post the returned error.

  • edited September 2018

    Hello Eric,

    Here is what is logged after double-click on one metawear ; which means that "device.logDelegate = ConsoleLogger.shared" is responding...

    2018-09-26 00:13:41.514133+0200 StarterProject[57531:2395354] MessageTracer: Falling back to default whitelist
    info didUpdateNotificationStateFor <CBCharacteristic: 0x6000000aeee0, UUID = 326A9006-85CB-9195-D9DD-464CFBBAE75A, properties = 0x12, value = (null), notifying = YES>
    info didUpdateValueForCharacteristic <CBCharacteristic: 0x6000000aed60, UUID = Firmware Revision String, properties = 0x2, value = <312e342e 32>, notifying = NO>
    info didUpdateValueForCharacteristic <CBCharacteristic: 0x6000000ae880, UUID = Model Number String, properties = 0x2, value = <35>, notifying = NO>
    info didUpdateValueForCharacteristic <CBCharacteristic: 0x6000000aec40, UUID = Hardware Revision String, properties = 0x2, value = <302e31>, notifying = NO>
    info didUpdateValueForCharacteristic <CBCharacteristic: 0x6000000adf80, UUID = Manufacturer Name String, properties = 0x2, value = <4d626965 6e744c61 6220496e 63>, notifying = NO>
    info didUpdateValueForCharacteristic <CBCharacteristic: 0x6000000aeca0, UUID = Serial Number String, properties = 0x2, value = <30304633 4144>, notifying = NO>
    info Writing NO-RSP: 326A9001-85CB-9195-D9DD-464CFBBAE75A 0180
    info Received: 01800000
    

    Code is exactly the same in repo from github.
    I have tried to add a print(t.error) inside device.connectAndSetup().continueOnSuccessWith but nothing in the console...

    Does it works for you ?
    With old sdk it was working... and it is still working even with 1.4.2 firmware...

    Thanks for your help
    Patrice

  • Use continueWith to proprogate errors.

  • Thanks Eric for your advice. I now get and "error" but only when disconnecting...
    Optional(Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly." UserInfo={NSLocalizedDescription=The connection has timed out unexpectedly.})
    I still must be missing something...
    Thanks again
    Patrice

  • Monitor the BLE activity on macOS and post what the BT radio is doing when calling connectAndSetup.

  • Hello Eric,

    I succeed to extract infomations about bluetoothd process but I am not sure that it is what you are expected...

    Otherwise I have tested it again and with old sdk I do confirm that it works perfectly ; I mean connection and déconnection with led effects (green and red).
    With new sdk, it connects, but impossible to disconnect with double click and the led command do not work...
    Really strange for me...

  • No, monitor the BLE activity i.e. what the BT radio is doing and what data is being exchanged between the device and mac.

    • What macbook model and OS version are you using?
    • Are you using an external BT adapter or the integrated radio?
  • Sorry Eric, I do not know how to do such a thing... with wireshark ? I am going to try...
    I work on a macbook air with High Sierra 10.13.6.
    I am using internal BT radio.
    I have tried with and external usb BT adapter (class 1) but it doesn't work at all as it doesn't work also with the old sdk (which runs perfectly with internal BT)...

  • Hi Eric, I do not have any sniffer dongle to capture BLE traffic with wireshark.

    On your side, can you confirm that the last startupproject is working correctly since upgrade to the new sdk ? I guess that yes but in this case :
    Internal or external BT ? Both are not working the same way ?
    What would be the minimal hardware and software configuration for mac OS ?

  • Issues have been fixed, please try latest code on develop branch

  • Many thanks Stephen,
    It looks better as "connecting" appears in the selected row but it is still impossible to connect and put led on.
    It looks like if isConnectedAndSetup was not responding as it always respond "false"...

  • edited October 2018

    I spent some new couple of hours to try to understand but without any result : with internal like usb external BT...
    I also found this post on the forum from tpitman on 9 august ;
    https://mbientlab.com/community/discussion/2631/macos-connect-doesnt-succeed?
    ... unfortunately without any clue...

    Concretely if my app is running on iOS I would like to develop an interface on mac os, so as to be able to use a best BT receiver signal (class 1)...

    Many thanks for considering my request.

  • Hello Eric and Stephen,

    I made some new tries, but in vain... I also installed Bluetooth Explorer and PacketLogger but nothing, really nothing is moving when launching connectAndSetup ; nothing this is strange I admit... I necessarily miss something...
    I also check develop branch and test the ultimate modifications (5 days ago) in "MockModule.swift" but nothing better :(

    In parallel, so as to check my macbook bluetooth adapter, I made some tests with my Marshall headphones Bluetooth 4 with aptX, and everything is running very well ; with the internal as with the external usb BLE adapter. The only real big difference is the range which is really better with my usb external adapter with dedicated antenna (talus class 1 adapter )... and this is what I am looking for with my Metawear-R.

    Otherwise, as StartupProject doesn't work (at least for me...), did you plan to push on App Store a full MetaBase app available for mac os that I could download to compare ?

    Thanks for your help
    Patrice

  • Start with a simple macOS application that uses CoreBluetooth to connect and discover BLE services. Test that your app works with your MetaWears.

    No, there is no plan on releasing a macOS version of MetaBase.

This discussion has been closed.