Skip to content
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

WIP: Adding alarm functionality (and last motion in webinterface) #117

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

frekel
Copy link

@frekel frekel commented Jan 8, 2018

This is a work in progress. Just for testing/working together

NOTE: This will break your cam (a bit), so don't use this (yet)

@shadow-1
Copy link
Owner

shadow-1 commented Jan 9, 2018

@frekel
I have had a look at the code so far. It looks quite good at the moment.
Just a quick question. Is there any reason why the Last Picture/Video is shown on the About page? Do you think there would be any advantages to adding it onto a dedicated HTML page?

Whilst it is good for a proof of concept to poll for file changes (this Shell script polls once every second). I would prefer to use a more robust method to check for file changes. For example, using inotify. I have tried cross-compiling (unsuccessfully so far) inotify-tools to make it super simple to use inotify in a Shell script. Need to diagnose the issue. It could well be that the kernel on these cameras does not have inotify enabled (which would be strange in my opinion but a real possibility).

@frekel
Copy link
Author

frekel commented Jan 9, 2018

@shadow-1:

  1. The last picture was in the about picture because it was easier. I will create a dedicated HTML page for it!
  2. Are you ok with the name alarm or do you have a better suggestion?
  3. I will refactor the script when you have inotify ready
  4. Can you tell me how I can "save" the TELEGRAM_BOT_TOKEN and TELEGRAM_BOT_CHAT_ID?
  5. I will create a seperate script which will save the last picture so we have that functionality when someone keeps the ALARM option to disabled...

@shadow-1
Copy link
Owner

shadow-1 commented Jan 9, 2018

@frekel

  1. No problems. I don't use any home automation package. So I'm not exactly sure what most of these packages expect. That is why I was thinking of a solution similar to the Fritz firmware (for lack of a better example).

  2. I am ok with alarm. Seems quite logical.

  3. No problems. I found inotify system variables on the camera filesystem. So it looks like it is enabled within the kernel. The cross-compiling must be giving me trouble (unknown reasons at the moment).

  4. For variables used in the scripts. We have a choice of making it configurable through the Web Interface or we can place the variables in a configuration file which the script reads. It is a little bit inconvenient setting variables in config files manually.

  5. Sounds good.

@frekel
Copy link
Author

frekel commented Jan 9, 2018

  1. I really like it to make it configurable through the Web Interface. Can you help me saving them? It looks like something you do with hostname...

@shadow-1
Copy link
Owner

shadow-1 commented Jan 9, 2018

@frekel
4. I can do the modifications to the web server back-end.

The whole back-end needs to be refactored anyway. I couldn't work out a neat way to run a child process and capture the output in an elegant way, so I am still using a bit of a proof of concept hack rather than utilising a proper solution.

@frekel
Copy link
Author

frekel commented Jan 12, 2018

@shadow-1: Any progress?
If you don't have the time to work on it? Maybe you can tell me howto create a new home & root file?
Then I can test my changes ;)

Thanks,
Frank

@shadow-1
Copy link
Owner

@frekel
Sorry, I have not had time.
I have written some decent instructions on how to compile your own firmware images here: #23

If you use my firmware images as the basis for your mods, it will save you a lot of compiling. BusyBox, libwebsockets, ProxyChains-ng etc are all already compiled and put in the correct directory. You will just need to compile the custom libwebsockets plugins (which you have modified a bit) and place the updated web pages in the right spot.

As an alternative, you can transfer the modified files via FTP. I usually do this for testing purposes. Once I am happy, I create the flashable firmware images.

@frekel
Copy link
Author

frekel commented Jan 12, 2018

@shadow-1: Not a problem at all!

I do FTP the updated webpages and scripts. I will try compiling the libwebsockets file. (as I can see I need to do what you told in #23 (comment)).

Can you tell me where the newly created file goes and if I can FTP that file aswell!

Thanks,
Frank

@frekel
Copy link
Author

frekel commented Jan 12, 2018

@shadow-1: Sorry to bother again, but I can't find howto compile the changed .c file.
I have compiled libuv succesfull, but then I am lost....

I have downloaded libwebsockets from [email protected]:warmcat/libwebsockets.git and tried to patch this with the file:

patch < libwebsockets.patch.hi3518ev200 
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Naur '--exclude=.git' ./libwebsockets/lib/lejp-conf.c ./libwebsockets_yi-hack-v3/lib/lejp-conf.c
|--- ./libwebsockets/lib/lejp-conf.c	2017-07-09 12:14:55.148043000 +0800
|+++ ./libwebsockets_yi-hack-v3/lib/lejp-conf.c	2017-07-09 12:11:34.192043000 +0800
--------------------------
File to patch: ^C

Is this the way to go? Or can I take some other actions to compile just my changed file in libwebsockets-plugin......

Hope to hear from you!

Greets,
Frank

@frekel frekel mentioned this pull request Jan 15, 2018
@frekel
Copy link
Author

frekel commented Jan 16, 2018

@shadow-1:
The funny thing is that serving an mp4 file gives an 404 error..... any idea how to fix that?
It would be fun to show the last motion as image and video.

Hope you will find some time to help me!

Greets,
Frank

@frekel
Copy link
Author

frekel commented Jan 20, 2018

@shadow-1:
Any luck finding some time to look at this?

@frekel
Copy link
Author

frekel commented Jan 24, 2018

@shadow-1: I will keep bugging you ;)
Maybe we need to provide you with some beer??

@frekel
Copy link
Author

frekel commented Apr 16, 2018

Hi there,

Just wondering if you had some time to look at this...

@martinjuhasz
Copy link

This would help me a lot. Is there a way of getting this onto my cam before merged?

@ronnicek
Copy link

@shadow-1 create a patreon page or at least donate button, so we can help you to find some time for this great project :)

@nxtpl
Copy link

nxtpl commented Jun 20, 2018

June... still no answer

@frekel
Copy link
Author

frekel commented Jul 3, 2018

July... still no answer :(

@f1vefour
Copy link

f1vefour commented Sep 2, 2018

I guess the answer is no answer unfortunately.

@daxmc99
Copy link

daxmc99 commented Dec 6, 2019

Maybe time to fork?

@Catfriend1
Copy link

Hi @frekel
Where can I get a curl build for the yi platform that works with yi hack? I've tried openwrt mipsel but they failed.

@Arkady23
Copy link

Arkady23 commented Feb 22, 2021

I made an add-on in the yi-hack-v3 environment. Enabled rtsp, viewing video from the camera's sd card, disabling the cloud, selecting TZ, safely power off. Download the add-on from here https://github.com/Arkady23/yi-hack-v3plus
Russian and English versions.

@volkerm81
Copy link

hello :) any updates on the telegram functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.