mershon-enterprises/wh-hero

Investigate Cordova plugin availability

Closed this issue · 18 comments

Anyone else bump into this while trying to run
sudo npm install -g ios-sim
or on mac just
npm install -g ios-sim

I get the following error https://gist.github.com/cpascua/f96bcd0440fba8e3014d

@cpascua We'll, you can't run ios-sim on Linux, firstly. As for your Mac, it sounds like maybe you upgraded OSX after you installed homebrew, and now the permissions and ownerships of /usr/local and its subdirectories are screwed up.

Ah, I see. I didn't try on a mac but I did find cases online where it was happening on mac as well. I don't have a mac to work with so I don't think I'll be able to test any of the ios emulators.

@kevinmershon I've been trying to load this sample beacon finder app here, https://github.com/evothings/phonegap-estimotebeacons/tree/master/examples/beacon-finder on the android device. but the app crashs anytime the bluetooth on the device is accessed. I've traced the logs to this error, https://gist.github.com/cpascua/4eeb9d388fccf51900d1. Also, according to this, https://github.com/Estimote/Android-SDK, "The SDK system requirements are Android 4.3 or above and Bluetooth Low Energy." Not sure in the android device you lent me is "Bluetooth Low Energy" but the version of Android is 4.1.1. I've attempted to update it though system updates, but it appears that the device is up to date.

@cpascua Oh crap, that's correct. The Bluetooth LE spec won't work on older versions of Android. We're going to have to find you a newer device to test with.

@cpascua if you're feeling brave, you could install android 4.4 on it: http://www.android.gs/update-motorola-atrix-hd-android-4-4-kitkat-psx-firmware/ I will gladly give this a shot if you don't want to.

@kevinmershon according to http://en.wikipedia.org/wiki/IBeacon in the Lastest Development section the bluetooth crashes are fixed on android 4.4. I'll try to update android the phone. Just wanted to ask whether it was necessary to also load the google android apps.

So I've rooted it, unlocked the bootloader. The last step before updating the phone was to flash the clockworkmod recovery image onto the phone, so that in the phones recovery mode would now see the clockworkmod recovery menu which would include the "advance" option to clear the davlik cache which required for updating the android to version 4.4 according to the android update guide.
I've flashed the specific clockworkmod image for the Atrix HD(MB886) doing the following on PC connect to device through usb

$ adb reboot bootloader
... then wait for the bootloader screen to load
$ adb fastboot flash recovery recovery-clockwork-6.0.4.4-mb886.img
... then  power off device

Afterwards I turn the device back on and run the following in a terminal.

$ adb reboot recovery

This should restart the device and load the clockworkmod recovery menu but it does not. I always get the stock recovery menu without the "advance".

@cpascua Is the recovery image on the phone, or on the microSD card?

@kevinmershon The actual image is on workmachine.

@cpascua I didn't read the whole guide too carefully, but I do remember a part about a file having to be on the microSD card at one point

@kevinmershon The acutal rom for the Android 4.4 update was suppose to be on the microSD. The directions state that the rom is installed when the phone is in recovery mode. The android stock recovery menu does not provide the option to install roms through the microSD card. I am overwriting the recovery partition with the Clockworkmod recovery image, so that when I go into the phones recovery mode I'd get the extra options to install the rom. I forgot to mention in the earliar post but the option, “install zip from SD card” is included in the Clockworkmod recovery mode but not the stock recovery mode.

I see. So it sounds like there's no way to even get Clockworkmod onto the phone, then?

Yea, it seems that way. I can't say for certain but I suspect that the recovery partition is reset every time the phone reboots.

So, I came tracked down and android phone that was up to spec for the ibeacon plugin and did this...
slack for ios upload
slack for ios upload 1

The above example requires the following plugins for dialog boxes

$ ionic plugin add org.apache.cordova.dialogs
$ ionic plugin add org.apache.cordova.vibration

jQuery is also needed for $.each. I've source jQuery 2.1.1, in index.html, same as the one from the iBeacon example app. Bluetooth needs to be turned on on the device before calling any of the estimote.beacon methods.

The following javascript should retrieve info about all beacons nearby and open a dialog box showing there uuid for each one found. Just need replace navigator.notification.alert() to how ever we want to display it.

// Request authorisation.
estimote.beacons.requestAlwaysAuthorization();                        

// Start ranging.                                                                            
estimote.beacons.startRangingBeaconsInRegion(                         
  {}, // Empty region matches all beacons.                            
  function (beaconInfo) {                                                                    
    estimote.beacons.stopRangingBeaconsInRegion({});                  

    // Open dialog box for each beacon found.                                                            
    $.each(beaconInfo.beacons, function(key, beacon) {                
      navigator.notification.alert(                                                          
        'UUID: ' + beacon.proximityUUID,                              
        function() { console.log('Estimote found. ' + JSON.stringify(beacon)); },
        'Estimote found.',                                                                   
        'Done' 
      );                                                                                     
    });
  },                                                                                         
  function onError(errorMessage) {                                                           
    console.log('Range error: ' + errorMessage);                      
  });
);

I have tested the cordova plugins https://github.com/parsonsmatt/WifiWizard and https://github.com/evothings/phonegap-estimotebeacons with an android device. I've verified that these WifiWizard plugin is sufficient for the app in manipulating the wifi on an android device. I've also verified that we can retrieve UUID's from the estimote via bluetooth with the iBeacon plugin. Before I close this issue, I need to verify whether devices' bluetooth should also be manipulated by the app like the wifi.

Closing this issue since https://github.com/parsonsmatt/WifiWizard and https://github.com/evothings/phonegap-estimotebeacons have been verified to have the required functionality for the app