[ISSUE] Can't flash tinker OTA after CLI update

Since CLI v2.7+ we can’t flash devices with tinker OTA anymore. The usual “particle flash <device_name> tinker” command fails with “Cannot read property ‘map’ from undefined”. One machine still running CLI v2.5 is fine though. Any thoughts?

Any help please? Also:

Windows 10, 64-bit
Installed from https://docs.particle.io/tutorials/developer-tools/cli/
Fails in PowerShell and cmd.exe

PS C:\Users\steph> get-childitem ~\AppData\local\particle

Directory: C:\Users\steph\AppData\local\particle

Mode LastWriteTime Length Name


d----- 8/5/2020 13:31 .npm-cache
d----- 4/8/2020 08:28 bin
d----- 4/8/2020 08:29 node-v12.16.1-windows-x64
d----- 8/5/2020 13:31 node_modules
d----- 4/8/2020 08:29 tmp
-a---- 8/13/2020 15:14 52 autoupdate
-a---- 8/13/2020 15:14 64627 error.log
-a---- 8/5/2020 13:31 636427 package-lock.json
-a---- 8/5/2020 13:31 59 plugin-cache.json
-a---- 6/27/2018 08:34 358689 Uninstall.exe

just tested over here - Windows 10 (1909), x64.

PS C:\Users\me\projects\test> particle flash myargon tinker
attempting to flash firmware to your device myargon
Flash device OK: Update started

Flash success!

…same result when using a photon or electron - what type of device are you targeting? when you run the following in powershell: get-command particle - what do you get back?

in the meantime, it couldn’t hurt to manually reset as updates can sometimes go oddly:

I followed the reset instructions, but same result. There was just a bin folder and Uninstall.exe left before running the update-cli if that means anything.

Running get-command, I get the following:

PS C:\Users\steph\AppData\local\particle> get-command particle

CommandType Name Version Source


Application particle.exe 0.0.0.0 C:\Users\steph\AppData\Local\particle\bin\particle.exe

what type of device are you targeting?

photons.

do you have dfu-util installed?

get-command dfu-util

if that returns something, run dfu-util --version and share the output of both commands

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\steph> get-command dfu-util

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     dfu-util.exe                                       0.0.0.0    C:\Users\steph\AppData\Local\particle\bin\dfu-util.exe


PS C:\Users\steph> dfu-util --version
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

please run particle flash <your-device-name> tinker --verbose and share the complete error log

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\steph> particle flash ********* tinker --verbose
attempting to flash firmware to your device **********
Failed to flash ***********: Cannot read property 'map' of undefined
VError: Failed to flash ************: Cannot read property 'map' of undefined
    at createAPIErrorResult (C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\cmd\cloud.js:883:17)
    at C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\cmd\cloud.js:255:13
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async CLI.runCommand (C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js:160:7)
    at async CLI.run (C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js:190:14)
caused by: TypeError: Cannot read property 'map' of undefined
    at ParticleApi.flashDevice (C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\cmd\api.js:127:20)
    at C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\cmd\cloud.js:277:26
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async CLI.runCommand (C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js:160:7)
    at async CLI.run (C:\Users\steph\AppData\Local\particle\node_modules\particle-cli\dist\app\cli.js:190:14)

ah, ok. found it! thanks for your patience :pray:

it seems your device is a member of a product. i’ll get a fix together ASAP but in the meantime you can work around the problem by running:

particle cloud flash <device-id> tinker --product <product-id>

for more options & info, see:

particle cloud flash --help

That worked correctly. Fantastic. Thanks for your help.

1 Like

Oh, I also got a new message that the device was marked development. This device may have already been marked development, but is that a new change? Was it letting me know it was marked development, or will it mark the device development automatically going forward?

will it mark the device development automatically going forward?

yes, if the target device was already in development mode it’s essentially a no-op but it’ll still show the note just as a reminder

Nice. That’s really helpful considering all the times our manual flashes were immediately reverted. :slight_smile: Thanks again for the help.

1 Like

Just noticed v2.8.1 seems to fix the problem. Thanks again!

1 Like