5 years, 11 months ago.

Can't run mbed detect

Hello everyone,

Mbed is working properly in all its features excepting when I try the command:

$ mbed detect

And this is what I get:

Traceback (most recent call last):

File "/Users/bernadjo/Developer/device-toolkit-library/mbed-os/tools/detect_targets.py", line 77, in main muts = get_autodetected_MUTS_list()

File "/Users/bernadjo/Developer/device-toolkit-library/mbed-os/tools/test_api.py", line 1705, in get_autodetected_MUTS_list detect_muts_list = mbeds.list_mbeds()

File "/usr/local/lib/python2.7/site-packages/mbed_lstools/lstools_base.py", line 130, in list_mbeds candidates = list(self.find_candidates())

File "/usr/local/lib/python2.7/site-packages/mbed_lstools/darwin.py", line 109, in find_candidates mounts = self._mount_points()

File "/usr/local/lib/python2.7/site-packages/mbed_lstools/darwin.py", line 122, in _mount_points disks = plistlib.readPlist(diskutil_ls.stdout)

File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist rootObject = p.parse(pathOrFile)

File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse parser.ParseFile(fileobj)

ExpatError: not well-formed (invalid token): line 77, column 20

[ERROR] not well-formed (invalid token): line 77, column 20

[mbed] ERROR: Failed to correctly detect all targets (run with '-vv' for more information)

-

I've been researching about this issue a few days and I haven't found anything.

Thank you very much!

1 Answer

5 years, 11 months ago.

Hello Josep,

It seems that you are missing some python module. So can you download/clone the mbed-os from here:https://github.com/ARMmbed/mbed-os.git. Then, make sure that you are running python version 2.7.12+. Finally, execute these command:

commad line for installing the correct python modules

cd mbed-os
pip install -r requirements
source ./bashrc

After that you can try the code again

Thank you, Peter, Mbed Team

Hello Peter,

I appreciate your answer, but I'm still receiving the same error written above. I've installed the required modules, but nothing has changed.

Let me show you more details: macOS version: 10.13.5 (But I installed mbed-cli with 10.12 and I didn't work) mbed-cli version: 1.7.3 python version: 2.7.15 pip version: 10.0.1 $PATH: /Users/bernadjo/Library/Python/2.7/bin:/Users/bernadjo/Developer/mbed-os:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/opt/expat/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Do you need more information?

Thanks again, Josep Bernad

posted by Josep Bernad Espinosa 13 Jun 2018

Hello Josep, Can you add this two lines of code to your /.bash_profile? export PATH="/usr/local/bin:/usr/local/sbin:$PATH" export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"

After that, in your command terminal type: source /.bash_profile Give that a try and see what happen. If the problem still exist then can you post the output of this command: mbed detect -vv

Thank you, Peter

Team Mbed

posted by Peter Nguyen 14 Jun 2018