# Lost device connectivity

**URL:** https://forum.legato.io/t/lost-device-connectivity/5998
**Category:** Uncategorized
**Created:** [October 13, 2021, 8:28pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998 "2021-10-13T20:28:36Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)
#### Post date: [October 13, 2021, 8:28pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/1 "2021-10-13T20:28:36Z")

</div>

Something went wrong while setting up the ssh key pair for a new WP76xx module per the instructions at [Login Authentication - Legato Docs](https://docs.legato.io/latest/howToLoginAuthentication.html). We got some error about a bad cipher after generating the keys, and are now getting the error **[root@192.168.2.2](mailto:root@192.168.2.2): Permission denied (publickey)** when trying to login. Trying to recover the target by using the instructions at [https://source.sierrawireless.com/resources/airprime/software/swiflash/#sthash.uVfepyV7.Qib3fBGQ.dpbs](https://source.sierrawireless.com/resources/airprime/software/swiflash/#sthash.uVfepyV7.Qib3fBGQ.dpbs) has no effect (even when we toggle the TP1 pin low). We seem completely locked out. Surely there’s some way to either factory reset these things or regain control in some other way? The cipher error message is below…

(lsh:wp76Profile1) dave-k@davek-HP-ProBook-640-G1:~/leafWS2$ configtargetssh  
Generating new key pair…  
Generating public/private rsa key pair.  
Enter passphrase (empty for no passphrase):  
Enter same passphrase again:  
Your identification has been saved in /home/dave-k/.ssh/id\_rsa.legatoTarget.  
Your public key has been saved in /home/dave-k/.ssh/id\_rsa.legatoTarget.pub.  
The key fingerprint is:  
SHA256:GR6BqeqbL9Du586Rpq3ObvlgwF40aRCinj8AhtwFrKw dave-k’s key for Legato target devices.  
The key’s randomart image is:  
±–[RSA 4096]----+  
|.oo… o. |  
|= o.o o . |  
|=o.\* . o |  
|=o+ o . + |  
|o\* o S |  
|E.\* . |  
| =o++ |  
| o\*Bo. |  
| =XXB |  
±—[SHA256]-----+

# Host 192.168.2.2 found: line 3

/home/dave-k/.ssh/known\_hosts updated.  
Original contents retained as /home/dave-k/.ssh/known\_hosts.old  
Adding the target to the list of known hosts.

# 192.168.2.2:22 SSH-2.0-dropbear\_2017.75

Connecting to the target… (ENTER TARGET’S ROOT PASSWORD WHENEVER PROMPTED FOR A PASSWORD)  
(Just hit ENTER if your target doesn’t have a root password.)  
/home/dave-k/.ssh/config line 10: Bad SSH2 cipher spec ‘aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc’.  
(lsh:wp76Profile1) dave-k@davek-HP-ProBook-640-G1:~/leafWS2$

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)
#### Post date: [October 13, 2021, 10:17pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/2 "2021-10-13T22:17:39Z")

</div>

You need to downgrade to R12 to do factory reset

> **[Wp76 root password](https://forum.sierrawireless.com/t/wp76-root-password/17645/3)**
>
> hi! i did it already but it still asks for password why it doesnt work? it should delete user partition but its not Thanks

---

<div class="post-metadata">

### Author: ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)
#### Post date: [October 14, 2021, 1:31pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/3 "2021-10-14T13:31:34Z")

</div>

Still getting the same “[root@192.168.2.2](mailto:root@192.168.2.2): Permission denied (publickey)” after installing R12 legato, the linux.cwe from the same package, then resetting the device partition, all using swiflash with the TP1 pin held low.

Surely there’s something that works to factory reset these things? What does Sierra expect people to do, throw out perfectly good hardware because it has some configuration issue? If so (and I can’t imagine why that would be so) I don’t understand why the target recovery page is still up. If not why they haven’t gotten around to fixing the broken recovery process after this length of time?

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)
#### Post date: [October 14, 2021, 1:43pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/4 "2021-10-14T13:43:56Z")

</div>

can you put some files in /home/root, and then run the swiflash in R12, and then make sure the user partition is erased and then the files in /home/root will disappear?

---

<div class="post-metadata">

### Author: ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)
#### Post date: [October 14, 2021, 3:24pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/5 "2021-10-14T15:24:32Z")

</div>

Not sure what you mean since I can’t connect to put files there. Do you mean rebuilding and reinstalling our application (using swiflash) with some test files included via one of the xdef files? Thanks…

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)
#### Post date: [October 14, 2021, 3:37pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/6 "2021-10-14T15:37:21Z")

</div>

Do you have uart concole?  
If yes, you can download some files to /home/root folder

To factory reset module, you need to do “swiflash -m WP76xx -r” in R12

---

<div class="post-metadata">

### Author: ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)
#### Post date: [October 14, 2021, 3:56pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/7 "2021-10-14T15:56:21Z")

</div>

That’s the command we’re using, with the -r option. Note it doesn’t actually work for us unless we specify the physical port for some reason as you can see below. I don’t know if the download failed message indicates a real error or not since as far as I understand it this process does not do a firmware download, essentially the error is just a timeout?

Also I’m not entirely sure what you mean about the UART console - do you mean one of the /dev/ttyUSB ports? Or /dev/ttyAT? Is there some legato doc you can point me to that shows how to use it? Thanks.

~/leafWS2/leaf-data/wp76Profile1/wp76-legato$ swiflash -m $LEGATO\_TARGET -r  
Detecting USB of the target  
No device connected

~/leafWS2/leaf-data/wp76Profile1/wp76-legato$ swiflash -m $LEGATO\_TARGET -r -p /dev/serial/by-path/pci-0000:00:14.0-usb-0:4:1.0-port0  
Detecting USB of the target  
DONE  
Communicating with the target  
DONE  
Switching to firmware download mode  
…DONE  
Downloading the firmware  
…ERROR: Firmware Download failed. Callback status 59399DONE  
ERROR: Firmware Download Failed

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)
#### Post date: [October 14, 2021, 4:04pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/8 "2021-10-14T16:04:59Z")

</div>

Uart console means the uart2 port of module.  
You need to first set at!mapuart=16,2

Have you tried the swiflash in windows platform?

---

<div class="post-metadata">

### Author: ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)
#### Post date: [October 14, 2021, 8:07pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/9 "2021-10-14T20:07:13Z")

</div>

Unfortunately we don’t have access to a UART console. Also swiflash in Windows doesn’t work any better than the linux version does (at this point after several months of nothing but constant wrestling with tools that don’t work and documentation that’s either out of date or just wrong I’d have been almost gobsmacked if it did). Some error about failing in the streaming download stage:

FDT version: 1.0.1702.1  
Awaiting suitable port or adapter …  
Downloading images …  
Writing image /  
Flashing image -  
Enabling selective suspend …  
Enabling selective suspend …  
Firmware download failed.  
Primary error code: 77 - Failed in streaming download stage.  
Secondary error code: 68 - Received incorrect response.  
Device error code: 0x0 - Unknown device error code.

Preexisting images information:  
Current:  
Firmware:  
ImageId:  
BuildId:  
Configuration:  
ImageId:  
BuildId:  
Final images information:  
Current:  
Firmware:  
ImageId:  
BuildId:  
Configuration:  
ImageId:  
BuildId:

OEM PRI:

IMEI:

Total time elapsed: 1812 ms.

Images downloaded:  
Image ID:  
Build ID:  
failed

Time to reset to application mode: -1 ms.

Anything else we can try? thanks.

---

<div class="post-metadata">

### Author: ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)
#### Post date: [October 14, 2021, 11:07pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/10 "2021-10-14T23:07:41Z")

</div>

You can try another module and see if this is just particular module problem

Btw, is the module really on r12?  
Does this problem exist in r9?

---

<div class="post-metadata">

### Author: ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)
#### Post date: [October 15, 2021, 8:27pm UTC](https://forum.legato.io/t/lost-device-connectivity/5998/11 "2021-10-15T20:27:18Z")

</div>

I’m pretty sure it was running R12 since I don’t recall seeing any error messages when we downgraded, although there is an error message when using swiflash with the -r option (see below). Anyway I tried with R9 and am getting the same result, with 2 different modules.

(lsh:wp76Profile1) dave-k@davek-HP-ProBook-640-G1:~/leafWS2/leaf-data/wp76Profile1/wp76-legato$ **swiflash -m $LEGATO\_TARGET -i ‘/home/dave-k/leafWS2/leaf-data/current/wp76-image/legato/legato.cwe’**  
Detecting USB of the target  
No device connected

(lsh:wp76Profile1) dave-k@davek-HP-ProBook-640-G1:~/leafWS2/leaf-data/wp76Profile1/wp76-legato$ **swiflash -m $LEGATO\_TARGET -i ‘/home/dave-k/leafWS2/leaf-data/current/wp76-image/legato/legato.cwe’ -p /dev/serial/by-path/pci-0000:00:14.0-usb-0:9:1.0-port0**  
Detecting USB of the target  
DONE  
Communicating with the target  
DONE  
Switching to firmware download mode  
…DONE  
Downloading the firmware  
…DONE  
Rebooting the module  
…DONE  
Firmware Download SUCCESS

(lsh:wp76Profile1) dave-k@davek-HP-ProBook-640-G1:~/leafWS2/leaf-data/wp76Profile1/wp76-legato$ **swiflash -m $LEGATO\_TARGET -r -p /dev/serial/by-path/pci-0000:00:14.0-usb-0:9:1.0-port0**  
Detecting USB of the target  
DONE  
Communicating with the target  
DONE  
Switching to firmware download mode  
…DONE  
Downloading the firmware  
…ERROR: Firmware Download failed. Callback status 59399DONE  
ERROR: Firmware Download Failed

dave-k@davek-HP-ProBook-640-G1:~$ **ssh [root@192.168.2.2](mailto:root@192.168.2.2)**  
[root@192.168.2.2](mailto:root@192.168.2.2): Permission denied (publickey).

Searching the **“59399DONE”** error it seems it may be an issue with the driver or setup on the host system: [How to flash new kernel to mangOH - #10 by nick - mangOH Green - mangOH forum](https://forum.mangoh.io/t/how-to-flash-new-kernel-to-mangoh/1293/10)

Unfortunately the only other linux box I have access to at the moment is a virtualbox one and I’m not sure swiflash has ever worked correctly on it. I’m going to have to try this on a different physical linux box when I get a chance in the next few days.
