You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried and succeeded after a lot of effort to install the v0.2.0 hacks on my Camera (model iSC5P).
What really blocked me at the beginning was that none of the methods described in the wikl was working, nor the QR code generated by the app. I tried to inspect the latter, but an opaque string at the end prevented me to replicate its algorithm.
I then inspected the js code here and realized that the Fang option was not working.
I am not so capable with javascript, but can python somehow. So I assembled the following script
# coding: utf-8importargparseimportbase64importrandomimportstringKEY="89JFSjo8HUbhou5776NJOMp9i90ghg7Y78G78t68899y79HY7g7y87y9ED45Ew30"defget_random_string(length):
# choose from all lowercase letterletters=string.ascii_letters+string.digits+"-_"return"".join(random.choice(letters) foriinrange(length))
defxor_strings(value, key):
c=""k_len=len(key)
foriinrange(len(value)):
c+=chr(ord(value[i]) ^ord(key[i%k_len]))
returnbytes(c, "ascii")
defbuild_string(ssid, password, tz):
rand=get_random_string(16)
b_ssid=base64.b64encode(bytes(ssid, "ascii")).decode("ascii")
b_secret=base64.b64encode(xor_strings(password, KEY)).decode("ascii")
returnf"b={rand}&s={b_ssid}&p={b_secret}&t={tz}"if__name__=="__main__":
parser=argparse.ArgumentParser(
prog="fang-code",
description="generate the string to be fed to the Xiaofang",
)
parser.add_argument("ssid")
parser.add_argument("password")
parser.add_argument("--tz", default="America/New York", help="Set the timezone")
args=parser.parse_args()
print(build_string(args.ssid, args.password, args.tz))
The help is clear
usage: fang-code [-h] [--tz TZ] ssid password
generate the string to be fed to the Xiaofang
positional arguments:
ssid
password
options:
-h, --help show this help message and exit
--tz TZ Set the timezone
Hi, and thanks for this!
I tried and succeeded after a lot of effort to install the v0.2.0 hacks on my Camera (model iSC5P).
What really blocked me at the beginning was that none of the methods described in the wikl was working, nor the QR code generated by the app. I tried to inspect the latter, but an opaque string at the end prevented me to replicate its algorithm.
I then inspected the js code here and realized that the Fang option was not working.
I am not so capable with javascript, but can python somehow. So I assembled the following script
The help is clear
To generate a QR code, I combine it with qrencode
Have a great day!
The text was updated successfully, but these errors were encountered: