Commit 52daf443 authored by Nelso Jost's avatar Nelso Jost

NEW: simple hack to get user board hash

parent 7facc3b9
......@@ -74,7 +74,7 @@ check-venv:
printf "Python binary other than 'python3', like\n'python-3.x' ";\
printf "(where x is a number) for instance. \n\n"; exit 1; }
firmware: ${BUILDWITH}-install
firmware:
chmod +x scripts/ino-build.sh
./scripts/ino-build.sh ${BUILDWITH} ${INODIR} ${ARDUINOPATH}
......@@ -87,6 +87,9 @@ pyserial: check-venv
syncrtc:
${VENVPY} scripts/init_serial.py --syncrtc
boardhash:
${VENVPY} scripts/getboardhash.py
run: check-venv
${VENVPY} logger/run.py
......
from requests import post
from getpass import getpass
URL = 'http://dados.cta.if.ufrgs.br/emm/api/get/boardhash'
board_id = input('Board ID: ')
user_password = getpass('Password: ')
r = post(URL, json={'board_id': board_id,
'user_password': user_password})
try:
js = r.json()
if 'Error' in js:
raise Exception
filename = input('Filename: ')
with open(filename, 'w') as f:
f.write(js['board_hash'])
except Exception as e:
print(e)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment