# Connect to Hololens via Node-Red

**URL:** <https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515>\
**Category:** General\
**Created:** [13 April 2023 07:56 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515 "2023-04-13T07:56:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![boarak](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@boarak](https://discourse.nodered.org/u/boarak)\
**Post date:** [13 April 2023 07:56 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/1 "2023-04-13T07:56:28Z")

</div>

Hello again! I hope everyone is okay.  
My question is related to Microsoft Hololens and its battery level. I would like to see the battery level via Node-Red. I did some ways but I took several mistakes.

 ![Screenshot (19)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/e/3e9a4862038ebca48461ce451244f67719c6068c.png)

I can't see the continuation of the mistake I showed with the question mark above. There are three points, but the after is not visible.

```auto
[
    {
        "id": "f52f54bdcee82b3b",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "fd6b79463afb23e8",
        "type": "http request",
        "z": "f52f54bdcee82b3b",
        "name": "GET",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "",
        "tls": "49d6016a.ababa",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "basic",
        "senderr": false,
        "headers": [],
        "x": 490,
        "y": 260,
        "wires": [
            [
                "b308c2fd0e691cad",
                "ed1023e20a8ada5d"
            ]
        ]
    },
    {
        "id": "078df7799eb627e9",
        "type": "debug",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 870,
        "y": 180,
        "wires": []
    },
    {
        "id": "f30652210ab7dd28",
        "type": "change",
        "z": "f52f54bdcee82b3b",
        "name": "/api/power/battery",
        "rules": [
            {
                "t": "set",
                "p": "url",
                "pt": "msg",
                "to": "https://192.168.X.XX/api/power/battery",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 310,
        "y": 260,
        "wires": [
            [
                "fd6b79463afb23e8"
            ]
        ]
    },
    {
        "id": "5b61151766da5f29",
        "type": "inject",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 100,
        "y": 260,
        "wires": [
            [
                "f30652210ab7dd28"
            ]
        ]
    },
    {
        "id": "7ab3473ee519d437",
        "type": "ui_text",
        "z": "f52f54bdcee82b3b",
        "group": "f2436bee621336a5",
        "order": 0,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "battery : ",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "className": "",
        "x": 1140,
        "y": 280,
        "wires": []
    },
    {
        "id": "359a43bbd65e3c8b",
        "type": "ui_gauge",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "group": "f2436bee621336a5",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "donut",
        "title": "Gauge",
        "label": "%",
        "format": "{{msg.payload}}",
        "min": 0,
        "max": "100",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "diff": false,
        "className": "",
        "x": 1150,
        "y": 340,
        "wires": []
    },
    {
        "id": "ddc382f5628a457b",
        "type": "function",
        "z": "f52f54bdcee82b3b",
        "name": "ff",
        "func": "msg.payload = Math.floor( msg.payload.RemainingCapacity / msg.payload.MaximumCapacity * 100 );\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 850,
        "y": 340,
        "wires": [
            [
                "359a43bbd65e3c8b",
                "7ab3473ee519d437"
            ]
        ]
    },
    {
        "id": "b308c2fd0e691cad",
        "type": "json",
        "z": "f52f54bdcee82b3b",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 650,
        "y": 260,
        "wires": [
            [
                "078df7799eb627e9",
                "ddc382f5628a457b"
            ]
        ]
    },
    {
        "id": "ed1023e20a8ada5d",
        "type": "debug",
        "z": "f52f54bdcee82b3b",
        "name": "debug 25",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 620,
        "y": 140,
        "wires": []
    },
    {
        "id": "49d6016a.ababa",
        "type": "tls-config",
        "name": "",
        "cert": "",
        "key": "",
        "ca": "",
        "verifyservercert": false
    },
    {
        "id": "f2436bee621336a5",
        "type": "ui_group",
        "name": "HoloLens",
        "tab": "690c7d582fe7bd12",
        "order": 1,
        "disp": true,
        "width": "6"
    },
    {
        "id": "690c7d582fe7bd12",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard"
    }
]

```

Note: As you can see IP address contains XX. But in flow, I tried real numbers.  
I found some information about the connection between Node-Red and Hololens. Unfortunately, this is the Japanese language. I did not understand anything. Thank you in advance!

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [13 April 2023 09:14 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/2 "2023-04-13T09:14:30Z")

</div>

Hi @boarak,

Just looking at your screenshot, the API is returning what appears to be a requirement to setup access to the API.

I cant imagine many here use Hololens, have you followed the guidance in the link below?  
are you providing authentication creds in your requests?

[Device portal API reference - Mixed Reality | Microsoft Learn](https://learn.microsoft.com/en-us/windows/mixed-reality/develop/advanced-concepts/device-portal-api-reference)

The reason you're only seeing a portion of the response, is because the debug panel is capped to a max number of characters - this is for performance reasons, you can change this in the `settings.js` file in Node RED

---

<div class="post-metadata">

**Author:** ![boarak](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@boarak](https://discourse.nodered.org/u/boarak)\
**Post date:** [13 April 2023 10:01 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/3 "2023-04-13T10:01:27Z")

</div>

Thank you for your response. Yeah, I looked there and took some information.  
There is not so much knowledge about Hololens. Anyway, I will try it.  
By the way, I did not find how to increase the max number of characters from settings.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 April 2023 12:24 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/4 "2023-04-13T12:24:36Z")

</div>

I've been trying to persuade my Microsoft contacts to let me have a Hololens for years now 🙂

If you want to send me one, I'll happily get it working for you! 🤣🤣

---

<div class="post-metadata">

**Author:** ![boarak](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@boarak](https://discourse.nodered.org/u/boarak)\
**Post date:** [14 April 2023 08:33 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/5 "2023-04-14T08:33:45Z")

</div>

I wish this hololens could be my personal item. 😃

If I continue to watch some more Japanese websites. I will have taught myself a new language. 🤣 🤣

---

<div class="post-metadata">

**Author:** ![boarak](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@boarak](https://discourse.nodered.org/u/boarak)\
**Post date:** [14 April 2023 09:29 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/6 "2023-04-14T09:29:44Z")

</div>

What do you think about this output? I just want to brainstorm. Because I do not have any idea about it.  
Thank you for your interest.

 ![Screenshot (20)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd260bebadf7c0c3f3dfcb335ec8fba302f47433.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 April 2023 09:55 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/7 "2023-04-14T09:55:17Z")

</div>

Not sure what you are asking? It appears to be pretty standard to me. Was there something specific you wanted to understand?

Maybe the estimated time? I'm assuming that is the remaining battery time - bit of a guess but I think probably:

```auto
=4294967295/1000/1000/60 = ~72 minutes?

```

---

<div class="post-metadata">

**Author:** ![boarak](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@boarak](https://discourse.nodered.org/u/boarak)\
**Post date:** [14 April 2023 09:57 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/8 "2023-04-14T09:57:10Z")

</div>

Sorry, I sent the wrong picture. I am taking this error. What can be?  
**Reason: "Missing packageFullName query parameter."**

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 April 2023 09:59 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/9 "2023-04-14T09:59:15Z")

</div>

> [@boarak](#):
>
> Missing packageFullName query parameter

[Device portal API reference - Mixed Reality | Microsoft Learn](https://learn.microsoft.com/en-us/windows/mixed-reality/develop/advanced-concepts/device-portal-api-reference)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 June 2023 09:59 UTC](https://discourse.nodered.org/t/connect-to-hololens-via-node-red/77515/10 "2023-06-13T09:59:16Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
