Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/mk1 #10

Merged
merged 3 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Loading