EliasKotlyar / Xiaomi-Dafang-Hacks

4.16k stars 1.01k forks source link

Feedback / Support - Issue #7

Closed EliasKotlyar closed 6 years ago

EliasKotlyar commented 6 years ago

This issues is for support and/or general discussions. Open up an issue if you want to have something improved.

sharkoz commented 6 years ago

To follow up on my previous problem, for me the Up and Down buttons are moving the camera left and right

EliasKotlyar commented 6 years ago

@sharkoz : You probably havent updated the motor driver. Try manually updating the sample_motor.ko in /drivers/ folder. After that update - reboot. Then it should start working.

jbeck22 commented 6 years ago

@EliasKotlyar updated to the latest.

Up Down Left and Right now work! Thanks for that!

RTSP isn't working -- when I press the button nothing happens.

When I try to start RTSP from the command line this is what I get: _[root@Ingenic-uc11:bin]# ./mJpegStreamer 10 Play this stream using the URL "rtsp://10.0.0.199:7070/" Beginning streaming... Polling stream timeout Segmentation fault

sharkoz commented 6 years ago

ok thanks rebooting did the trick :)

EliasKotlyar commented 6 years ago

@jbeck22 : You shold be able to get a stream when you use "start RTSP" button and then go with vlc to rtsp://IPADRESS:8554/testStream

deennoo commented 6 years ago

@EliasKotlyar : first thx for your job ! really impressive.

Now that motor are supported, did you plan to provied some "preset position" which can be set by user ? (i will not ask your the motion following as xiaomi fw will do)

jbeck22 commented 6 years ago

@EliasKotlyar when I press the "start RTSP" button nothing happens on the screen. I try to go to that address as you suggested and VLC gives me an error. Also netstat doesn't show port 8554 listening on my camera

sharkoz commented 6 years ago

@jbeck22 try running from SSH directly : /system/sdcard/bin/h264streamer and see what happens

jbeck22 commented 6 years ago

@sharkoz rebooted and reloaded the sdcard -- now when I press the button nothing happens, BUT now the RTSP feed is working on port 8554

Is there a way to get any MJEPG feed?

dbuxo commented 6 years ago

"start RTSP" is working for me from VLC, port 8554.

Changing the hostname doesn't work. /etc/ is a read-only filesystem so the cgi can't modify /etc/hostname file, a workaround could be adding a /etc folder to the sdcard with the hostname file, and adding to run.sh script: hostname -F /system/sdcard/etc/hostname

BugSyst3m commented 6 years ago

Everything works fine for me, RTSP as well through VLC. Impressive work !

Karkas66 commented 6 years ago

RTSP Stream ist not working for me:

[root@dafang2# /system/sdcard/bin/h264streamer Play this stream using the URL "rtsp://192.168.0.241:8554/testStream" Beginning streaming... i264e[info]: profile Constrained Baseline, level 3.1 Beginning to read from file... ^C <Controll C pressed after 2 Minutes> Signal received (2) Polling stream timeout [root@dafang2#

sharkoz commented 6 years ago

@Karkas66 it looks like it works, have you tried opening in VLC the URL provided : rtsp://192.168.0.241:8554/testStream

Karkas66 commented 6 years ago

Of cause I have, it does not work, but i try to redownload the whole project now. Maybe I missed a single update anywhere

BugSyst3m commented 6 years ago

Local network : Everything works fine except renaming the Hostname. Also you cannot get a static img with the RTSP server on. RSTP stream is 1280x720. latency is around 2 to 4 seconds. I'm definitely waiting for 1920*1080 stream :)

Remote network: I managed to access FTP, SSH, and the webserver through remote internet connection however I fail at displaying to the RTSP stream through VLC (with correct ports forwarding).

Karkas66 commented 6 years ago

Verified it, everything works, exept:

VLC actually opens a tcp session, but no picture is shown. Any idea?

Kaaybi commented 6 years ago

Hello guys, thanks a lot for all the fantastic work already done!

To put my feedback: Installing the Custom Firmware want smooth and easy

On the status webpage "Fang Hacks", here is what is working:

Here what isn't working:

I tried to start the RSTP manually through SSH to get more informations and here is what I get:

With the command /system/sdcard/bin/h264streamer:

[root@DAFANGHACKS:~]# /system/sdcard/bin/h264streamer
Play this stream using the URL "rtsp://192.168.0.200:8554/testStream"
Beginning streaming...
i264e[info]: profile Constrained Baseline, level 3.1
Beginning to read from file...

VLC can connect to the server and I can see on the Dafang that that port 8554 is active with netstat but VLC ain't getting any picture.

With the command /system/sdcard/bin/mjpegStreamer 10:

[root@DAFANGHACKS:~]# /system/sdcard/bin/mjpegStreamer 10
Play this stream using the URL "rtsp://192.168.0.200:7070/"
Beginning streaming...
Polling stream timeout
Segmentation fault

Also there is a bunch of broken links! I hope my feedback will help, I'll be testing every update from now on :)

Karkas66 commented 6 years ago

thanks @WatermelonFox - exactly the same over here

martinkindl83 commented 6 years ago

Hello guys. Thank you for this awesome work you do. I received my Dafang yesterday, Updated to custom FW as first thin after unpacking, and copied files over to the SD card. But what i discovered, while trying to make it work is that if i dont broadcast SSID name, it will not connect. Is that something that can be fixed? I really dont want to be broadcasting my SSID name only for Dafang use. I would also want to ask how to start RTSP automatically and if i should be getting sound in RTSP stream? I wanted to have Dafang as baby monitor :)

lukeIam commented 6 years ago

Hi, I just received my dafang and tried to flash the modified 1.1 firmware without success. It always bootet and moved the base just after some seconds. After many retries it now seems bricked: the led is yellow just after attaching the power and it stays in that state (with/without sdcard and with/without pressing the setup-key).

Does anyone know a trick to get in flash mode from that state?

Kaaybi commented 6 years ago

@lukeIam I had that problem with one of my µSD cards! I took another one and it worked great for me. You should make sure to properly format in FAT32. Also try to verify that there is no hidden files with your demo.bin file, I got some hidden files/directories generated by Windows..

@Karkas66 I can see pictures on my RSTP server now! Before, when it wasn't working, I had the camera USB cable plugged into my laptop USB port. Now that I plugged in on an AC adpater, it works, maybe it's related to the power supplied that wasn't enough for the camera, or maybe it's just working after making some reboots?

ronsk-zz commented 6 years ago

Thanks for your awesome work! With the custom firmware and the RTSP stream, I managed to configure the Dafang in synology surveillance station. The only thing missing is audio in the RTSP stream. So I got the same questions as @martinkindl83 :

I would also want to ask how to start RTSP automatically and if i should be getting sound in RTSP stream?

Karkas66 commented 6 years ago

thanks for the hint @WatermelonFox, I realy used "just" the PC connection cable. But the problem stays on both of my Cams with two different powersupplys

sharkoz commented 6 years ago

To start the rtsp steam automatically, try adding at the end of run.sh : /system/sdcard/bin/h264streamer

nwdcben commented 6 years ago

This is great progress, I have the exact same feedback as @WatermelonFox

Although I can open the stream in VLC, for some reason in BlueIris I get an error "RTSP 461 Unsupported Transport" It seems this is a UDP rather than a TCP stream, anyway to change that?

@WatermelonFox - Had the same issues with Windows Hidden Files, is there a way to have WPA Settings use existing Dafang Wifi settings to avoid any necessary customization? Then an SD card Image would be ideal to help windows users. Understood that this type of clean up is not necessary at this stage, however possibly a process or note about hidden windows files/dirs that are generated as soon as the SD card touches a Windows machine.

dbuxo commented 6 years ago

@martinkindl83 , to connect to a hidden SSID try adding the line:

scan_ssid=1

in the file wpa_supplicant.conf, just bellow the ssid name.

My access point didn't have the option to hide the SSID so i can't test it, but that should work as seen here

martinkindl83 commented 6 years ago

Thank you @dbuxo , will check it tomorrow.

ghost commented 6 years ago

hello, Thanks to all for this great work ! I have the exact same feedback as @WatermelonFox. I can take some photos (yeah!!!) but rstp does not work. And it freezes the TV !!! When rstp server is running, then netflix on playstation stops .... I didnt trust the kids the first time, but it's true !!!! Tried different AC power, same issue. How I can debug ? Philippe

martinkindl83 commented 6 years ago

Similar problem here, RSTP works, but it kills WiFi in couple minutes and forces router to reboot and stop working. Which might be just router issue.

Kadalia commented 6 years ago

Hello, Same problem with new CFW 1.2. RSTP server starts ... but slows down the camera ... that become not responsive in couple of minutes. Any hints ? Thank you. Philippe

Karkas66 commented 6 years ago

That would explain, why it is not working for me. I have got Enterprise Accesspoints with much Layer3 and 4 funktionality onboard that drop malformed frames. Home routers and Accesspoints usualy dont analyse such frames an can easily get distracted by things like "UDP Frames in TCP Sessions" and thinks like that. Maybe i can Capture some frames and analyse it later today

Justalurker1213 commented 6 years ago

When flashing the CFW, are you supposed to hold down the setup button the entire time or just a couple of seconds after powering on....?

I've tried 4 different SD cards and can't get it to work. If I hold down the setup button after powering on, it seems to do a factory reset. If Ihold the setup button down for just a couple seconds after powering on, it just flashes yellow.

jbeck22 commented 6 years ago

I already have the first released CFW installed on my camera. How do I update to the newest version? I removed all files from the SDCARD and replaced with a fresh download from git but the version on the status page still says 5.5.1.177. I would have expected 5.5.1.200

trisk commented 6 years ago

@scsmartt you need to hold it down while plugging in the power cable, and then for a few seconds after that.

jbeck22 commented 6 years ago

NM - I figured out what I was doing wrong -- updated and working with the new CFW.

Antimus commented 6 years ago

Ok so I flashed the firmware, when I boot the camera without an SDCard it has the blue light solid for 5 seconds before anything happens, so that looks good. I edited the wireless settings file and hostname file, put the card in, booted the camera. The amber light stays solid, nothing else happens. When I check my router the device has connected but hasn't requested/been assigned an IP address, I can't get to the web server, nothing works. Am I doing something wrong?

sharkoz commented 6 years ago

How do you know that :
"When I check my router the device has connected but hasn't requested/been assigned an IP address," ?

How can it be connected without an IP ?

Antimus commented 6 years ago

My connected device list on the router showed the new hostname but with no ip address assigned to it

trisk commented 6 years ago

@sharkoz it may have associated with the wifi AP so is able to send Ethernet traffic but has not been assigned an IP address with DHCP yet.

trisk commented 6 years ago

@Antimus Can you use e.g. tcpdump or Wireshark to sniff for DHCP requests from the device?

Antimus commented 6 years ago

I would love to be able to know how to do that. let me do some googling

htavasoglu commented 6 years ago

First of all, thank you so much @EliasKotlyar I followed your directions and installed the custom firmware successfully. At the moment the only problem is I can't get rtsp feed using ip cam viewer software. When I use VLC with rtsp://blah blah..../testStream it perfectly gets the stream. It is a little low resolution but usable. When I use the same URL with Android IP cam viewer or Windows IP cam viewer software they can't show the stream. I don't know how I can give more detail.... Is there a known difference between VLC and IP cam viewer apps on showing the rtsp feed?

htavasoglu commented 6 years ago

@Antimus I encountered the same problem. My dafang camera connected to the wifi but did not get IP address. I solved the problem adding an entry to the DHCP Address Reservation list on the router. I wrote the MAC ID of the camera and an unused IP address to the list. Then I rebooted both the router and the camera. When the camera rebooted it took the IP address I wrote to the list...

Antimus commented 6 years ago

@trisk I only see a discovery and request DHCP call, no offer or ack.

@htavasoglu Just tried that, didn't make a difference, thanks for the suggestion though!

Is there any way to set an IP address in the config file?

DarkHelmet67 commented 6 years ago

@Antimus no need to set a static IP address. If you use e.g. router's DHCP in your LAN, you can "reserve" a static IP address using DaFang MAC address (as I do with my Netgear DGN2200v3) @EliasKotlyar thanks a lot for giving us the opportunity to use DaFang as a regular IP webcam. I still have the same issues of others: all is working except RTSP. Either running it from status.cgi web page or SSH shell. Running command line "h264streamer" or "mJpegStreamer 1", I can see the server running. But typing "top" command they are using 0% of CPU (which is strange...) Just the same using a dedicated power adapter (and not a PC usb port)

Antimus commented 6 years ago

@darkhelmet67 thanks but if you've been reading my other posts you'll see that won't help me.

dmolner commented 6 years ago

Hello,

Great work!!! Works crontab? And is possible an instrution move camera to center possition?

EliasKotlyar commented 6 years ago

@ all with the RTSP-problem:

The RTSP-Server is using multicast, and this may create a lot of issues. I am trying to port another rtsp-server, but this will take time.

@dmolner : There is a crontab applet in the busybox binary. Run it with:

/system/sdcard/bin/busybox crontab
/system/sdcard/bin/busybox crond

I havent tried to make it work, but it should be possible without much efforts.

There is currently no way to make the camera move to the center position. I need to figure out the pins which will send me a signal as soon as the camera is "on limit"

MasterPIC commented 6 years ago

@EliasKotlyar I may be wrong (I'm still waiting for delivery of my Dafang...) but I don't think it detects the "zero" by some endstop switches.. As it uses a stepper motor, I'm tempted to think it just moves (after reset) enough time to cause steps loss (so that it has surely reached the origin). Then it could simply count the steps (by assuming no steps loss) while moving. If so, then centering would require to know the angular resolution (°/step or °/microstep) and to keep current position updated while moving...

EliasKotlyar commented 6 years ago

I have integrated a new kernel driver which detects the "endstops". The driver which was provided with the SDK has just faulty code inside it. I have corrected it, and now its working. Can someone test please?