# How to access your mobile phone camera in node-red dashboard without opening your LAN to the internet?

**URL:** <https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253>\
**Category:** Dashboard\
**Created:** [8 March 2021 10:21 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253 "2021-03-08T10:21:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [8 March 2021 10:21 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/1 "2021-03-08T10:21:25Z")

</div>

Hi,

I have created a node-red dashboard using a template node that is able to scan a QR code.  
When I access the dashboard in chrome from my iphone (connected to the same LAN) and clicking on button "Request Camera Permissions" it gives the error "unable to query supported devices" (see screenshot).

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf4ab4ee4dd771bba8e0279d500d793cbb1f7db0.png)

The problem is that for mobile devices it seems that browsers are not allowed to access the camera for **http** sites.

I was able to fix this problem by accessing the dashboard via an https site as follows:

1. setup https access to my node-red using traefik (reverse proxy) but the https certificate stuff only works if the URL is a public URL. (so a LAN ). So for this I had to
2. Create a public domain name that routes to my home router
3. open port 443 on my home router and map them to my traefik service.

Is there actually an easier way to get access to my camera on a mobile device (connected to the same home LAN) without requiring me to open my home network (steps 2 and 3) ?

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [8 March 2021 10:36 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/2 "2021-03-08T10:36:35Z")

</div>

You need a trusted CA cert to sign a cert for what ever is hosting the dashboard.

1. Use letsencrypt with the DNS challenge to issue a certificate for a hostname. The DNS can return a private IP address so even though the hostname is public access to the machine will not be. This is complicated to do without hosting your own DNS server (it may be possible with DNS hosting services that have APIs, but they may not let you assign RFC1918 IP addresses to public hostnames)

2. Install a custom profile on the iPhone that contains a private CA certificate that you use to sign the a certificate for the dashboard host.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [9 March 2021 07:50 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/3 "2021-03-09T07:50:12Z")

</div>

Thanks a lot @hardillb,

**Regarding option 1: DNS is returning a private IP address for an existing public**

My home modem is pretty locked. up I have only a user password for it (not an admin) and have no way to configure its DNS server or specify which DNS server IP address the DHCP server should return.

... and of course if I could do this: I admit that it is a bit too complicated setup for me for just being able to access my camera 😉

**Regarding option 2: using private CA**

For me the biggest issue with this is that a custom profile containing private CA needs to be installed on all mobile devices (which is not a fixed list) that I want to access the dashboard .  
... maybe I need to check if there is an easy way to do this (e.g. by downloading it from a site that is also provisioned by node-red).

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [9 March 2021 08:04 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/4 "2021-03-09T08:04:55Z")

</div>

Option 1:  
It's not a case of which DNS server your network (probably supplied by your router) uses to look up IP addresses, it's a case of needing access to the DNS that hosts a domain you own.

Option 2:  
I would be very surprised if Apple don't insist on any site serving up a profile would have to also be over a trusted HTTPS connection, which is a chicken/egg problem

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [9 March 2021 09:12 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/5 "2021-03-09T09:12:33Z")

</div>

thanks @hardillb

**Option 1** is maybe not that complicated. So, I need to look for a **free** dynamic DNS provider that allows me to specify a private IP address for a public hostname.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [9 March 2021 09:46 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/6 "2021-03-09T09:46:13Z")

</div>

The following link seems also to cover my use case but it is unclear if there is any solution for these use cases:

- [Use Cases and Requirements on HTTPS-enabled Local Network Servers  
(Draft Community Group Report, 16 September 2019)](https://httpslocal.github.io/usecases/)

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [9 March 2021 11:11 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/7 "2021-03-09T11:11:39Z")

</div>

Dyn-DNS will not work for using DNS-01 Letsencrypt challenges, you need a to buy a domain and have it hosted somewhere that will let you create TXT records via an API

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [9 March 2021 12:58 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/8 "2021-03-09T12:58:51Z")

</div>

> [@hardillb](#):
>
> you need a to buy a domain and have it hosted somewhere that will let you create TXT records via an API

[https://www.changeip.com/](https://www.changeip.com/) allows me to specify a private IP address for a public hostname without a cost  
... but I cannot create TXT records - is it really needed that a TXT record must be created ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/073f234fcdffbd0f2903dff00486f3d27cd4c127.png)

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [9 March 2021 14:46 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/9 "2021-03-09T14:46:24Z")

</div>

Yes, you need to be able to create a TXT record to use the DNS-01 challenge to get a letsencrypt certificate.

Otherwise you have to use the HTTP-01 challenge, but this requires you to open up the host to the internet which was the point you were trying to avoid.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [9 March 2021 16:25 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/10 "2021-03-09T16:25:55Z")

</div>

Just tested my above change (= using private IP address 192.168.1.31 instead of my public IP address of my home modem) and accessing dashboard via https is working from my macbook but not from my iphone (ERR\_NAME\_NOT\_RESOLVED) also http access from iphone was not working with same error.

It seems that my iphone is not accepting that a public hostname is resolved to private IP address.

---

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [15 March 2021 23:13 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/11 "2021-03-15T23:13:34Z")

</div>

I now you are not looking for this but I use this alot and maybe it can help you too  
with using siri shortcuts you can scan and get scanned code with http get node  
here is the shortcuts flow

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2e9220f2fd7da32d0f7d21ac04db05e431c39925.jpeg)  
and here is the[link](https://www.icloud.com/shortcuts/77d15e87c17c4c02a5aa5eb569455724) if you want to try it.  
✌

---

<div class="post-metadata">

**Author:** ![fercasjr](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@fercasjr](https://discourse.nodered.org/u/fercasjr)\
**Post date:** [18 March 2021 18:10 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/12 "2021-03-18T18:10:09Z")

</div>

Hi, im doing exactly the same i have a ui and want to be able to scan QR codes from it but i couldn't get it to work on devices on the same LAN.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [19 March 2021 07:29 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/13 "2021-03-19T07:29:24Z")

</div>

> [@fercasjr](#):
>
> it but i couldn't get it to work on devices on the same LAN.

Yes, the node-red dashboard opened on your iphone (I guess same for android phone) is not allowed to access its camera for a http site. The site you are accessing must be secure (https) if you want to access your camera.

It is not easy but with a reverse proxy, using a free public hostname, some router (= your home modem that is connecting to the internet) mapping you can secure acces (= https) to the node-red UI.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [19 March 2021 07:39 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/14 "2021-03-19T07:39:23Z")

</div>

> [@hardillb](#):
>
> Option 2:  
> I would be very surprised if Apple don't insist on any site serving up a profile would have to also be over a trusted HTTPS connection, which is a chicken/egg problem

Just checked it for [http://cert.n4l.co.nz/](http://cert.n4l.co.nz/) and I could download this CA using my safari browser on my iphone which I then can install (I didn't do that) via my iphones settings menu as is also described on that site.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [19 March 2021 08:23 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/15 "2021-03-19T08:23:56Z")

</div>

Does Apple even allow installing private root CA certs? It's a hassle even on Android, if you haven't rooted your phone.

I have been using my own root CA for my intranet stuff for ages, but I also run an internal DNS server for my own private top-level domain. So no external services are required. The root CA is installed on all devices, works like a charm.

If you want to manage your own root CA, I can recommend [XCA](https://hohnstaedt.de/xca/).

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [19 March 2021 08:39 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/16 "2021-03-19T08:39:42Z")

</div>

> [@kuema](#):
>
> Does Apple even allow installing private root CA certs? It's a hassle even on Android, if you haven't rooted your phone.

I didn't go as far as actually installing the root CA but the instructions on [http://cert.n4l.co.nz/](http://cert.n4l.co.nz/) seem to be working fine. It also describes the instructions for installing the CA for android device (no need to root it).

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [19 March 2021 08:55 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/17 "2021-03-19T08:55:57Z")

</div>

> [@janvda](#):
>
> It also describes the instructions for installing the CA for android device (no need to root it).

I know that you can install it into the user's root certificate store on Android, but that has implications. It forces you to setup a lock screen with pin or password on most devices. For tablets/phones solely used at home for control/dashboard purposes, this is annoying.  
And on restrictive devices like Amazon Fire Tabs it doesn't seem to be working reliably at all. But that is another story. 😅

---

<div class="post-metadata">

**Author:** ![fercasjr](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@fercasjr](https://discourse.nodered.org/u/fercasjr)\
**Post date:** [19 March 2021 11:41 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/18 "2021-03-19T11:41:18Z")

</div>

with that solution, internet connection would be required to acces even thru the LAN, right?

My only concern is that I dont want to rely on a internet connection to be abble to use it

---

<div class="post-metadata">

**Author:** ![fercasjr](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@fercasjr](https://discourse.nodered.org/u/fercasjr)\
**Post date:** [19 March 2021 12:52 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/19 "2021-03-19T12:52:38Z")

</div>

i think that I already got a solution. i readed something aout self signed ssl certificates that i think it coul d work.:  
[src1](https://www.freecodecamp.org/news/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec/)  
[src2](https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/)

but since i want to focus on another things, in the mean time this was a quick fix that worked for me:

[Enabling the Microphone/Camera in Chrome for (Local) Unsecure Origins | by Scott Carmichael | Medium](https://medium.com/@Carmichaelize/enabling-the-microphone-camera-in-chrome-for-local-unsecure-origins-9c90c3149339)

just added the addres as an insecure origin on the device and its workin now... i know it is not the best way tio go, but i preffer to skip the security on the device so, i can finish the other features that i am workin on, and take care of the ssl cert in the future

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [19 March 2021 13:29 UTC](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253/20 "2021-03-19T13:29:31Z")

</div>

> [@fercasjr](#):
>
> but since i want to focus on another things, in the mean time this was a quick fix that worked for me:
> 
> [Enabling the Microphone/Camera in Chrome for (Local) Unsecure Origins | by Scott Carmichael | Medium](https://medium.com/@Carmichaelize/enabling-the-microphone-camera-in-chrome-for-local-unsecure-origins-9c90c3149339)

This quick fix is not available for IOS (iphone). Just tried it. 😭

[Next page](https://discourse.nodered.org/t/how-to-access-your-mobile-phone-camera-in-node-red-dashboard-without-opening-your-lan-to-the-internet/42253.md?page=2)
