Skip to content

Commit

Permalink
Merge branch 'master' into smart-link-py
Browse files Browse the repository at this point in the history
  • Loading branch information
kueblc committed Mar 23, 2019
2 parents 6329cb4 + 42cce77 commit 2309e03
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 55 deletions.
1 change: 0 additions & 1 deletion files/1.bin

This file was deleted.

Binary file removed files/esp8266-ota-flash-convert.ino-0x81000.bin
Binary file not shown.
Binary file removed files/esp8266-ota-flash-convert_upg.bin
Binary file not shown.
Binary file added files/upgrade.bin
Binary file not shown.
1 change: 0 additions & 1 deletion files/user2.bin

This file was deleted.

Binary file added files/user2.bin
Binary file not shown.
44 changes: 0 additions & 44 deletions scripts/backup.py

This file was deleted.

11 changes: 4 additions & 7 deletions scripts/fake-registration-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ def post(self):
b'{'
b'"schema":"[{'
b'\\"mode\\":\\"rw\\",'
b'\\"property\\":{\\"type\\":\\"bool\\"},\\"id\\":1,\\"type\\":\\"obj\\"},'
b'{\\"mode\\":\\"rw\\",'
b'\\"property\\":{\\"min\\":0,\\"max\\":86400,\\"scale\\":0,\\"step\\":1,\\"type\\":\\"value\\"},'
b'\\"id\\":9,\\"type\\":\\"obj\\"'
b'\\"property\\":{\\"type\\":\\"bool\\"},\\"id\\":1,\\"type\\":\\"obj\\"'
b'}]",'
b'"uid":"00000000000000000000","devEtag":"0000000000","secKey":"0000000000000000","schemaId":"0000000000","localKey":"0000000000000000"'
b'},'
Expand All @@ -81,9 +78,9 @@ def post(self):
print("Answer s.gw.upgrade")
#Fixme
#Calculate MD5 and Filesize
file_md5 = hashlib.md5(file_as_bytes(open('../files/1.bin', 'rb'))).hexdigest()
file_len = os.path.getsize('../files/1.bin')
answer = b'{"result":{"auto":3,"fileSize":"%d","etag":"0000000000","version":"9.0.0","url":"http://10.42.42.1/files/1.bin","md5":"%s"},"t":100,"e":false,"success":true}' % (file_len,file_md5.encode('utf-8'))
file_md5 = hashlib.md5(file_as_bytes(open('../files/upgrade.bin', 'rb'))).hexdigest()
file_len = os.path.getsize('../files/upgrade.bin')
answer = b'{"result":{"auto":3,"fileSize":"%d","etag":"0000000000","version":"9.0.0","url":"http://10.42.42.1/files/upgrade.bin","md5":"%s"},"t":100,"e":false,"success":true}' % (file_len,file_md5.encode('utf-8'))
print(answer)
self.set_header("Content-Type", "application/json;charset=UTF-8")
self.set_header('Content-Length', str(len(answer)))
Expand Down
7 changes: 4 additions & 3 deletions start_flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ echo "======================================================"
echo "Starting pairing procedure in screen"
sudo ip route add 255.255.255.255 dev $WLAN
$screen_with_log smarthack-smartconfig.log -S smarthack-smartconfig -m -d ./smartconfig/main.py

popd

echo "Waiting for the upgraded device to appear"
echo "If this does not work have a look at the '*.log'-files in the 'scripts' subfolder!"

Expand All @@ -72,9 +75,7 @@ echo
echo "IoT-device is online with ip 10.42.42.42"
echo "Fetching firmware backup"
sleep 2
./backup.py

popd
curl -JO http://10.42.42.42/backup

echo "======================================================"
echo "Getting Info from IoT-device"
Expand Down

0 comments on commit 2309e03

Please sign in to comment.