Coder Social home page Coder Social logo

a9-v720's People

Contributors

intx82 avatar sleacher avatar vvvlc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

a9-v720's Issues

Live stream stops when I try to run 2 cameras simultaneously

The script runs perfectly for one camera, but when i try to connect another camera to the same AP, i see that the code provides with a live stream url for second camera but as soon as i browse the live stream link for the second camera, it doesn't work and even stops the stream for the first camera

ModuleNotFoundError: No module named 'cv2' when running python3 src/a9_naxclow.py -l -o live.avi -r

Hi

when running an example python3 src/a9_naxclow.py -l -o live.avi -r I'm getting

➜  a9-v720 git:(master) ✗ python3 src/a9_naxclow.py -l -o live.avi -r 
Traceback (most recent call last):
  File "src/a9_naxclow.py", line 12, in <module>
    from v720_sta import start_srv
  File "/mnt/c/Users/vv632728/Dropbox/eclipse-workspaces/a9-v720/src/v720_sta.py", line 15, in <module>
    from v720_http import v720_http
  File "/mnt/c/Users/vv632728/Dropbox/eclipse-workspaces/a9-v720/src/v720_http.py", line 16, in <module>
    from a9_live import PORT, WAV_HDR
  File "/mnt/c/Users/vv632728/Dropbox/eclipse-workspaces/a9-v720/src/a9_live.py", line 3, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

I added opencv library and bumped numpy in requirements.txt:

netifaces==0.11.0
numpy==1.24.4
opencv-python==4.8.0.76
Pillow==9.5.0
tqdm==4.64.0
xmltodict==0.12.0

Then python3 src/a9_naxclow.py -l -o live.avi -r runs fine.
Thx

List name syntax does not match download syntax

Thanks for the effort you've already put into this project.

Could you make it so when the list name syntax matches the download name syntax?
Below is an example showing that using the name without the dashes, does not work.


python3 src/a9_naxclow.py -f

Found A9 camera, FW version: 202212011602
Files @ 20230210:
-05:06: Filename: 202302100506, Size: 17304244
-05:07: Filename: 202302100507, Size: 16146476
-05:08: Filename: 202302100508, Size: 14613284
-05:09: Filename: 202302100509, Size: 13289740
-05:11: Filename: 202302100511, Size: 10305624
-05:15: Filename: 202302100515, Size: 10112652
-05:16: Filename: 202302100516, Size: 15105012
-05:17: Filename: 202302100517, Size: 12174800
-05:18: Filename: 202302100518, Size: 10620000

python3 src/a9_naxclow.py -d 202302100518 -o out.avi

Found A9 camera, FW version: 202212011602
File 202302100518-22-18 not found

python3 src/a9_naxclow.py -d 20230210-05-18 -o out.avi

Found A9 camera, FW version: 202212011602
Found file @ 20230210 5 18 : 202302100518 with size: 10620000
10.1MB [00:32, 322kB/s]

Changing Port not working

Hi there,

first, thank you for your work.
I already got things working and am tweaking the setup now.

As the port 80 is used by multiple services on the server, i had to install a proxy and forward the request to another port.
I chose 8080 as it is free at the moment.
I have a DNS Server to redirect the naxcom adresses to that machine.
And opening http://v720.naxclow.com/dev/list gives the empty device list from another windows pc, so this seems to work.
Unfortunately the camera does not appear in the device list.

With port 80 everything worked/works.
Below is the log, so there appears the call from the camera.
Why is it not registered as device?
Did i miss something?


call is: python3 /opt/a9/src/a9_naxclow.py -s -v --proxy-port 8080

2023-07-12 21:23:17,435  [   INFO] [UDP-SRV :6123] Waiting for connection
2023-07-12 21:23:17,436  [   INFO] [TCP-SRV :6123] Waiting for connection
2023-07-12 21:23:46,475  [   INFO] [HTTP] GET device list: /dev/list
2023-07-12 21:23:46,475  [   INFO] [HTTP] "GET /dev/list HTTP/1.1" 200 -
2023-07-12 21:23:54,725  [   INFO] [HTTP] POST /app/api/ApiServer/getA9ConfCheck?devicesCode=0800c01A079A&random=DEFGHI&token=c42bf98af0
2023-07-12 21:23:54,726  [   INFO] [HTTP] sending: HTTP/1.1 200
Server: nginx/1.14.0 (Ubuntu)
Date: Wed, 12 Jul 2023 21:23:54 -0000
Content-Type: application/json
Connection: keep-alive
Content-Length: 231


{"code": 200, "message": "OK", "data": {"tcpPort": 6123, "uid": "0800c01A079A", "isBind": "8", "domain": "v720.naxclow.com", "updateUrl": null, "host": "192.168.2.150", "currTime": "1689189834", "pwd": "deadbeef", "version": null}}
2023-07-12 21:24:21,964  [   INFO] [HTTP] GET device list: /dev/list
2023-07-12 21:24:21,964  [   INFO] [HTTP] "GET /dev/list HTTP/1.1" 200 -

Running inside a home assistant add on

Hi!
I'm trying to run the fake server inside a home assistant add on, and building a docker image with opencv-python in it is proving quite hard.

  • Have you considered using something else instead of opencv?
  • Any tips on building a small docker container with opencv-python built in?

I tried to base on one of these but the addon would just not start.

Change Port of Fake Webserver

Heyhey, very neat work! Everything works as intended for me. As far as i've understood, you created an extra distinct AP for the camera. I chose to connect it to my main network and block internet access through the router.

Is it possible to use a different port for the webserver? I tried to change the Port in src/v720_http.py (and src/fake_srv.py), but when i run the server with python3 src/a9_naxclow.py -s, i get an open port and a running webserver, but no Found Device.

Thanks for any help!

"Camera request timeout" when it's dark

Hi there,
I tried to connect to my camera and was getting a
[ ERROR] [HTTP] Camera request timeout

then I noticed that the camera was in a quite dark room, so I switched on the light and it connected.
Tried several times, switch off -> camera request timeout, switch on -> video was ok.

Is this the camera's fault or somehow the process of the incoming data fails to recognize a dark stream?

(No, the camera wasn't connected to the light switch :D )

List of all open ports

Hi, thanks for this incredible piece of smart hack!

I'm making a home assistant add-on and I already managed it to work, but only if I make the docker container run in the host's network.
To keep security in mind, I'd like to expose only the necessary ports.
Using netstat -a
I found the python script opens:

  • 6123/tcp: 6123
  • 80/tcp: 80
  • 6123/udp: 6123

but after exposing them in the config.yaml file, the camera is still unable to connect.

Are there any others I should be opening?

New firmware support

Hi.

My cam came with FW version: 202303131805.
Is there any way to support this version?

My setup:

  • OpenWRT hijaking DNS requests to PiHole
  • PiHole with DNS Record as recommend on your guide (PiHole dedicated to my IoT network only working with WhiteLists. Everything else is blocked)
  • Docker Nginx container listening port 80 and 443. Added a domain based configuration as suggested here
  • Docker Python container running fake server
  • Docker MQTT container

No MQTT message is received nor receive feedback trying sending one.
Device list always empty.

Thanks any help here :)

help to decode camera "DGOxxxxx"

Hello,
I have a similar camera but it uses a different app, server. It sends data to port 32100 UDP.
I redirected DNS to my server and ran your app in server mode.
I tried to change port number in your v720 _sta.py , the server starts but when camera sends data it says:

2023-03-12 19:25:17,517  [   INFO] [UDP-SRV 192.168.1.159:18647] Device for connection is not found
2023-03-12 19:25:17,547  [   INFO] [UDP-SRV 192.168.1.159:23724] Device for connection is not found

So looks like something is wrong with the protocol or something.
Can you please give me any clue on how to decode it so we could use it with your app?
Here is some of the dump, thank you!

tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
16:40:37.640621 IP (tos 0x0, ttl 255, id 3, offset 0, flags [none], proto UDP (17), length 67)
    192.168.1.159.5719 > 192.168.1.1.53: [udp sum ok] 12251+ A? nms2.hdwificampro.com. (39)
E..C......7..........W.5./../............nms2.hdwificampro.com.....
16:40:37.643183 IP (tos 0x0, ttl 255, id 4, offset 0, flags [none], proto UDP (17), length 67)
    192.168.1.159.20512 > 192.168.1.1.53: [udp sum ok] 21755+ A? nms3.hdwificampro.com. (39)
E..C......7.........P .5./2.T............nms3.hdwificampro.com.....
16:40:37.646385 IP (tos 0x0, ttl 255, id 5, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 121.37.9.157.32100: [udp sum ok] UDP, length 4
E.. ......v.....y%      .(.}d....,...
16:40:37.650036 IP (tos 0x0, ttl 255, id 6, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......70........(.}d...b,...
16:40:37.651433 IP (tos 0x0, ttl 255, id 7, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7/........(.}d...b,...
16:40:37.687042 IP (tos 0x0, ttl 255, id 8, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.26009 > 121.37.9.157.32100: [udp sum ok] UDP, length 4
E.. ......v.....y%      .e.}d.../,...
16:40:37.687232 IP (tos 0x0, ttl 255, id 9, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .   ....7-........e.}d....,...
16:40:37.689372 IP (tos 0x0, ttl 255, id 10, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .
....7,........e.}d....,...
16:40:37.690122 IP (tos 0x0, ttl 255, id 11, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 121.37.9.157.32100: [udp sum ok] UDP, length 48
E..L......v.....y%      .e.}d.8..,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:37.691601 IP (tos 0x0, ttl 255, id 12, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 48
E..L......6.........e.}d.8v.,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:37.694755 IP (tos 0x0, ttl 255, id 13, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 48
E..L......6.........e.}d.8v.,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:37.846212 IP (tos 0x0, ttl 255, id 14, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 121.37.9.157.32100: [udp sum ok] UDP, length 4
E.. ......v.....y%      .(.}d....,...
16:40:37.847191 IP (tos 0x0, ttl 255, id 15, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7'........(.}d...b,...
16:40:37.848145 IP (tos 0x0, ttl 255, id 16, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7&........(.}d...b,...
16:40:38.285757 IP (tos 0x0, ttl 255, id 17, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7%........(.}d...b,...
16:40:38.285975 IP (tos 0x0, ttl 255, id 18, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7$........(.}d...b,...
16:40:38.485257 IP (tos 0x0, ttl 255, id 19, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7#........(.}d...b,...
16:40:38.485406 IP (tos 0x0, ttl 255, id 20, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7"........(.}d...b,...
16:40:38.727338 IP (tos 0x0, ttl 255, id 21, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7!........(.}d...b,...
16:40:38.728738 IP (tos 0x0, ttl 255, id 22, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7 ........(.}d...b,...
16:40:38.728739 IP (tos 0x0, ttl 255, id 23, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 121.37.9.157.32100: [udp sum ok] UDP, length 48
E..L......v.....y%      .e.}d.8..,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:38.728739 IP (tos 0x0, ttl 255, id 24, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 48
E..L......6.........e.}d.8v.,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:38.728739 IP (tos 0x0, ttl 255, id 25, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 48
E..L......6.........e.}d.8v.,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:38.885217 IP (tos 0x0, ttl 255, id 26, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7.........(.}d...b,...
16:40:38.885364 IP (tos 0x0, ttl 255, id 27, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7.........(.}d...b,...
16:40:39.086264 IP (tos 0x0, ttl 255, id 28, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7.........(.}d...b,...
16:40:39.086264 IP (tos 0x0, ttl 255, id 29, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7.........(.}d...b,...
16:40:39.285096 IP (tos 0x0, ttl 255, id 30, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7.........(.}d...b,...
16:40:39.285372 IP (tos 0x0, ttl 255, id 31, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ......7.........(.}d...b,...
16:40:39.487177 IP (tos 0x0, ttl 255, id 32, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. . ....7.........(.}d...b,...
16:40:39.487177 IP (tos 0x0, ttl 255, id 33, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .!....7.........(.}d...b,...
16:40:39.686180 IP (tos 0x0, ttl 255, id 34, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. ."....7.........(.}d...b,...
16:40:39.686432 IP (tos 0x0, ttl 255, id 35, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .#....7.........(.}d...b,...
16:40:39.886171 IP (tos 0x0, ttl 255, id 36, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .$....7.........(.}d...b,...
16:40:39.886950 IP (tos 0x0, ttl 255, id 37, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .%....7.........(.}d...b,...
16:40:40.086253 IP (tos 0x0, ttl 255, id 38, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .&....7.........(.}d...b,...
16:40:40.086401 IP (tos 0x0, ttl 255, id 39, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .'....7.........(.}d...b,...
16:40:40.291552 IP (tos 0x0, ttl 255, id 40, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .(....7.........(.}d...b,...
16:40:40.291698 IP (tos 0x0, ttl 255, id 41, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .)....7.........(.}d...b,...
16:40:40.487131 IP (tos 0x0, ttl 255, id 42, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .*....7.........(.}d...b,...
16:40:40.487131 IP (tos 0x0, ttl 255, id 43, offset 0, flags [none], proto UDP (17), length 32)
    192.168.1.159.10457 > 192.168.1.167.32100: [udp sum ok] UDP, length 4
E.. .+....7.........(.}d...b,...
16:40:40.689274 IP (tos 0x0, ttl 255, id 44, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 121.37.9.157.32100: [udp sum ok] UDP, length 48
E..L.,....vk....y%      .e.}d.8..,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:40.690791 IP (tos 0x0, ttl 255, id 45, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 48
E..L.-....6.........e.}d.8v.,...#U.pm.x..c.i.Gb..~.. 3...{...*h.B.H..T..0..j
16:40:40.694489 IP (tos 0x0, ttl 255, id 46, offset 0, flags [none], proto UDP (17), length 76)
    192.168.1.159.26009 > 192.168.1.167.32100: [udp sum ok] UDP, length 48

Does the camera actually have IR leds?

Sending the { "code": 202, "IrLed": 1 } via MQTT does turn the camera B/W, but if the room is dark, the image is just black too.
It looks as if the camera were just switching to B/W, not turning on an IR led.

Or is there maybe another command to turn the IR leds on?

Thank you!

Feature request: option to change the port number

Hello, me again,
I use your fake server behind a nginx reverse proxy.
It works seamlessly on port 9900, but to move it I had to change the HTTP_PORT variable in fake_srv.py and in v720_http.py

Would be nice to have it as a command option.

BTW, my camera streams an MJPEG vid at 640x480
Is this the max it can do? The data sheet speaks of H.264 at FullHD...

Streaming from cam to app

Handshake for streaming with Naxclow server

I've setup Wireshark over a dedicated WIFI connection and dumped the communications between the mobile app, the cam and the servers

Communication

The cam was already registered in the app (with naxclow server) and the app connected to the server.

I've started the transmission from the app and this is the description of what happened.

Nodes

APP: local ip addr 192.168.2.14 (private ip address of the mobile phone with the v720 app)
CAM: local ip addr 192.168.2.13 (private ip address of the camera)
STREAM: ip addr 43.240.74.95 (the remote "streaming" server, host returned by v720.naxclow.com in endpoint /getA9ConfCheck)
(a.b.c.d is my public ip address in internet, my home internet router WAN ip)

"Channels"

port 29942: the tcpPort returned by v720.naxclow.com in endpoint /getA9ConfCheck

APP-to-STREAM-TCP: APP TCP (port 51733) to STREAM on port 29942
APP-to-STREAM-UDP: APP UDP (port 58763) to STREAM on port 29942
STREAM-to-CAM-TCP: STREAM TCP (port 29942) to CAM on port 13761
APP-to-CAM-TCP: APP UDP (port 58763) to CAM on port 18297

Sequence of messages

devTarget, devToken, cliTarget, cliId and target are redacted.

APP-to-STREAM-TCP:
{"cliNatPort":51733,"devTarget":"0800c000XYZW","code":10,"cliPort":45426,"cliIp":"a.b.c.d","devToken":"XJ0af899","cliNatIp":"192.168.2.14"}
{"code":100,"uid":"0003fb965495XXXXYYYYXZZ618febAB","domain":"v720.naxclow.com","token":"55ABfb77"}

APP-to-STREAM-UDP:
{"code":20} # (UDP hole-punch?)

APP-to-STREAM-TCP:
{"cliNatPort":51733,"devTarget":"0800c000XYZW","code":10,"cliPort":45426,"cliIp":"a.b.c.d","devToken":"XJ0af899","cliNatIp":"192.168.2.14"}

STREAM-to-CAM-TCP:
{"code":11,"cliTarget":"0003fb965495XXXXYYYYXZZ618febAB","cliToken":"55ABfb77","cliIp":"a.b.c.d","cliPort":45426,"cliNatIp":"192.168.2.14","cliNatPort":51733}

STREAM UDP (port 29942) to CAM on port 18297:
{"code":21,"ip":"a.b.c.d","port":45412}

APP-to-CAM-TCP:
{"code":50,"cliToken":"55ABfb77","devTarget":"0800c000XYZW","cliId":"0003fb965495XXXXYYYYXZZ618febAB","devToken":"XJ0af899"}

APP-to-STREAM-TCP:
{"code":52,"status":1,"devTarget":"0800c000XYZW","devToken":"XJ0af899"}

STREAM-to-CAM-TCP:
{"code":53,"target":"0003fb965495XXXXYYYYXZZ618febAB","status":1}

APP-to-STREAM-TCP:
{"target":"0800c000XYZW","content":{"code":298},"code":301}

APP-to-CAM-TCP:
{"timeStamp":"1676971368690","code":54}

STREAM-to-CAM-TCP:
{"code":301,"target":"0003fb965495XXXXYYYYXZZ618febAB","content":{"code":298}}

APP-to-STREAM-TCP:
{"target":"0800c000XYZW","content":{"unixTimer":1676974968,"code":4},"code":301}

STREAM-to-CAM-TCP:
{"code":301,"target":"0003fb965495XXXXYYYYXZZ618febAB","content":{"unixTimer":1676974968,"code":4}}

APP-to-STREAM-TCP:
{"target":"0800c000XYZW","content":{"code":3},"code":301}

APP-to-CAM-TCP:
{"timeStamp":"1676971370691","code":54}

STREAM-to-CAM-TCP:
{"code":301,"target":"0003fb965495XXXXYYYYXZZ618febAB","content":{"code":3}}

The CAM sent 1024 bytes UDP packets from port 18297 to APP (port 58763) during the transmission,
and the APP "responded" UDP 72 bytes packets.

After shut off/on of the camera the connection is lost after some time

Hello intx82,
I'm using your fake server and noticed that if I shut down the camera then switch it back on after a short time the server says that the camera drops the connection after few seconds as it detects the previous TCP connection is cut.
e.g.:
I start the server and connect the camera:

python3 src/a9_naxclow.py -s
-------- A9 V720 fake-server starting. --------
Device list: http://127.0.0.1/dev/list
Live capture: http://127.0.0.1/dev/[CAM-ID]/live
Snapshot: http://127.0.0.1/dev/[CAM-ID]/snapshot

-------- Found device 0800c0098970 --------
Live capture: http://127.0.0.1/dev/0800c0098970/live
Snapshot: http://127.0.0.1/dev/0800c0098970/snapshot

Now it is connected to port 30643
[{"host": "192.168.110.159", "port": 30643, "uid": "0800c0098970"}]

Now I switch the camera off by long press of off button and get the switch off MQTT message:
Naxclow/P2P/Users/Device/Status {"device":"0800c0098970","token":"NAXCLOW","status": 0}

Then I switch it back on and the server "sees" it again:

-------- Found device 0800c0098970 --------
Live capture: http://127.0.0.1/dev/0800c0098970/live
Snapshot: http://127.0.0.1/dev/0800c0098970/snapshot

This time is on port 40498
[{"host": "192.168.110.159", "port": 40498, "uid": "0800c0098970"}]

However the server after some seconds tries to communicate again on the old port, gets a connection reset and interprets it as the new connection being severed, outputs the following message and removes the camera from the list of the available cams:

2023-04-17 23:44:19,316  [  ERROR] [TCP-CON 192.168.110.159:30643] Connection closed by peer (camera @ ('192.168.110.159', 30643))
2023-04-17 23:44:19,316  [  ERROR] [TCP-CON 192.168.110.159:30643] Connection closed: ('192.168.110.159', 30643)
-------- Device 0800c0098970 has been disconnected --------

Possible solutions now are either restarting the server if the camera is switched on/off, or waiting the "connection closed" message before switching it back on, but it would be nice if the server could understand the camera is switched off from the MQTT message and forget immediately about the old connection, or check if there's a new connection to the same camera before deciding the connection is closed and remove it from the list of available cams.

Live video streaming issue

Hello intx82!

Thank you in advance for your contribution in the development of software for alternative management of A9 mini cameras with BL7252 MCU.
I recently acquired some units and after some tests, I was interested in alternatively accessing the V720 app on my local network. In this way, I found your contribution through search engines.
I would like to ask for your help.
The units I purchased have firmware number 202302031142. The following commands work:

"python3 src/a9_naxclow.py -f" receives the list of .avi files contained in the memory card.

"python3 src/a9_naxclow.py -d 202301312016 -o out.avi" I download the specified file that is on the card (according to the file name).

However, when running the command "python3 src/a9_naxclow.py -l -o live.avi -r -i", a window opens (supposedly streaming the video from the camera) and turns gray. Does not display camera frames.
Obs.: I noticed that the generated live.avi file remains with 0Kb. Except at the end of the execution, the file has its real size and it is possible to play it in a player.
I ask you to help me with information and even instructions on how I can proceed to correct it.
Thank you again!
I count on your help!

Request for clearer instructions

I have just bought one of these cameras and would really like to get the feed in a browser or via ffmpeg.
However I cannot make sense of the instructions. Could someone please offer a clearer explanation of what steps I should take?
I dabble with Python scripts and microcontrollers so I think I should be able to manage this, so if someone could outline the steps a little bit more clearly that would be much appreciated! Thank you

Hi, now I have 6 mini cams connected, but I always have the same problem, together even if all online only 2 or 3 transmit at the same time.


“A9 Camera fake server” extracted from the log

2023-08-02 11:25:11,395 [WARNING] [V720-STA@7faa9fcb10] Starting video streaming
Exception in thread [email protected]:50659:
Traceback (most recent call last):
File “/usr/lib/python3.11/threading.py”, line 1038, in _bootstrap_inner
self.run()
File “/usr/lib/python3.11/threading.py”, line 975, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/a9-v720/src/v720_sta.py”, line 156, in __udp_hnd
self.__on_udp_rcv(self._udp.recv())
File “/usr/local/a9-v720/src/v720_sta.py”, line 163, in __on_udp_rcv
self._raw_hnd_lst[f’{req.cmd}’](self._udp, data)
File “/usr/local/a9-v720/src/v720_sta.py”, line 360, in __on_audio_rcv_hnd
cb(self, pkg.payload)
File “/usr/local/a9-v720/src/v720_http.py”, line 187, in _on_audio_frame
audio_queue.put_nowait(frame)
File “/usr/lib/python3.11/queue.py”, line 191, in put_nowait
return self.put(item, block=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/queue.py”, line 137, in put
raise Full
queue.Full
2023-08-02 11:25:12,111 [WARNING] [V720-STA@7faa9c3d50] {
“code”: 301,
“target”: “00112233445566778899aabbccddeeff”,
“content”: {
“code”: 4,
“IrLed”: 0,
“devPower”: 92,
“speedGrade”: 1,
“moveAlert”: 0,
“sdMoveMode”: 0,
“wifiName”: “101”,
“instLed”: 1,
“sdDevStatus”: 0,
“mirrorFlip”: 0,
“version”: “202212011602”
}
}
2023-08-02 11:25:12,115 [WARNING] [V720-STA@7faa9c3d50] Starting video streaming
Exception in thread [email protected]:2732:
Traceback (most recent call last):
File “/usr/lib/python3.11/threading.py”, line 1038, in _bootstrap_inner
self.run()
File “/usr/lib/python3.11/threading.py”, line 975, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/a9-v720/src/v720_sta.py”, line 156, in __udp_hnd
self.__on_udp_rcv(self._udp.recv())
File “/usr/local/a9-v720/src/v720_sta.py”, line 163, in __on_udp_rcv
self._raw_hnd_lst[f’{req.cmd}’](self._udp, data)
File “/usr/local/a9-v720/src/v720_sta.py”, line 382, in __on_mjpg_rcv_hnd
cb(self, self._vframe)
File “/usr/local/a9-v720/src/v720_http.py”, line 195, in _on_video_frame
video_queue.put_nowait(frame)
File “/usr/lib/python3.11/queue.py”, line 191, in put_nowait
return self.put(item, block=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/queue.py”, line 137, in put
raise Full
queue.Full
2023-08-02 11:25:12,367 [ ERROR] [HTTP] ffmpeg output timeout [email protected]:47805
2023-08-02 11:25:12,388 [ ERROR] [HTTP] ffmpeg output timeout [email protected]:47805


Thanks

Define Network Interface to listen on

As i was still having issues with using another port with nginx reverse proxy, i was trying to use a second Wifi Adapter, so i have two different IP Addresses in my network. one for my "productive" nginx, one for this a9-v720.

As far as i understand, this software just binds to all available interfaces - can i somehow make it only connect to a defined one, e.g. wlan0 or IP address 192.168.100.100?

As i did not find any option for this, this is probably a [Feature Request]

How to access

Hello. I just buy this camera.
I need to access with html page direct to a video stream.
When i probe to access about url give me user and passwor.
¿Do yo know how can obtain this ?.

Regards.
Javier.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.