-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
Web streaming #124
Comments
I've never seen a camera device before, do you have a link to where you bought it? |
I have a webcamera that is using Tuya Cloud services with the Smart Life's Google Play app |
I very much doubt TuyAPI will be able to work with cameras at all in its current state, unless it returns something like a URL to get a RTSP feed. But I'm open to looking into adding support for them. Try getting the device's parameters, then post the output of this script: const TuyAPI = require('tuyapi');
const device = new TuyAPI({
id: 'xxxxxxxxxxxxxxxxxxxx',
key: 'xxxxxxxxxxxxxxxx',
ip: 'xxx.xxx.xxx.xxx'});
device.get({schema: true}).then(data => {
console.log(data);
}); If the script fails to return anything, post the output of |
"Sniffing" the communication of the mobile app, I see a MQTT url, password and more data. |
Might work, as other Tuya devices use MQTT as well. What's the output of the above script? |
G�$*e:40028) UnhandledPromiseRejectionWarning: AóW.îNÔÅ (node:40028) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) |
and with the DEBUG: TuyAPI Payload: { gwId: 'bfb9025b246883e9abmhgh', (node:40191) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) |
I don't know if this helps you but , for example, sniffing the communication of the app when I enter to see a camera, it calls to with a postData of and it returns
(I have put ****** at the end of critical id's :-P ) |
Yeah, it looks like this type of devices uses a fundamentally different protocol than smart sockets, lightbulbs, etc. I'm sorry, but I don't foresee being able to add support for Tuya cameras anytime soon. However, if you or anyone else manages to get it working I'll happily accept a PR. |
I had a similar request for Tuya based camera. Walmart had them for $25-ish and I grabbed one; here is what I learned:
Someone had posted that |
Hi @AMoo-Miki As you can see I have IP, password, localkey, devideid, ... etc but I have no luck trying to figure out how to connect to the camera. I have tested public and local IP ... but your method of rtsp is not working.
|
I have gotten only as far as you have. Checking the packets between the native app and the camera, I see STUN and UDP packets but I can't make sense of it. I have been able to make calls to HTTP and RTSP but all end in 401s; I even tried P2PIPC and hit the wall of auth. I deduce that you have the same password as me: "ad2c6d47". Is yours a Geeni or Merkury cam too? I feel brands are keeping the same common password across their cameras and that password is not to be used directly but encrypted with something. Anyway, I really don't know how to go forward; I will keep on looking though. |
No, I have different password in all my cameras... I run 8 cameras (Smart Life Tuya). |
Do you think that this recently Sdk published can help? I can see some P2P keys, .. I hope they are useful |
Interesting, but it doesn't look like there's any actual code unless I'm missing something. |
I've been trying to understand this camera I bought recently as well. I've been scanning these forums and trying to connect with it through several wrappers. I've been able to connect it and wireshark android emulated interactions with it, as well as get its device key and other information through the python and packet capture on android. I'd love to be able to directly interact with the stream and I'll provide any information if it helps. |
sorry for very late reply. public void connect(String... args) { @Centaron or @dantart @AMoo-Miki you were some steps ahead with the camera, could you give it a try? |
One additional note, while Tuya's app talks to devices locally when there is not internet access, it refuses to talk to the camera I have; it doesn't even make an attempt. @luci-11, could you please point me to where you found this file? |
Any update on figuring this out. I have purchased these cameras and want a way to get the stream so can enable it for homebridge. https://www.walmart.com/ip/Merkury-Innovations-Smart-WiFi-720P-Camera-with-Voice-Control/835969619 |
This seems promising. |
Here is an example of how to stream the camera to your pc, taken from this repo https://github.com/ifsale/tuyapiphp
Use the returned url to open the stream: ffplay -i rtsps://xxxxxxxxx |
Is there a way to this with the tuya-cli or a rest client direct? @ifsale |
It's a rest client, directly connects to the tuya cloud api. |
Never seer that message, the link expires so you need to get a new one. Here is a link that streams the camera from the smart life/tuya app with a qrcode: This one is for the us server. |
I got the busy result when using the wrong user id. This is not the app id |
thank you, I finally managed to get the correct uid! However, ffmpeg/ffplay refuse to process the stream:
edit: guess my camera falls into this:
|
This web site is really good. Where did you find this? |
Digging the web, frustration can be a powerful motivator! |
could you explain how to get a correct uid? Thanks |
I have really no programming hability, but would it be possible to get a working stream from our indoor IP-camera at https://ipc-eu.ismartlife.me (it's the European version of ipc-us.ismartlife.me) directly into our Youtube channel, for public viewing? Thank you for helping! |
If I'd have to take a wild guess, i'd say no not with that link. |
But if that website can stream my IP camera from anywhere (after I have allowed the login through a QR code), it should be possible to get the stream into Youtube too – or am I wrong? I just would love to have a simple public stream of our IP cam |
AS i understand, you would need a link for the stream in order to view it through a youtube player which is not what this web address provides, the stream you view has a back end system which has used your login credentials to actually generate the link you would need which you couldn't use anyways as it expires soon as the connection is cut. $app_id = 'xxxxxxxxxxxxxxxxxx'; $camera_id = 'xxxxxxxxxxxxxxxxxxxx'; $tuya = new \tuyapiphp\TuyaApi( $config ); // Get a token // Get camera stream link this code for instance will do the job, although I still think youtube cannot handle the stream in this case for protocol incompatibility reasons. Again, not everything I said might be correct 100% but I think generally speaking the explanation and the approach are. |
You could try to install node which should be easy and doesn't require any programming knowledge, and use some tool like this one https://github.com/ifsale/YourHomeServer which needs basic configuration, from there you just have to deal with how the link generated should be streamed. |
Not sure who to tell this, so I'll just write it in here, as I found a lot of good info in this issue. I found a way to forward the WebRTC stream from the Smart Life WebRTC page to RTSP. I wrote a longer post on Reddit, because I wanted to reach a bunch of people, who might be interested. Mainly to find someone who could turn that thing into a real product, but since tuyapi is so well documented and updated, I figured I would post it here as well. |
hey @mortenmoulder , i was trying your guide, i have a wifi pet feeder with camera, i tried the API explorer to catch the url, as in screenshot above, but it doesnt give me one, so tried your java script, but i have an typeerror : cannot read property of null (reading capturestream) What could be wrong? the strange thing, i cant make the webview to work either, alwas a decoding issue, but thats maybe just a codec or local issue anyway thnx |
hey @dantart , were you ever able to receive the camera stream somehow? in my case i can only retrieve stun/turn address,, there is no RTSP port open, also tried the API command with the php option or directly on api explorer itselft, but doesnt return any rtsp or rtsps address ... so it must be a p2p only stream |
Is anyone still looking into this or found a solution? - any help would be greatly appreciated |
anyone still working on this one? |
I tracked down the error and changed var videoStream = document.querySelector('.videoMain_2XS71565b7').captureStream(); to the proper class name var videoStream = document.querySelector('.camera_videoMain__11n9u').captureStream(); and now am having a different error with starting the session. Will try to investigate it further, help is appreciated! |
I've long since given up. I spent some time years ago looking at some API
code, but I'm not savy enough to figure anything out. I dismantled the
camera but eventually gave up. I've got nothing. Good luck, though.
…On Tue, Sep 19, 2023, 5:39 PM David Woodthorpe ***@***.***> wrote:
Is anyone still looking into this or found a solution? - any help would be
greatly appreciated
—
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIPDHO3DCIKXXW5BU6RIDTTX3IGK3ANCNFSM4GMEF66Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi:
How can I put the streaming of a Tuya camera into a website?
I've seen a lot of docs explaining switching for lights, but nothing about camera streaming.
thank you !
The text was updated successfully, but these errors were encountered: