-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any plans to add live view and controls to the web server? #79
Comments
@lazibayer However I am planning on developing RTSP support which will allow use at places without an Internet connection. However not through the web server but through a program running on a PC or through a smartphone app which will not require Internet access. |
That's good news! Thanks for your continuous effort! |
May I suggest a similar feature that could be "easier" to implement. A static JPEG url that could be accessed and which is updated every N seconds. This would integrate very well with home automation systems like openHAB which allow to display URL images on the monitors and refetch them every N seconds. Thoughts? |
Also, this project allows RTSP streaming https://github.com/xmflsct/yi-hack-1080p |
Also, this project allows RTSP streaming https://github.com/xmflsct/yi-hack-1080pI check that project and it seems that RTSP and Yi Home access are mutually exclusive. Will it be the same case for this project as well? |
It looks like that project is only for the 1080p version. Does anyone know if it will work with the 720p 27US version since they apparently have the same image sensor? |
@alexgorbatchev @Ben47 @lazibayer @kruschman |
+1 for managing to obtain the static JPEG image. Just FYI, in motion detection mode |
@dvv |
Once. It gets rid after several seconds and I had no chances to play with it more thoroughly. I believe it's sent to cloud then quickly removed. I managed to (seemingly) robustly catch motion alarm start by the next script (by heart, no camera at hands): tail -F /tmp/log.txt | awk '
/: got a new motion start/ {
print "ALARM+"
system("<START HERE A SHELL COMMAND TO NOTIFY OF ALARM HAS BEGUN>")
}
/: got a new motion stop/ {
print "ALARM-"
system("<START HERE A SHELL COMMAND TO NOTIFY OF ALARM HAS ENDED>")
}
' Moreover, there are some debug info in |
@dvv could you tell us a little bit more regarding the way you implement your script please ? :) |
I added a script #!/bin/sh
exec tail -F /tmp/log.txt | awk '
/: got a new motion start/ {
print "ALARM+"
system("wget -q --spider \"http://192.168.43.1:8765/sms?phone=XXXXXXXXXX&text=cam4\"")
}
/: got a new motion stop/ {
print "ALARM-"
}
' and made it called from if [ -f "/home/yi-hack-v3/script/alarm.sh" ]; then
sh /home/yi-hack-v3/script/alarm.sh &
fi The camera is WiFi-ed via an android phone in WiFi hotspot mode, so the phone's IP is known to be I installed tasker on that phone with TNES plugin which listens to port It just does work ) |
@dvv |
Right, with https-powered wget -q --spider 'https://api.telegram.org/bot<APIKEY>/sendMessage?chat_id=<CHAT>&text=ALARM!' |
The #!/bin/sh
# Copyright 2017 Vladimir Dronnikov
# GPL
exec tail -F /tmp/log.txt | awk '
/: got a new motion start/ {
# motion just started
print "ALARM+"
#system("wget -q --spider \"http://192.168.43.1:8765/sms?phone=9190504182&text=cam4\"")
}
/: cmd=\/home\/app\/cloudAPI -c 411 .* -filename \/tmp\/motion\.jpg\.crypt/ {
# photo ready
print "PHOTO"
system("cp /tmp/motion.jpg /tmp/temp.jpg ; nc 192.168.34.10 1884 < /tmp/temp.jpg &")
}
/: cmd=\/home\/app\/cloudAPI -c 411 .* -filename \/tmp\/motion\.mp4\.crypt/ {
# video ready
print "VIDEO"
system("cp /tmp/motion.mp4 /tmp/temp.mp4 ; nc 192.168.34.10 1885 < /tmp/temp.mp4 &")
}
/: got a new motion stop/ {
# motion stopped, cleanup
print "ALARM-"
system("rm -f /tmp/temp.*")
}
/_____Gamma test for table 4__________/ {
# daylight mode
}
/_____Gamma test for table 2__________/ {
# night mode
}
' I do miss https-enabled @shadow-1 couldn't you provide us with |
I finally found that curl and now the script looks like: #!/bin/sh
# Copyright 2017 Vladimir Dronnikov
# GPL
TELEGRAM_BOT_TOKEN=XXX
TELEGRAM_CHAT_ID=YYY
# NB: curl from https://github.com/utya1988/yi-hack/tree/master/sd/test/curl
exec tail -F /tmp/log.txt | awk -v TELEGRAM_BOT_TOKEN="${TELEGRAM_BOT_TOKEN}" -v TELEGRAM_CHAT_ID="${TELEGRAM_CHAT_ID}" '
# TODO: urlencode text
function sendText(text) {
system("curl -k -q --data \"chat_id=" TELEGRAM_CHAT_ID "&text=" text "\" \"https://api.telegram.org/bot" TELEGRAM_BOT_TOKEN "/sendMessage\"")
}
function sendPhoto(file, text) {
system("curl -k -q -F photo=@" file " \"https://api.telegram.org/bot" TELEGRAM_BOT_TOKEN "/sendPhoto?chat_id=" TELEGRAM_CHAT_ID "&caption=" text "\"")
}
function sendVideo(file, text) {
system("curl -k -q -F video=@" file " \"https://api.telegram.org/bot" TELEGRAM_BOT_TOKEN "/sendVideo?chat_id=" TELEGRAM_CHAT_ID "&caption=" text "\"")
}
/: got a new motion start/ {
# motion just started
print "ALARM+"
sendText("ALARM+")
}
/: cmd=\/home\/app\/cloudAPI -c 411 .* -filename \/tmp\/motion\.jpg\.crypt/ {
# photo ready
print "PHOTO"
system("cp /tmp/motion.jpg /tmp/temp.jpg")
sendPhoto("/tmp/temp.jpg", "PHOTO")
}
/: cmd=\/home\/app\/cloudAPI -c 411 .* -filename \/tmp\/motion\.mp4\.crypt/ {
# video ready
print "VIDEO"
system("cp /tmp/motion.mp4 /tmp/temp.mp4")
sendVideo("/tmp/temp.mp4", "VIDEO")
}
/: got a new motion stop/ {
# motion stopped, cleanup
print "ALARM-"
sendText("ALARM-")
system("rm -f /tmp/temp.*")
}
/_____Gamma test for table 4__________/ {
# daylight mode
}
/_____Gamma test for table 2__________/ {
# night mode
}
' That's all for now. |
@dvv: I am trying to get your script working, but I can not use curl:
Can you provide a small howto? Thanks, |
@frekel try putting https://github.com/utya1988/yi-hack/blob/master/sd/test/curl/libusr/libz.so.1.2.8 as /home/yi-hack-v3/lib/libz.so.1 and use
Does it work? |
Works like a charm! |
\o/ |
curl can also be cross-compiled without compression support. This will eliminate the dependency with libz. |
could you help me? Thanks |
@josemonino it's referenced in the script above: |
@dvv Thanks a lot. Your script is incredible. I'm looking forward to run it on my cam. I put https://github.com/utya1988/yi-hack/blob/master/sd/test/curl/curl into /home/yi-hack-v3/sbin/ Could you help me please? |
Can you do a ls -l from /home/yi-hack-v3/lib and /home/yi-hack-v3/sbin? Just to be sure we have the same enviroment.... |
\o/ |
Small succes!!! I have edited the script from @dvv:
and run the following command to get a symlink: add the following to /home/yi-hack-v3/www/about.html (around line 82):
|
@shadow-1: I am trying to create a pull request, but I'm unfamiliar with the c# (?) part of your sources... Can you point me in the right direction? |
@frekel |
Hi, I have to add your scripting code in /home/yi-hack-v3/script/alarm.sh and make it call with if [ -f "/home/yi-hack-v3/script/alarm.sh" ]; then in /home/yi-hack-v3/script/system.sh Right ? |
Right, that should work. |
@dvv Thanks a lot. It's working like a charm!! |
@frekel Have you got the images I can use with your ALARM modifications? |
Thanks, @frekel. I asked that because of "WIP: Adding alarm functionality (and last motion in webinterface (the changes to the C file) " but looks like you were not able to get that built with the change included. |
I can not find this comment at
#79 so am hoping this reply
will get the asker.
Try `/tmp/sd/curl -k https://....`.
( And never disclose your bot token! Please edit the comment source to hide
the token )
…On Thu, 20 Sep 2018 at 12:45, jaxdao ***@***.***> wrote:
Hi @dvv <https://github.com/dvv>
I got this error
~ # /tmp/sd/curl "
https://api.telegram.org/bot638607717:AAEe4_Mgkh9sV7P8l7L7RFYm
i2tMhV5do4E/sendMessage?chat_id=5207785698&text=$1"
curl: (51) Cert verify failed: BADCERT_NOT_TRUSTED
Please help !
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#79 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAM5h26helO5R0s8DF0zNBpXLTzjVDsSks5uc2OugaJpZM4QXZvQ>
.
|
HI @dvv , |
@jaxdao I believe you should copy #79 (comment) and make it watch for these files instead of /tmp/sd/record/tmp.mp4.tmp |
The script isn't working for me. I have no folder /tmp/sd/record. Even if I create it, there's no files created in there while it's recording. I'm using the latest version of the v3 hack on firmware 1.8.7.0D_201708091510 [EDIT - I should also note that the Yi app notes in settings next to the MicroSD Card: "Abnormality detected, formatting required". I assume that this is because of the use of the SD card for the hack, but maybe not ...] [SOLVED - The SD card was originally PC-formatted. I reformatted it from the camera itself, and now it recognises the card and saves recordings in /tmp/sd/record ] |
@dvv do you have a timeline for exactly when the motion.jpg/.mp4/.jpg.crypt/.mp4.crypt and /tmp/sd/record/tmp.mp4.tmp files get created and deleted? I'm having intermittent results with your script, and I think it's a timing issue. |
@davidgurr No I don't. The script is just a reactive one -- it tries to catch these exact moments. |
I'm trying to use the curl mentioned here in the Fritz Yi Hack. This is the error I get when trying to run that curl from the camera. Any ideas?
|
@jcconnell this project is dead, there's a yi-hack-v4 from another dev, check it out: https://github.com/TheCrypt0/yi-hack-v4 |
I've reviewed that project but it appears he's accepting donations for RTSP functionality. RTSP is working fine for me using the project here: https://github.com/fritz-smh/yi-hack. My goal is to enable curl with HTTPS support so I can get motion notifications in Home Assistant. |
He is, yes but it's not the only thing that is being done. RTSP is already working and also MQTT. I do have motion notifications from all my cameras on HA. I did donate, yes, the minimum is £5 so not really a bank breaker :) ,anyway, it was just a heads up. |
I'll second what xhemp said, the Dev is crazy active and is making great progress. The improvements to the web UI alone were worth the donation. |
You guys twisted my elbow. Curious if it's one donation per user or one donation per camera? |
Per user. |
Done. Thanks for the heads up. Now to update 7 cameras... |
For install curl:
I cant find /tmp/sd/record/last.jpg file. I need to do something before? |
https://github.com/Arkady23/yi-hack-v3plus |
I love the camera but I wish I can use it at places without ANY internet connection. I have an old Fujikam that allows me to do that by simply navigating a browser to its IP address.
The text was updated successfully, but these errors were encountered: