Nanit Baby Monitor Integration

It should be just 1935 port. No other ports are needed. What you see here is a client side (port on the side of client who decided to play the stream). Each TCP connection works as a tunnel basically connecting port on your machine to the port to another machine. Client ports are usually in the order of 10000 and above as you see here and assigned by the OS itself. There is no need to worry about them :slight_smile:

The last message says that you tried to play the stream, but cam has actually never published one. Check that your cam can reach the app on port 1935. The NANIT_RTMP_ADDR needs to be reachable address:port from the cam, not your local address. Also make sure, that you have correctly forwarded the port in docker.

1 Like

Just got a new m1 Mac and docker doesnā€™t work.

Pretty new to all this and I was wondering if there is a way to get my uid without docker? does docker have to be running the entire time in order for this to work?

Any idea why it works fine, and then after an unknown amount of time it stops streaming? Using Portainer and can see the container is still running, restarting the container doesnā€™t fix it, still sending mqtt messages with temp and humidity, only way I can get it back is to restart the virtual machine itā€™s running on.

Iā€™m assuming this is the cause of why mine is having issues, now a full restart doesnā€™t get it back anymore, so checked the logs and realized itā€™s giving me this error ā€œForbidden: Number of Mobile App connections above limit, declining connectionā€.

Tried closing the app on my phone and my wifeā€™s phone(completely ended the app, not just minimized it) and that didnā€™t change the error.

11 Feb 21

Iā€™ve been having this same problem. My wife always keeps her app open and I in-frequently check so Iā€™ve been in-frequently breaking it.

As a ā€œfixā€ (not really but Nanit put this restriction in so not a fault of this wonderful app), I have been using the RTMP stream instead of the app on my phone and itā€™s been stable for nearly a week.

If there was some way to increase connections on the nanit side to allow 3, that would be wonderful but I do not believe this is an issue of the app at all.

Please Help!..hahaha

I am completely new to docker and I havenā€™t been able to get it up and running on my Mac with the docker files in the GitHub link.

I would be incredibly grateful if someone could provide a few more details for what needs to be done and where (which apps) in order to get the app up and running.

Wow. Happy to have found this thread, thanks for all the work @velky.bloud!

One request if feasible: would it be possible to fire an event for the motion & sound notifications the Nanit app triggers itself? (For me, I want to trigger a lightā€™s color when the baby is waking up, as sometimes the phoneā€™s notifications arenā€™t noticeable when Iā€™m working).

I am afraid those event notifications are not possible. See: https://gitlab.com/adam.stanek/nanit/-/issues/12 for more discussion on that topic.

Cam does not provide an easy way to interface them, we would have to implement the detection ourselves. It is not impossible but it is rather difficult thing to do properly. Maybe using some separate software for the detection would be an option.

Bummer. Thanks for the reply!

Side note I ran into: The container did not start up on raspberrypi zero w. No logs, even in trace mode. Docker would just silently fail after trying to connect to the instance and then would repeatedly restart it. I tried with all the options on/off (no rtmp, no mqtt, etc). Perhaps the zero has too little resources. I was able to start it up no problem on other harware, so not a big deal.

PI Zero W is arm/v6 unless I am mistaken. The prebuilt images are for arm/v7, arm64/v8 and amd64. You would have to build it yourself for that platform.

But I donā€™t see any other reason why it wouldnā€™t work on Zero. It is not resource hungry.

First of all thank you Adam for your efforts. This is an amazing project.

I tried to set this up on my server (Ubuntu Server 20.04.2 LTS) yesterday, but Iā€™m getting container not found errors, when I run:

docker run --rm
-e [email protected]
-e NANIT_PASSWORD=XXXXXXXXXXXXX
-e NANIT_RTMP_ADDR=xxx.xxx.xxx.xxx:1935
-p 1935:1935
registry.gitlab.com/adam.stanek/nanit:v0-7

It basically gives me this:

ā€œdocker unable to find image ā€˜apt-get:latestā€™ locally ā€¦ docker image not foundā€¦run docker loginā€

Even though I can clearly see itā€™s there: https://gitlab.com/adam.stanek/nanit/container_registry/1510588

Iā€™m running other docker containers without any issues, but I guess this is the first time using one from Gitlab registry. Iā€™m probably missing something simple. Anyone has an idea on how to fix this?

If it gets you error:

ā€œdocker unable to find image ā€˜apt-get:latestā€™ locally ā€¦ docker image not foundā€¦run docker loginā€

then it tries to run image apt-get:latest not registry.gitlab.com/adam.stanek/nanit:v0-7. Such image obviously does not exist :wink:

Check that you donā€™t have a typo in your command. If you are copying it, check especially the line endings, the backslash is important.

Other than that I can recommend to try to pull the image with simple command:

docker pull registry.gitlab.com/adam.stanek/nanit:v0-7

to check everything is ok with your docker setup and that it can access the gitlab repo.

Thanks Adam for the quick turnaround. Turned out to be a fun issue :-). The last part of my password contains a ! followed by a number, which obviously triggers history expansion in zsh. The command at that index was apparently apt-getā€¦

You could run the stream through frigate - a object vision light weight NVR docker. It can also use the coral edge TPU for inference to reduce the load on CPU

After you download the Nanit API collection (.json file) that was posted here:

You then want to import that collection inside Postman app. On the left side of the app youā€™ll see a Nanit API folder you can expand.

The first option is 01. Auth so you want to click that and then on the right side youā€™ll see an option for Body. Click that and you should see a space to enter your email and password that you use for Nanit. Enter those details leaving only the double quotes. Should look like this:

{ 
  "email" :"[email protected]",
  "password" :"nanit password here"
}

Then you want hit the send button and get a response with your info near the bottom of the Postman app.

Hope this helps!

hi there! firstly, thanks for cracking the Nanit API to create this. Iā€™m unfamiliar with Docker and, as such, am having trouble getting this to work properly. have been reading this thread up and down for the past two days but i think i am stuck at the last hurdle.

So far, Iā€™ve managed to get docker up and running (i think), but either i donā€™t have the right baby UID or I am doing something very wrong. when i try to test the stream from VLC, I get the following msg:

e[90m28 Apr 21 13:13 UTCe[0m e[31mWRNe[0m No stream publisher registered yet, closing subscriber stream

any ideas or help is super appreciated :slight_smile:

Also, the rtmp address in configuration.yaml is that meant to be the IP of the camera or the IP of the docker container?

oh, nvm. had to open up port 1935 and now itā€™s working! am running docker on an old windows laptop just to see if i could get this going before I plonk down for a raspberry pi. schoolboy error not checking the ports!

Now on to getting the sensors working. thanks again for this excellent app :slight_smile:

Thank you @velky.bloud for this. My son is 16 mo and I had given up on this integration when I started looking back early '19. Simply amazing. I read that @jaburges had to restart docker hourly. Iā€™m in a similar situation. What are yaā€™ll using to restart your container on a schedule?

I usually have to restart about twice a month after some brief Internet instability, so I am not actually running any periodic restarts of any sorts. The app is able to renew the auth tokens and recover from majority of disconnections just fine. I have experienced some stale connections from time to time but havenā€™t really gathered any relevant info to debug that nor it was ever issue for me to dig deeper :wink:

What I do though, is that I have set up monitoring for the stream, so I do get notification when something fishy is going on.

If you feel the need to restart it, any scheduler would do, I think. Even default cron.