So I wanted to upgrade my Bafang ebike display to the new full colour DPC-14 version, but at arround £85 + shipping , its was a bit on the pricey side. Luckily what should i spot on eBay but a second hang one for a much more acceptable £25 delivered.
Whats the catch? well its working fine but the owner has forgotten the 4 digit pin needed to unlock it… hrm ever one for a technical challenge I take a punt and buy it…
(not the actual controller)
This model display has a remote controller with three buttons that are used to select modes and increase or decrease the power assist,but before I can look at any of those functions I had to find a way to get past the security pin..
As there are only three buttons the way you enter the pin is a bit unusual. When the screen starts you are presented with 0000 and have 10 seconds to attempt to enter a valid pin. You must use the up and down buttons to select each digit in turn and the mode button to move onto the next digit. When the final digit is entered if its correct the screen is unlocked. If not it’s reset to 0000 again and you get a second try. a slow process by hand.
Now I tried all the usual obvious numbers I could think of ( 0000, 1234, 8008 etc), but after about an hour of getting sore fingers I decided to bring out the technology and build a device to help.
What I needed was a way to automate the pressing of buttons. The quick hack I decided to use was to use an Arduino microprocessor and a set or relays to interface with the existing switches. I then needed to write a simple program to start at 0000 and manually click each switch in turn to simulate entering each pin in turn. After a few attempts and tweaking the code I could enter any pin in about 5 seconds.
So I should be able to try every combination within a couple of days if I leave it running. I can wait that long, but how will I know if it’s successful?. I mean I won’t spend 2 days looking at the screen so even if it does get the right combination. It will just carry on merrily pressing buttons. At this point I was a bit luckily. The screen lock had a black background but after looking at videos of working displays I could see that once you get into the main screen the background was white. If I could detect this screen change I would know if the pin was correct or not.
So into the parts bin I go and pull out a light sensor (LDR) by linking this to the Arduino. I now could read a light level of the screen and if that reading was high enough I could assume the screen was white and therefore the pin was correct raise the alarm and stop trying.
As this was a quick hack I sent the pin being tried and the light level to a pc where I could log it into a file to check later.
So off it went…
Ok it took a good 24 hours, but sure enough .
Ping 9100, and I’m in!
First thing I do is turn off the pin option! happy days.
Update: here is the Arduino .ino file I hacked together in a hurry if you want to build this. warning very hacked code with plenty of room for improvement! password-checker.zip