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

Implement checksumming in goke_p2pcam_param #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

manevich
Copy link

Fix checksum when changing devParam.dat file.
I used as reference explanation of checksum algo by @xjikka from #54
Quick and dirty fix: only tested on PC, newer tried to crosscompile for ARM.

Nevertheless, it solved big problem for me: I was able to setup DIGOO DG-MYQ camera without app.

  1. run ./goke_p2pcam_param -f /home/devParam.dat -wtest -ktest. Any SSID and PSK are fine, this is not used at all AFAIK, but without this wpa_supplicant is never started.
  2. Set your SSID and PSK in /home/wpa_supplicant.conf.
  3. Device should connect to your WiFi after reboot.

@xjikka
Copy link

xjikka commented Apr 28, 2018

Nice, I'm glad it helped.

@deorder
Copy link
Contributor

deorder commented May 10, 2018

Thanks!

@potchin
Copy link

potchin commented May 10, 2018

Cool, is this going to be merged? Would be cool to be able to put the wifi credentials in the config.txt and let it connect to wifi without installing the shady android app.

@deorder
Copy link
Contributor

deorder commented May 13, 2018

Build that will run on the camera:

goke_p2pcam_param.tar.gz

@Cruiser79
Copy link

Did i only have to unpack the binary from goke_p2pcam_param.tar.gz, copy it to my sd-card of the camera, overwrite the old goke_p2pcam_param with it and run the commands in manevich first post here?
That way it didn't connected to my wlan? How can i check, what i did wrong?

@deorder
Copy link
Contributor

deorder commented May 18, 2018

Try filling in the right SSID and key for your WIFI network and modify the wpa_supplicant.conf accordingly.

@deorder
Copy link
Contributor

deorder commented Aug 31, 2018

@ant-thomas Do not forget to merge this pull request. This one finally allows for the wifi to be configured without the official app. I included a build.

@ant-thomas
Copy link
Owner

@deorder The pull request from April allows you to setup WiFi on a previously unconfigured camera?

@manevich
Copy link
Author

manevich commented Sep 2, 2018

@ant-thomas As I said in april:

I was able to setup DIGOO DG-MYQ camera without app.

Hope it also works with other models.

@potchin
Copy link

potchin commented Sep 4, 2018

I just tried this with a new GUUDGO GD-SC03 Snowman (with the read only rootfs) and didnt get much luck.

I replaced the updated binary on the sd card and edited the debug_cmd.sh to add the following..

if [[ ! -f /home/devParam.dat ]] ; then
	touch /home/devParam.dat
	/media/hack/goke_p2pcam_param -f /home/devParam.dat -n0 -o0 -q0 -uadmin -padmin -wssid -kpass
fi

cat << EOF > /home/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
network={
ssid="myssid"
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
pairwise=TKIP CCMP
scan_ssid=1
group=CCMP TKIP WEP104 WEP40
psk="mywifipass"
}
EOF

When the device boots it doesnt connect to my wifi and the chinese voice tells me to use the app to configure wifi. I checked over ethernet and it doesnt look like wpa_supplicant is started...

# wpa_cli 
wpa_cli v0.7.3
Copyright (c) 2004-2010, Jouni Malinen <[email protected]> and contributors

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.


Could not connect to wpa_supplicant - re-trying

^C# 

After starting wpa_supplicant manually and running ifconfig wlan0 up.. still no luck.

I ran out of patience and used the shady android app to get it connected to my wifi :(

@edsub
Copy link

edsub commented Sep 18, 2018

Try filling in the right SSID and key for your WIFI network and modify the wpa_supplicant.conf accordingly.

In the description of goke_p2pcam_param I read you can supply ANY value for both SSID (-w) and Passphrase (-k), as long as the correct values are supplied in wpa_supplicant.conf.
For some reason this did not work for me (at all) with an unconfigured camera.
The supplied values of both -w and -k were not stored persistently in devParam.dat.
Also: it seems that in devParam.dat not he full passphrase is stored, but just the first 8 characters....

Using the persistenthack on a DG-MyQ Digoo Cloudcam

So for now I also seem to be stuck at using the DigooCloud app to initialize the camera for the first time (and whenever it goes back to factory settings).
I prefer to be able to set the SSID and passphrase manually and avoid the shady app completely....(ie. what @potchin described above). Can someone elaborate on this??

@Cruiser79
Copy link

Cruiser79 commented Sep 19, 2018

It seems for me, that there is a bug in this goke_p2pcam_param. I got an Segmentation fault, if i used this binary. If the keyphrase is too long (more than 13 characters) i got this segmentation fault.

# ./goke_p2pcam_param -f /home/devParam.dat -wtestingtheusername  -k1234567890abc
#
# ./goke_p2pcam_param -f /home/devParam.dat -wtestingtheusername  -k1234567890abcd
Segmentation fault
#

In both cases, as @edsub said, i can also see only the first 8 characters in the devParam.dat

@<@@A@@LB@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@A@@@E@@@@@@@222222@A@@@@@@@@@@@@@@@@@@@@A@@@
@@@@@@@@@@@@@@@@@@@@@@@@testingtheusername@@@@@@@@@@@@@@@@@@@@@@@@@@12345678@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@admin@@@@@@@@@@@@@@@@@@@@@

@Cruiser79
Copy link

Just another hint: It is not only the length, to get the segmentation fault
This both examples are working. If i add to every one a character, i got the seg.fault.

# ./goke_p2pcam_param -f /home/devParam.dat -wtest  -k1234567890abc
# ./goke_p2pcam_param -f /home/devParam.dat -wtest  -ktest2222222222

@Cruiser79
Copy link

Maybe @deorder can help in the problem with only 8 characters for the passphrase. The code with this implementation was written from him. Where did you get the restriction of 8 from?

			case 'k':
			if(optarg) {
				param_set_string(0x154, 8, optarg);
			} else {
				param_get_string(0x154, 8);
			}

@deorder
Copy link
Contributor

deorder commented Sep 28, 2018

Maybe @deorder can help in the problem with only 8 characters for the passphrase. The code with this implementation was written from him. Where did you get the restriction of 8 from?

			case 'k':
			if(optarg) {
				param_set_string(0x154, 8, optarg);
			} else {
				param_get_string(0x154, 8);
			}

Yes I have to fix that apparently, sorry everyone. Will do it this weekend.

@Cruiser79
Copy link

Yes I have to fix that apparently, sorry everyone. Will do it this weekend.

Very nice. Please upload the binary of goke_p2pcam_param then here, so i can test it on my camera. It is still in lan mode and not connected to cloud but i will use wlan in future. So best testing environment.

@deorder
Copy link
Contributor

deorder commented Sep 29, 2018

The new binary and code are inside the attached archive, as follows:
goke-tools.tar.gz

Max SSID character length is now 32 according to specs and the max WiFi password character length is now 64.

@Cruiser79
Copy link

The new binary and code are inside the attached archive, as follows:
goke-tools.tar.gz

Max SSID character length is now 32 according to specs and the max WiFi password character length is now 64.

Ok, i am not getting the seg fault any more. Used the new goke-tool and edited the /home/wpa_supplicant.conf with my correct wlan settings. But on reboot i only here the voice to use the mobile phone app. Any ideas, what i can do?

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

Successfully merging this pull request may close these issues.

7 participants