Skip to content

Commit

Permalink
Merge pull request #10 from OpenVoiceOS/feat/mk1
Browse files Browse the repository at this point in the history
Feat/mk1
  • Loading branch information
builderjer authored Jan 11, 2025
2 parents 002750f + 20cc348 commit d3ad6b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ Currently you can get detection results for the following devices
* `is_respeaker_6mic`
* Adafruit audio amp (https://www.adafruit.com/product/1752)
* `is_adafruit_amp`
+ Mycroft Mark 1 device
+ `is_mark_1`
15 changes: 11 additions & 4 deletions ovos_i2c_detection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import subprocess
import serial
from time import sleep
from ovos_utils.log import LOG

def is_texas_tas5806():
cmd = 'i2cdetect -y -a 1 0x2f 0x2f | egrep "(2f|UU)" | awk \'{print $2}\''
Expand Down Expand Up @@ -58,17 +59,23 @@ def is_adafruit_amp():
def is_mark_1():
if is_wm8960():
try:
ser = serial.Serial("/dev/serial0", 9600, timeout=3)
ser = serial.Serial("/dev/ttyAMA0", 9600, timeout=5)
ser.write(b'system.version')
while True:
while ser.is_open:
is_mk1 = ser.readline().decode().rstrip()
if is_mk1 and "Command" in is_mk1:
# Check for a version
mk1_ver = ser.readline().decode().rstrip()
# New versions of the firmware will return a version that needs read to continue
if mk1_ver:
LOG.debug(f"Firmware version {mk1_ver}")
ser.close()
# This is a Mark 1
return True
break
ser.close()
ser.close()
return False
except:
except Exception as e:
LOG.error(e)
return False

0 comments on commit d3ad6b1

Please sign in to comment.