st wifi flash is failing

This commit is contained in:
Firmware Batman
2017-07-30 08:49:53 -07:00
parent 991ad5be20
commit 8c4005ffdb
5 changed files with 39 additions and 16 deletions

View File

@@ -4,7 +4,7 @@
// WiFi password = 0x10 - 0x1C
// SHA1 checksum = 0x1C - 0x20
void get_provision_chunk(char *resp) {
void get_provision_chunk(uint8_t *resp) {
memcpy(resp, (void *)0x1fff79e0, PROVISION_CHUNK_LEN);
if (memcmp(resp, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0x20) == 0) {
memcpy(resp, "unprovisioned\x00\x00\x00testing123\x00\x00\xa3\xa6\x99\xec", 0x20);

View File

@@ -186,6 +186,18 @@ class Panda(object):
print("flash: resetting")
self.reset()
@staticmethod
def flash_ota_st():
ret = os.system("cd %s && make clean && make ota" % (os.path.join(BASEDIR, "board")))
time.sleep(1)
return ret==0
@staticmethod
def flash_ota_wifi():
ret = os.system("cd %s && make clean && make ota" % (os.path.join(BASEDIR, "boardesp")))
time.sleep(1)
return ret==0
@staticmethod
def recover(legacy=False):
ret = os.system("cd %s && make clean && make -f %s recover" % (os.path.join(BASEDIR, "board"), "Makefile.legacy" if legacy else "Makefile"))

View File

@@ -1,6 +1,8 @@
from __future__ import print_function
import os
from panda import Panda
from helpers import connect_wifi
import requests
def test_get_serial():
p = Panda()
@@ -14,16 +16,15 @@ def test_get_serial_in_flash_mode():
p.reset()
def test_connect_wifi():
p = Panda()
ssid, pw = p.get_serial()
ssid = ssid.strip("\x00")
assert(ssid.isalnum())
assert(pw.isalnum())
ssid = "panda-" + ssid
connect_wifi()
# Mac OS X only
# TODO: Ubuntu
os.system("networksetup -setairportnetwork en0 %s %s" % (ssid, pw))
def test_flash_wifi():
Panda.flash_ota_wifi()
connect_wifi()
def test_webpage_fetch():
r = requests.get("http://192.168.0.10/")
print(r.text)
assert "This is your comma.ai panda" in r.text

View File

@@ -1,15 +1,11 @@
from __future__ import print_function
import requests
import time
from panda import Panda
from helpers import time_many_sends
from nose.tools import timed, assert_equal, assert_less, assert_greater
def test_webpage_fetch():
r = requests.get("http://192.168.0.10/")
print(r.text)
assert "This is your comma.ai panda" in r.text
def test_wifi_flash_st():
Panda.flash_ota_st()
def test_get_serial_wifi():
p = Panda("WIFI")

View File

@@ -1,6 +1,7 @@
from panda import Panda
from nose.tools import timed, assert_equal, assert_less, assert_greater
import time
import os
def connect_wo_esp():
# connect to the panda
@@ -14,6 +15,18 @@ def connect_wo_esp():
while len(p.can_recv()) > 0:
pass
def connect_wifi():
p = Panda()
ssid, pw = p.get_serial()
ssid = ssid.strip("\x00")
assert(ssid.isalnum())
assert(pw.isalnum())
ssid = "panda-" + ssid
# Mac OS X only
# TODO: Ubuntu
os.system("networksetup -setairportnetwork en0 %s %s" % (ssid, pw))
def time_many_sends(p, bus):
MSG_COUNT = 100
@@ -34,3 +47,4 @@ def time_many_sends(p, bus):
comp_kbps = (1+11+1+1+1+4+8*8+15+1+1+1+7)*MSG_COUNT / et
return comp_kbps