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

Impossible to install Custom Firmware #197

Closed
Polv89 opened this issue Mar 30, 2018 · 27 comments
Closed

Impossible to install Custom Firmware #197

Polv89 opened this issue Mar 30, 2018 · 27 comments

Comments

@Polv89
Copy link

Polv89 commented Mar 30, 2018

Hello, i followed the guide 1 month ago, and all works great, then i returnet do stock, now i'm gonna to reflash custom firmware, but i cannot finish the procedure..

I formatted the micro sd to FAT32
I copied ONLY demo.bin into the microsd
I plugged the microsd into the dafang
I holded the setup button, plugged in the USB power cable, then left setup button
The base moved in few seconds (and not 5 minutes), and i remove the power
I removed the microSD and started the Dafang
The blue led is shining for 5 seconds, and the base start moving, and i can see in the router interface a device called DAFANGHACKS connected to the network
Copied the content of "firmware mod" into the root of the microSD
Deleted file "demo.bin" (tried without deleting it too)
Edited the wifi network and password on wpa supplicant file
Inserted the microSD into the Dafang
All that i have is an orange led forever.

Download CFW-Binary. Verify the SHA256 and/or SHA3-256 checksums to ensure file integrity.
SHA2-256: 2a23e136906d0ba13d1bb9fe7da52c2eb49c58ccce97be29c91259c2011894ae
SHA3-256: d45826d5b471564366b3b9435509df7e8a2c0720656ea2b4bcac6dd0b42cc3eb
Format your microSD to FAT. NTFS, EXFAT etc. won't work.
Put it to microSD and rename it to "demo.bin". There should be no other files on the microSD! This is really important and it won't work if there are any other files on there.
Shutdown the Dafang camera, remove the power cable and plug the microSD into the Dafang
Hold the setup button on the Dafang camera
Plug in the USB power cable
Wait until the firmware has finished flashing (like 5 minutes). Disconnect the power as soon as the base starts moving.
Remove the microSD and try to start the Dafang camera
You should see the blue led shining up for 5 seconds (not blinking) before the base starts moving. If not, something went wrong. You should try another microSD. Start over from step 1.

@tthk
Copy link
Contributor

tthk commented Mar 31, 2018

That's the correct response from the camera. DAFANGHACKS showing up on your router means that the hack worked and the camera got an IP address. Point your browser to
http://ip_address_of_DAFANGHACKS_from_router/
to start controlling the camera.

@Polv89
Copy link
Author

Polv89 commented Mar 31, 2018

I tried to point to the ip, nothing shows

@tthk
Copy link
Contributor

tthk commented Apr 1, 2018

When I was at this part of the process, I added these lines to run.sh:

blinkblue () {
  i=$1
  while [ $i -gt 0 ]
  do
    echo 0 > /sys/class/gpio/gpio39/value; sleep 1; echo 1 > /sys/class/gpio/gpio39/value; sleep 1
    true $(( i=i-1))
  done
}

blinkyellow () {
  i=$1
  while [ $i -gt 0 ]
  do
    echo 0 > /sys/class/gpio/gpio38/value; sleep 1; echo 1 > /sys/class/gpio/gpio38/value; sleep 1
    true $(( i=i-1))
  done
}

Then, I used:

blinkblue 2; blinkyellow 1

at various places in run.sh to signal where the process stopped.

For example, if you put:

blinkblue 5; blinkyellow 1

at the end of the file, you can look for 5 blue blinks then 1 yellow blink to indicate that run.sh has completed. This means the Dafang Hacks is working, but something else is wrong.

FYI, using this method, I found that I used all caps in my Wi-Fi SSID where the actual SSID was not all caps, and run.sh completed but no IP address was claimed by the camera.

@nbourre
Copy link

nbourre commented Apr 1, 2018

Since I have tried the official MI Home app a month ago, I have not been able to reinstall the CFW or hack on my device. It is kind of driving me nut each time I give it a try to hack it.

I have tried CFW 1.2 and CFW 1.3 without any success.

After doing the steps with 1.2 or 1.3
and after I install the firmware, I only get a fast yellow blinking led.

Is there a simple way to test if the CFW has been well install?

What can I write in the run.sh to do a simple test such as a log file?

@nbourre
Copy link

nbourre commented Apr 1, 2018

So I installed the new official firmware within the MI Home app. After doing the installation steps with CFW 1.3, the run.sh does not execute. It's still the official fw that runs.

The instructions are not clear about when to release the "Setup button". Would it be possible to update the instructions about when to let go the button?

@tthk
Copy link
Contributor

tthk commented Apr 2, 2018

This worked for me on multiple cameras for flashing new cfw-1.3.bin firmware:

  1. Camera off, insert SD card formatted FAT/FAT32 with only cfw-1.3.bin, but renamed to demo.bin on it.
  2. Hold down Setup button on camera
  3. Turn on camera by inserting USB cable (easier to do on the host (bigger) end of the cable)
  4. Keep holding down setup button until blue LED comes on, this takes about 5 seconds.
  5. Release Setup button
  6. Wait. The firmware in SD card demo.bin is being flashed. This takes under a minute for me, not 5 minutes as stated in the instructions.
  7. When camera motor moves, pull the power. The camera is now ready to run the hacked OS if SD card is inserted before power-up.

Continue with installing the firmware_mod file system on SD card and power up camera

@zgadgeter
Copy link

Hello, thanks for these detailed instructions, but mine is still not working. I've now tried 3 different SD cards.
When i plug in the power while holding down the setup button (for about 5 seconds), after about 8 or 9 seconds the base of the camera turns. After this the yellow light simply flashes endlessly. I've repeated this so often, but no change.
Could there be something wrong with my camera?
Or, perhaps, have i screwed up the firmware of the camera somehow? I really don't know what else to try...any help is appreciated. thanks.

@tthk
Copy link
Contributor

tthk commented Apr 2, 2018

After the base turns and you have disconnected the power from the camera (in step 7. of my list above), you will need to put the contents for firmware_mod on the SD card and boot the camera with that card in it. This is the "Installation of the new Firmware" step of the instructions at: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/hacks/install_cfw.md

@zgadgeter
Copy link

Hello, thanks again.
i've tried everything exactly as described, serveral times. The camera light only blinks yellow now, with or without the SD card installed.
So, i've done the bootloader step, camera blinks yellow.
I've done the firmware step, camera blinks yellow.
And now even without an SD card the camera only blinks yellow.
Maybe i screwed it up somehow?

@jmtatsch
Copy link
Collaborator

jmtatsch commented Apr 2, 2018 via email

@zgadgeter
Copy link

Hello, how do i do that, factory reset?
thanks!

@jmtatsch
Copy link
Collaborator

jmtatsch commented Apr 2, 2018

Press the setup button about 10 second to make a camera full reset.

@anup-d
Copy link

anup-d commented Apr 2, 2018

I had the same identical problem as OP, the symptoms were identical too and I just couldn't get it working despite following the instructions down to the letter. Turns out that the /config/wpa_supplicant.dist file needs to be renamed to "wpa_supplicant.conf". That's it. Now everything works like a charm.

I had some difficulty figuring out the IP address as Windows Network is not showing DAFANGHACKS as it should. If you are having the same issue, download Advanced IP scanner app and run a scan of all active addresses within your private network.

@tthk
Copy link
Contributor

tthk commented Apr 2, 2018

@zgadgeter commented 12 hours ago

Hello, thanks for these detailed instructions, but mine is still not working. I've now tried 3 different SD cards. When i plug in the power while holding down the setup button (for about 5 seconds), after about 8 or 9 seconds the base of the camera turns. After this the yellow light simply flashes endlessly. I've repeated this so often, but no change. Could there be something wrong with my camera? Or, perhaps, have i screwed up the firmware of the camera somehow? I really don't know what else to try...any help is appreciated. thanks.

Maybe your SD card is not being read properly if the response from the camera is exactly the same with and without the card. The SD card needs to be FAT/FAT32. Try a smaller card. I am running with 2GB and 4GB cards. Check to see the content of the SD card is the contents of firmware_mod, (not including firmware_mod folder).

Use the blinkblue and blinkyellow functions in run.sh in one of the responses above to verify that the run.sh file is or is not being run.

@theopoon
Copy link

theopoon commented Apr 4, 2018

Have exact same issue with a cam marked manufacturing on 20180104.

Flashed demo.bin as suggest, power down, eject TF, copy files to root of TF, power up, stay there forever without getting IP nor seems it ran the run.sh (added blink suggestion in the thread, no response)

unplug the TF, powerup cam, it does indeed at least rotate on boot, and blink yellow forever.

Don't have a small TF card around (currently using 32GB, smallest on the desk), may try again in couple of days with 2/4/8GB

@jmtatsch
Copy link
Collaborator

jmtatsch commented Apr 4, 2018 via email

@theopoon
Copy link

theopoon commented Apr 4, 2018

Yeap, sure did on /config/wpa_supplicant.conf
(Tho anyway run.sh should still works isn't it? just suggesting)

@theopoon
Copy link

theopoon commented Apr 6, 2018

To anyone who is stuck, this solved my issue, yes, normally I do not do git clone on a Windows, and I shouldn't.

#139

So, confirm the hack works on cam marked manufacturing on 20180104, just a ref.

@ghost
Copy link

ghost commented Apr 8, 2018

Clone firmware from github on Windows doesn't work. Try clone on Linux.
Hope this helps.

@stayingarmed
Copy link

I don't have linux nor do I understand linux at all. Could someone upload the zip file from a linux clone to dropbox or something?

@theopoon
Copy link

theopoon commented Apr 8, 2018

Just download the git as zip instead of git clone.

@hubmon
Copy link

hubmon commented Apr 8, 2018

Click on Clone or Download(Green), then bottom right, click on Download Zip

@stayingarmed
Copy link

ok I downloaded it and apparently it just doesn't work for my camera....it must be updated too high

@nesevis
Copy link

nesevis commented Apr 13, 2018

I've got the same issue here on a Mac. I'm conscientiously deleting the hidden files Spotlight wants to put on the card before pulling it out, so I'm not sure what it could be.

I was thinking it could just be the SD card, but it seems to create a folder called time_lapse after a bit, so it obviously doesn't have any issues reading the card.

@nesevis
Copy link

nesevis commented Apr 13, 2018

My issue was solved by this link: #64 (comment)

@jmtatsch
Copy link
Collaborator

all issues solved, let's close this

@DanielePetrarolo
Copy link

Someone can help me with #669 ?

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

No branches or pull requests