-
Notifications
You must be signed in to change notification settings - Fork 23
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
Off-cloud research #4
Comments
@jilleb I was thinking the same as we were taking over the other thread quite a bit :D Current status:
Not possible:
offline mode ppsapp:
Have a different ppsapp version? check out @jandy123 's write up on patching it: logparser: Modify custom.sh, when about to restart ppsapp, to something like:
Upload log_parser.sh and mosquitto_pub to the root of sdcard; see archive contents. |
dmesg output when doorbell is pressed while it's not connected to the cloud:
I use |
Good question.. I'm looking for it in Ghidra. Sounds like something that would possibly happen in the cloud. I'll get back on this. |
I have been downloading/viewing my .data files for the longest time - they play just fine in VLC when you set the demux to h264 demuxer (in advanced settings). It is kind of a pain having to switch between automatic and h264 but it works - just no audio. |
The fact that I don’t record everything may also impact if the camera runs hot or not (haven’t tried recording everything) plus I have a 9v transformer at the house doorbell. |
maybe getting ppsapp to run propperly is enough?, i'm no expert in Ghidra 😞 maybe it is enough if we can disable the mqtt connection in ppsapp as it is just constantly trying to reconnect, each time with a longer sleep time.. and not doing much else...
|
|
For me rtsp streaming still works after blocking outside connection. Edit: Also, the doorbell push button gets transformed to mqtt event using log_parser. Could you guys confirm this ? |
I'll check. Rtsp does work after blocking web access. But upon reboot it's dead. I just restarted ppsapp from the console by accident.. got a lot of interesting output I will post later when I'm back at the pc. |
I would expect recording continuously would make it hotter than recording events only - have not paid attention to be honest. The other doorbell I had (EZVIZ DB1) was hot as hell compared to this one. It may require more current to run at lower voltage (power=voltage * current) so maybe a bigger low voltage transformer would work, just not sure if it’s worth messing with it when it is already working. If you guys are going to be doing stuff offline using the logs I think we should patch the debug log function to always print the output (there’s some sort of output level setting which I haven’t tried to find yet). Regarding mqtt are those messages encrypted or require secret keys? Cause if not you could just write a new address in ppsapp and use your own server? Just a thought. It should be possible to ‘patch’ ppsapp into thinking the connection is working but that’s a bunch more work specially to do in multiple ppsapp versions. In my case I have a guest network that only has internet access where I put these untrusted devices , then I limit what I access with iptables/ebtables, so I don’t mind that they’re online. |
@guino connections to the tuya mqtt server are over TLS and require username/password. for internal usage this is ofc not necessary.. I will try redirecting the connection to a internal mqtt server that supports TLS to see if that is enough.. also saw ppsapp print a username and password (and more info) to be used for mqtt connection, but these did not let me connect to the tuya server.. perhaps password is a hash or encrypted? |
Nope, this is not the cause for heating, since it's definitely cooler at 5V from USB. It's just some linear regulator which transforms the 12V > 3.3V that dissipates heat, I guess. But then, I didn't even open the device yet...
As I said, I get same log output from ppsapp, so I can still see the forwarded mqtt events. |
Also, in my case, the RTSP server seems to be created on the fly, when a client request (from LAN) is made. This works (as it should !!) without the cloud struff. I can post logs if needed. |
This won't work. I've already looked at the communication in wireshark... |
It seems they have made changes from 2.9.6 to 2.9.7 in a number of aspects (ie blocking HD RTSP, changes to log functions, some logging and probably more) -- those are the things I noticed when patching some of the files. |
I don't need the actual data, was just hoping that it would be enough to let ppsap to start up further.. @jandy123 RTSP does not seem to happen for me, what kind of request are you sending? @guino I belive both me and jandy are running 2.9.6 though.. |
Well, yes, but then we have different ppsapp... |
As noted in the other thread by @adwiraguna, CPU usage in rtsp streaming mode gets to 100%. IS this only with blocked tuya servers ??? |
What exactly you mean ? I just say |
Perhaps this is why they decided to block HD rtsp streams in 2.9.7? @jandy123 I will try to open rtsp stream again later today when connection to tuya is blocked.. will come back with the results.. |
Well, CPU usage when streaming over RTSP is not that bad, actually. Assuming blocked tuya servers, idling is round 3-5% (reported by top). When HD rtsp streaming to one client, it goes up to about 17-20%. The process itself ppsapp does take about 100% CPU, though. Edit: Pushing the bell button while streaming also works ;)... and even the mqtt event gets forwarded, so it's just fine. Temperature-wise, hmmm, still too hot, in my opinion (12 V AC). |
We have the same doorbell/firmware/ppsapp, but it isn't working debug log from ppsapp: The relevant part seems to be: if we can influence these definitions.. would be cool |
@jilleb I now see what you mean. If start ppsapp without tuya cloud connection, indeed, rtsp streaming does not work. Seems that ppsapp gets stuck on connecting to tuya hosts: ` ` |
I noticed some config files in /home/cfg, maybe we can do something with those to manipulate? although I don't see anything usefull at first glance.. |
I never get to
In my case, ppsapp gets stuck looping the bove message. |
I think connection was not blocked during the startup of ppsapp in this debug log, can you confirm @jilleb ? |
I did see the stuff in /home/cfg. Tried to modify ota:0 in /home/cfg/capa.info in a hope to quiet the tuya app upgrade banner, but it didn't work.... |
The connectiong was blocked all the time. I started ppsapp from sd-card in the console with the --help commandline, hoping it would generate some useful output.But....... after closing it, the doorbell no longer boots 😆 |
Connection was blocked all the time here too. @jilleb Hmm, no boot at all ??? |
@McFlyPartages https://github.com/guino/BazzDoorbell/files/5672301/ppsapp-rtsp4.zip is only needed if your device will not have internet access (so you can use RTSP). If you block/disable internet access to the device you will need to create a local NTP server to set the time on the device (or the time on the video will be incorrect). ONVIF is not available on your firmware version as far as I know. |
Thanks for explain. |
This is kind of an old post, But I'm going to ask anyway, for the mqtt log parser to work, Am I modifying custom.sh correctly
and this
The fist one isn't producting any output at all, the 2nd one produces 1 really wierd line which I actually deleted, But Can regenerate if needed. |
@bkbartk The 1st version should be what you need but you need to make sure you have ppsapp on the root of the SD card. So if you don't have a patched ppsapp on the root of the SD card just copy the original one from home/app/ppsapp to the root of the SD card and it should start it up correctly. You also want to make sure log_parser.sh is on the root of the SD card. |
I didn't have ppsapp on the root of my SD card,
not sure why, [edit]: |
@bkbartk if your device is rebooting when you have a ppsapp file int he root of the SD card then either the ppsapp file is corrupted
3-Boot the device, it should re-create the home directory Let me know what you get. PS: If you need to run a PATCHED ppsapp the only way would be modify the boot process to run the patched ppsapp first (Without having to kill it) using "Dan's method" mentioned on the link above (IT MUST BE MODIFIED FOR YOUR DEVICE -- don't try it as-is). If you only wish to get notifications (log_parser) I may have found a way to make this work without having to kill ppsapp (have to do more testing). |
Sorry, The above didn't work, tried regenerating the home dir, that worked, but as soon as I copy PPSAPP to the root, my device crashes after 65 seconds(mesured by stopwatch, so not 100% acurate), I can use telnet, not RSTP, and if I'm quick I can create 1 snap before I get the Connection reset message. I'm trying to work with to original file, not a patched one, because I think if the original doesn't work a patched one will fail for sure. something I noticed is that my "env" file is completely different from what I changed last time, can that be the issue? Dan is talking about firmware 2.9.0, I have 5.2.2 on my device. I have a patched version of my ppsapp generated with the ips file you provided me yesterday, maybe, that one I can use. Still If I use Dan's method, at some point in custom.sh I tries to start another instance, which would be in issue I think? |
@bkbartk the different env file is only used to root the device - you can delete it after that (so current contents do not matter). You should however make sure the /proc/cmdline URL output is similar to your original one. The changes Dan made for 2.9.0 actually only run ppsapp once because it runs ‘ppsapp-rtsp’and the custom.sh tries to find/run ‘ppsapp’. That process can probably be adjusted to your device but it is hard to know what would work without a copy of your device’s files (the home directory created on the SD card). For sure the env file would need to be adjusted with your cmdline settings. |
/proc/cmdline is similar, so no issues there. Here is a copy of my home directory, for as fas as I can see, there is no wifi info in it, and I left all passwords default. but maybe this method is an overkill, If I only have the log_parser. I probably could kill all internet connection using either hosts/pihole/routerblock. I mean, decompiling the files is a lot of work for you and I don't know how much I can ask and my Linux knowledge is limited. So I might need some help with stuff which is really basic for a lot of people out here. |
@bkbartk I think you are right in that it is overkill to use a patched ppsapp for offline if you can handle it without patching. I believe I can make the log_parser work without the need for ppsapp in the root directory (by parsing the output of the ppsapp already running. |
really thanks, |
@bkbartk this seems to work: 1-Download this zip and extract it to your SD card's root directory: reredirect-logparser.zip
You can adjust custom.sh to your needs (i.e. run offline script, etc, the new block will launch the log_parser script using the output of the ppsapp already running. |
Thnx, |
@bkbartk there's a version of mosquitto_pub (with credentials support) here: #35 (comment) |
I am completely offline now without patching. So let me create a short summery so it might helps someone. Then When MQTT works, you need to started blocking internet access.
If you don't have a pihole, you could block all addresses using the "hosts" file. but then you have to grep and list all and there are a lot of different tuya and amazon domains. I found them in pi hole log, but you may find them in tuya log, or your router log. Then you need to modify "custom.sh" to enable to offline script
add the ntpd line now I noticed that while being offline the button press is different so I need to modify the condition in the log_parser
If the doorbell is online I need to grep "doorbell pressed" but when it's offline I need to grep "external_charm_ctrl = 1" now you can use your device offline without patching. I hope my explanation is clear enough and it helps someone. |
I have started to write an universal initrun.sh that handles all needed stuff for patched offline devices. |
Hello everyone, |
For info : |
Another try another message : ` |
hi cweiland, but on a short look on your posting: your ppsapp doesn't seem to be patched, because i see TUYA errors. |
Find a way to disable registration { returnValueAuth = FUN_00104a04(4); The idea is to force returnValueAuth to 0 |
@guino, I hope you don't mind me creating a seperate issue, but I think it helps to keep the other topics on-topic and easier to read.
So let's discuss here what's what when it comes to off-cloud/offline usage of the doorbell. Currently it uses the Tuya cloud, which means the following, according to @m11tch research
The text was updated successfully, but these errors were encountered: