(Last Updated: July 23, 2020)

iPhoneLocator: Alternate Map Servers



  • Replacing Google Map with

    1. Bing Map
    2. Here Map

    Both tested on openLuup



  • Slight issue I'm seeing with the Here map version on Openluup that the tabs are not all visible in settings. I have home, but nothing else.
    They come up sometimes but seems pretty random
    Also when I go into the map, it often does not load, or only loads part of the images.

    Any thoughts?

    C



  • I run this on openLuup/ALTUI and don't have this problem so I am not sure. Given your problems with icon, I am also suspecting you have some javascript problems. Maybe open a browser console and look for errors?



  • Cheers

    So the maps appears to be an issue with Cross site origin

    A cookie associated with a cross-site resource at http://here.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
    VM1158 data_request:1 Access to XMLHttpRequest at 'http://signature.venue.maps.api.here.com/venues/signature/v1?xnlp=CL_JSMv3.0.17.0&app_id=false&app_code=false' from origin 'http://192.168.70.249:3480' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    mapsjs-core.js:164 GET http://signature.venue.maps.api.here.com/venues/signature/v1?xnlp=CL_JSMv3.0.17.0&app_id=false&app_code=false net::ERR_FAILED
    d @ mapsjs-core.js:164
    $h @ mapsjs-core.js:165
    application/json @ mapsjs-core.js:169
    Gh.De @ mapsjs-core.js:168
    Th @ mapsjs-core.js:37
    (anonymous) @ mapsjs-core.js:38
    (anonymous) @ mapsjs-core.js:38
    eg @ mapsjs-core.js:38
    add @ mapsjs-core.js:38
    td @ mapsjs-core.js:36
    Gh @ mapsjs-core.js:168
    wn.b @ VM1237:47
    wn.W @ VM1237:46
    U.W @ VM1237:11
    U.m @ VM1237:49
    U.F @ VM1237:69
    handleApiReady @ J_Phone.js:238
    (anonymous) @ VM1248:1
    setTimeout (async)
    iphone_Map @ J_Phone.js:439
    eval @ VM1232:1
    _deviceDrawControlPanelJSTab @ J_ALTUI_uimgr.js:3024
    _deviceDrawControlPanelOneTabContent @ J_ALTUI_uimgr.js:3719
    _displayActiveDeviceTab @ J_ALTUI_uimgr.js:3746
    (anonymous) @ J_ALTUI_uimgr.js:7038
    dispatch @ jquery.min.js:2
    v.handle @ jquery.min.js:2
    trigger @ jquery.min.js:2
    (anonymous) @ jquery.min.js:2
    each @ jquery.min.js:2
    each @ jquery.min.js:2
    trigger @ jquery.min.js:2
    l @ bootstrap.min.js:6
    t._transitionComplete @ bootstrap.min.js:6
    i @ bootstrap.min.js:6
    i @ jquery.min.js:2
    handle @ bootstrap.min.js:6
    dispatch @ jquery.min.js:2
    v.handle @ jquery.min.js:2
    trigger @ jquery.min.js:2
    (anonymous) @ jquery.min.js:2
    each @ jquery.min.js:2
    each @ jquery.min.js:2
    trigger @ jquery.min.js:2
    triggerTransitionEnd @ bootstrap.min.js:6
    (anonymous) @ bootstrap.min.js:6
    setTimeout (async)
    o @ bootstrap.min.js:6
    t._activate @ bootstrap.min.js:6
    t.show @ bootstrap.min.js:6
    (anonymous) @ bootstrap.min.js:6
    each @ jquery.min.js:2
    each @ jquery.min.js:2
    i._jQueryInterface @ bootstrap.min.js:6
    (anonymous) @ bootstrap.min.js:6
    dispatch @ jquery.min.js:2
    v.handle @ jquery.min.js:2
    VM1237:10 GET http://1.traffic.maps.api.here.com/maptile/2.1/info?xnlp=CL_JSMv3.0.17.0&app_id=false&app_code=false&output=json&callback_func=H.service.jsonp.handleResponse(2) net::ERR_ABORTED 401 (Unauthorized)
    

    That's when I go to the Map tab

    When I go to the Settings tab:

    http://192.168.70.249:3480/cmh/skins/default/images/cpanel/button_bg.png?*~BUILD_VERSION~* 404 (Not Found)
    

    Which I'm struggling to find on Vera as well

    Any help?

    Just checked and I get the same errors in the console on Vera (same instance of Chrome) but no errors in the display.

    Cheers

    C



  • There seem to be something with CORS and API security. Are you running with CORS enabled on ALTUI? Are you using the same key which is currently active on the vera? If so, I would temporarily disable the plugin on the vera and disable the CORS functionality and start fresh maybe even with a new HERE key on openLuup.
    On the Settings tab,
    It also looks like not all the ALTUI files were moved over from the vera or installed on the openLuup installation or you may have a JS caching in your browser. As far as I know nothing in IPhoneLocator plugin calls out this button. It is an ALTUI command.



  • Thanks, I'll give them a try, yes it's the same key

    C



  • And having said that, I'm not sure how I can do this.

    If I destroy the instances on the Vera, I'll lose them on the Openluup box.

    I've installed the AltUI version from Altmarket place on the Openluup box. This displays the tabs correctly but of course has reset everything to google.

    Above that, there seems to be no way to create another instance of the locator for my wife's phone.

    So I guess two questions remain? How do I create another phone instance under Altui / Openluup?

    And how do I get Openluup iPhone locator back on Here? I have SCPed the files from github into /etc/cmh-ludl and /etc/cmh-ludl/files, forced a reload and hard refreshed. They still load Google maps.

    Cheers!

    C



  • @CatmanV2 said in iPhoneLocator: Alternate Map Servers:

    So I guess two questions remain? How do I create another phone instance under Altui / Openluup?

    Just like on the vera (or at least what the vera really does), create a new device and input the device and implementation files for the plugin. You will instantly get a second instance of the plugin. openLuup behaves very strictly like the vera in this area. kudos to @akbooer

    And how do I get Openluup iPhone locator back on Here? I have SCPed the files from github into /etc/cmh-ludl and /etc/cmh-ludl/files, forced a reload and hard refreshed. They still load Google maps.

    The same way you did it on the vera, replace the one or two files which are different in the /etc/cmh-ludl folder and reload openLuup



  • @rafale77 said in iPhoneLocator: Alternate Map Servers:

    @CatmanV2 said in iPhoneLocator: Alternate Map Servers:

    So I guess two questions remain? How do I create another phone instance under Altui / Openluup?

    Just like on the vera (or at least what the vera really does), create a new device and input the device and implementation files for the plugin. You will instantly get a second instance of the plugin. openLuup behaves very strictly like the vera in this area. kudos to @akbooer

    Oh wow. Thanks!

    The same way you did it on the vera, replace the one or two files which are different in the /etc/cmh-ludl folder and reload openLuup

    Well I could have sworn blind I'd done that 😞

    But apparently I was dreaming...

    C



  • So close!

    2020-06-22 18:03:17.917   luup_log:26: IPhoneLocator: Entering loop:26:1
    2020-06-22 18:03:18.863   luup_log:26: IPhoneLocator: getPeriodForDevice(26) - Distance:0 Auto:0 Base:60==>60
    2020-06-22 18:03:18.864   luup_log:26: IPhoneLocator: loop: an error occurred during execution of forceRefresh():[string "L_IPhone.lua"]:575: attempt to index local 'obj' (a nil value)
    2020-06-22 18:03:18.864   luup.variable_set:: 26.urn:upnp-org:serviceId:IPhoneLocator1.MsgText was: 2020-06-22 18:02 / 60 s now: forceRefresh error, check logs / 60 s #hooks:0
    

    Any thoughts?

    Thanks

    C



  • This is a part of the plugin I did not touch: the iCloud API. Not sure what the error could be but definitely a connection with iCloud. Just to be sure, the device is seen and all setup right?



  • It eventually decided to work! (I did think that that was part of the original as it were. I suspect Apple just being picky.

    Thanks, as ever

    C



  • Annnnd finally got the maps to load properly with an extension blocking CORS

    C



  • I thought I should give this a try on OpenLuup. I used iPhoneLocator on my Vera some years ago. It worked really well, but then I removed it due to the limitations in the Vera.

    The problem I run into is that when I try to create credentials I do not understand how to create an "App code".

    On here.com it says:
    "App code credentials will continue to be supported for a few products and current Developer Portal accounts where App code credentials have already been generated for an App. New accounts will only be able to use App Code credentials for some legacy products. App code credentials are the least secure of the authentication credential types and we recommend the use of the API Key or OAuth 2.0 Token credentials instead for improved security."

    Either it is me missing something very obvious or here.com have changed something.



  • I suspect it's the latter.....

    C



  • @ArcherS

    Thanks for reporting this. I will look at the API key authentication to modify the plugin when I get a few minutes.



  • @rafale77 Thanks! 🙂



  • @rafale77 Cheers!

    C



  • To close this off: It helps if your wife signs into iCloud on her phone....

    C



  • In fact that wasn't it at all 😞

    iCloud knows exactly where she is

    C


Log in to reply