Hi Chris,
Ops... i did missed the FS_NMGR config, thanks. Now the FS command works for download. When i try to upload the same file back it just got stuck at "Reading from data channel" as shown in the log below. newtmgr -c myserial fs upload test.txt /cfg/test.txt -ldebug >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 2017/04/29 09:31:51 [DEBUG] Writing newtmgr request &{Op:2 Flags:0 Len:7 Group:0 Seq:0 Id:1 Data:[161 100 101 99 104 111 0]} 2017/04/29 09:31:51 [DEBUG] Serializing request &{Op:2 Flags:0 Len:7 Group:0 Seq:0 Id:1 Data:[161 100 101 99 104 111 0]} into buffer [2 0 0 7 0 0 0 1 161 100 101 99 104 111 0] 2017/04/29 09:31:51 [DEBUG] Tx packet dump: 00000000 02 00 00 07 00 00 00 01 a1 64 65 63 68 6f 00 |.........decho.| 2017/04/29 09:31:51 [DEBUG] Writing [6 9] to data channel 2017/04/29 09:31:51 [DEBUG] Writing [65 66 69 67 65 65 65 72 65 65 65 65 65 97 70 107 90 87 78 111 98 119 68 51 122 81 61 61] to data channel 2017/04/29 09:31:51 [DEBUG] Writing [10] to data channel 2017/04/29 09:31:51 [DEBUG] Reading [] from data channel 2017/04/29 09:31:51 [DEBUG] Reading [6 9 65 65 119 68 65 65 65 67 65 65 65 65 65 98 47 47 57 116 56 61] from data channel 2017/04/29 09:31:51 [DEBUG] Rx packet dump: 00000000 03 00 00 02 00 00 00 01 bf ff |..........| 2017/04/29 09:31:51 [DEBUG] Deserialized response &{Op:3 Flags:0 Len:2 Group:0 Seq:0 Id:1 Data:[191 255]} 2017/04/29 09:31:51 [DEBUG] Writing newtmgr request &{Op:2 Flags:0 Len:39 Group:8 Seq:0 Id:0 Data:[164 100 100 97 116 97 67 49 50 51 99 108 101 110 22 100 110 97 109 101 109 47 99 102 103 47 116 101 115 116 46 116 120 116 99 111 102 102 0]} 2017/04/29 09:31:51 [DEBUG] Serializing request &{Op:2 Flags:0 Len:39 Group:8 Seq:0 Id:0 Data:[164 100 100 97 116 97 67 49 50 51 99 108 101 110 22 100 110 97 109 101 109 47 99 102 103 47 116 101 115 116 46 116 120 116 99 111 102 102 0]} into buffer [2 0 0 39 0 8 0 0 164 100 100 97 116 97 67 49 50 51 99 108 101 110 22 100 110 97 109 101 109 47 99 102 103 47 116 101 115 116 46 116 120 116 99 111 102 102 0] 2017/04/29 09:31:51 [DEBUG] Tx packet dump: 00000000 02 00 00 27 00 08 00 00 a4 64 64 61 74 61 43 31 |...'.....ddataC1| 00000010 32 33 63 6c 65 6e 16 64 6e 61 6d 65 6d 2f 63 66 |23clen.dnamem/cf| 00000020 67 2f 74 65 73 74 2e 74 78 74 63 6f 66 66 00 |g/test.txtcoff.| 2017/04/29 09:31:51 [DEBUG] Writing [6 9] to data channel 2017/04/29 09:31:51 [DEBUG] Writing [65 68 69 67 65 65 65 110 65 65 103 65 65 75 82 107 90 71 70 48 89 85 77 120 77 106 78 106 98 71 86 117 70 109 82 117 89 87 49 108 98 83 57 106 90 109 99 118 100 71 86 122 100 67 53 48 101 72 82 106 98 50 90 109 65 65 78 83] to data channel 2017/04/29 09:31:51 [DEBUG] Writing [10] to data channel 2017/04/29 09:31:51 [DEBUG] Reading [48 48 56 48 57 50 32 85 110 104 97 110 100 108 101 100 32 105 110 116 101 114 114 117 112 116 32 40 51 41 44 32 101 120 99 101 112 116 105 111 110 32 115 112 32 48 120 50 48 48 48 48 56 100 56] from data channel 2017/04/29 09:31:51 [DEBUG] Reading [48 48 56 48 57 50 32 32 114 48 58 48 120 50 48 48 48 48 101 56 52 32 32 114 49 58 48 120 48 48 48 48 48 48 48 48 32 32 114 50 58 48 120 48 48 48 48 48 48 49 54 32 32 114 51 58 48 120 48 48 48 48 48 56 48 48] from data channel 2017/04/29 09:31:51 [DEBUG] Reading [48 48 56 48 57 50 32 32 114 52 58 48 120 50 48 48 48 48 101 56 52 32 32 114 53 58 48 120 50 48 48 48 48 57 102 56 32 32 114 54 58 48 120 50 48 48 48 50 57 97 52 32 32 114 55 58 48 120 48 48 48 48 48 52 48 48] from data channel 2017/04/29 09:31:51 [DEBUG] Reading [48 48 56 48 57 50 32 32 114 56 58 48 120 48 48 48 50 53 51 49 100 32 32 114 57 58 48 120 50 48 48 48 48 102 99 48 32 114 49 48 58 48 120 48 48 48 50 57 54 101 48 32 114 49 49 58 48 120 48 48 48 48 48 48 50 102] from data channel 2017/04/29 09:31:51 [DEBUG] Reading [48 48 56 48 57 50 32 114 49 50 58 48 120 48 48 48 48 48 48 48 48 32 32 108 114 58 48 120 48 48 48 48 56 56 57 98 32 32 112 99 58 48 120 48 48 48 48 48 56 48 48 32 112 115 114 58 48 120 52 48 48 48 48 48 48 48] from data channel 2017/04/29 09:31:51 [DEBUG] Reading [48 48 56 48 57 50 32 73 67 83 82 58 48 120 48 48 52 50 49 56 48 51 32 72 70 83 82 58 48 120 52 48 48 48 48 48 48 48 32 67 70 83 82 58 48 120 48 48 48 50 48 48 48 48] from data channel 2017/04/29 09:31:51 [DEBUG] Reading [48 48 56 48 57 50 32 66 70 65 82 58 48 120 101 48 48 48 101 100 51 56 32 77 77 70 65 82 58 48 120 101 48 48 48 101 100 51 52] from data channel >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> The Config command is still not working though, i still get the same response a before for both set & get config value. Best Regards, Chew ________________________________ From: Christopher Collins <ch...@runtime.io> Sent: Saturday, 29 April, 2017 1:40:38 AM To: dev@mynewt.incubator.apache.org Subject: Re: Config & FS command not working on newtmgr Hi Lm, The device is reporting a newtmgr error of 5, which corresponds to MGMT_ERR_ENOENT (Yes, we need better error reporting!). This means the device doesn't recognize the newtmgr command you sent it. Did you enable file system newtmgr support? The syscfg setting "FS_NMGR" has to be set to 1. You can see the value of this setting with the "newt target config show <target>" command. Chris On Fri, Apr 28, 2017 at 05:00:27PM +0000, Lm Chew wrote: > Hi, > > > 1. When i try to download a file i created on the device, i get the following > error when newtmgr crashes: > > > newtmgr -c myserial fs download /cfg/test.txt test.txt -ldebug > > >>>>>>>>>>>>>>>>>>>>>>>>>>>> > 2017/04/29 00:32:58 [DEBUG] Writing newtmgr request &{Op:0 Flags:0 Len:25 > Group:8 Seq:0 Id:0 Data:[162 100 110 97 109 101 109 47 99 102 103 47 116 101 > 115 116 46 116 120 116 99 111 102 102 0]} > 2017/04/29 00:32:58 [DEBUG] Serializing request &{Op:0 Flags:0 Len:25 Group:8 > Seq:0 Id:0 Data:[162 100 110 97 109 101 109 47 99 102 103 47 116 101 115 116 > 46 116 120 116 99 111 102 102 0]} into buffer [0 0 0 25 0 8 0 0 162 100 110 > 97 109 101 109 47 99 102 103 47 116 101 115 116 46 116 120 116 99 111 102 102 > 0] > 2017/04/29 00:32:58 [DEBUG] Tx packet dump: > 00000000 00 00 00 19 00 08 00 00 a2 64 6e 61 6d 65 6d 2f |.........dnamem/| > 00000010 63 66 67 2f 74 65 73 74 2e 74 78 74 63 6f 66 66 |cfg/test.txtcoff| > 00000020 00 |.| > > 2017/04/29 00:32:58 [DEBUG] Writing [6 9] to data channel > 2017/04/29 00:32:58 [DEBUG] Writing [65 67 77 65 65 65 65 90 65 65 103 65 65 > 75 74 107 98 109 70 116 90 87 48 118 89 50 90 110 76 51 82 108 99 51 81 117 > 100 72 104 48 89 50 57 109 90 103 66 78 111 65 61 61] to data channel > 2017/04/29 00:32:58 [DEBUG] Writing [10] to data channel > 2017/04/29 00:32:58 [DEBUG] Reading [] from data channel > 2017/04/29 00:32:58 [DEBUG] Reading [6 9 65 66 65 66 65 65 65 71 65 65 103 65 > 65 76 57 105 99 109 77 70 47 48 121 53] from data channel > 2017/04/29 00:32:58 [DEBUG] Rx packet dump: > 00000000 01 00 00 06 00 08 00 00 bf 62 72 63 05 ff |.........brc..| > > 2017/04/29 00:32:58 [DEBUG] Deserialized response &{Op:1 Flags:0 Len:6 > Group:8 Seq:0 Id:0 Data:[191 98 114 99 5 255]} > 2017/04/29 00:32:58 [DEBUG] goroutine 1 [running]: > mynewt.apache.org/newt/newtmgr/vendor/mynewt.apache.org/newt/util.NewNewtError(0xc820136ce0, > 0xf, 0xc820133a60) > /home/dev/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:75 > +0x103 > mynewt.apache.org/newt/newtmgr/protocol.DecodeFileDownloadResponse(0xc820136c70, > 0x6, 0x8, 0x0, 0x0, 0x0) > /home/dev/dev/go/src/mynewt.apache.org/newt/newtmgr/protocol/fsdownload.go:90 > +0x424 > mynewt.apache.org/newt/newtmgr/cli.fsDownloadCmd(0xc8201258c0, 0xc82001ac80, > 0x2, 0x5) > /home/dev/dev/go/src/mynewt.apache.org/newt/newtmgr/cli/fs.go:161 +0x715 > mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra.(*Command).execute(0xc8201258c0, > 0xc82001ac30, 0x5, 0x5, 0x0, 0x0) > /home/dev/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra/command.go:636 > +0x8e9 > mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc820124240, > 0xc8201258c0, 0x0, 0x0) > /home/dev/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra/command.go:722 > +0x55c > mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra.(*Command).Execute(0xc820124240, > 0x0, 0x0) > /home/dev/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra/command.go:681 > +0x2d > main.main() > /home/dev/dev/go/src/mynewt.apache.org/newt/newtmgr/newtmgr.go:25 +0x25 > > goroutine 17 [syscall, locked to thread]: > runtime.goexit() > /usr/lib/go-1.6/src/runtime/asm_amd64.s:1998 +0x1 > > goroutine 5 [syscall]: > os/signal.signal_recv(0x0) > /usr/lib/go-1.6/src/runtime/sigqueue.go:116 +0x132 > os/signal.loop() > /usr/lib/go-1.6/src/os/signal/signal_unix.go:22 +0x18 > created by os/signal.init.1 > /usr/lib/go-1.6/src/os/signal/signal_unix.go:28 +0x37 > > Error: Target error: 5 > >>>>>>>>>>>>>>>>>>>>>>>>>>>> > > 2. When i try to write a config to /cfg/run i get the following response: > > newtmgr -c myserial config testing "123" -ldebug > > > >>>>>>>>>>>>>>>>>>>>>>>>>>>> > > 2017/04/29 00:33:36 [DEBUG] Writing newtmgr request &{Op:2 Flags:0 Len:22 > Group:3 Seq:0 Id:0 Data:[162 100 110 97 109 101 103 116 101 115 116 105 110 > 103 99 118 97 108 99 49 50 51]} > 2017/04/29 00:33:36 [DEBUG] Serializing request &{Op:2 Flags:0 Len:22 Group:3 > Seq:0 Id:0 Data:[162 100 110 97 109 101 103 116 101 115 116 105 110 103 99 > 118 97 108 99 49 50 51]} into buffer [2 0 0 22 0 3 0 0 162 100 110 97 109 101 > 103 116 101 115 116 105 110 103 99 118 97 108 99 49 50 51] > 2017/04/29 00:33:36 [DEBUG] Tx packet dump: > 00000000 02 00 00 16 00 03 00 00 a2 64 6e 61 6d 65 67 74 |.........dnamegt| > 00000010 65 73 74 69 6e 67 63 76 61 6c 63 31 32 33 |estingcvalc123| > > 2017/04/29 00:33:36 [DEBUG] Writing [6 9] to data channel > 2017/04/29 00:33:36 [DEBUG] Writing [65 67 65 67 65 65 65 87 65 65 77 65 65 > 75 74 107 98 109 70 116 90 87 100 48 90 88 78 48 97 87 53 110 89 51 90 104 98 > 71 77 120 77 106 79 109 116 81 61 61] to data channel > 2017/04/29 00:33:36 [DEBUG] Writing [10] to data channel > 2017/04/29 00:33:36 [DEBUG] Reading [] from data channel > 2017/04/29 00:33:36 [DEBUG] Reading [6 9 65 66 65 68 65 65 65 71 65 65 77 65 > 65 76 57 105 99 109 77 68 47 120 82 109] from data channel > 2017/04/29 00:33:36 [DEBUG] Rx packet dump: > 00000000 03 00 00 06 00 03 00 00 bf 62 72 63 03 ff |.........brc..| > > 2017/04/29 00:33:36 [DEBUG] Deserialized response &{Op:3 Flags:0 Len:6 > Group:3 Seq:0 Id:0 Data:[191 98 114 99 3 255]} > >>>>>>>>>>>>>>>>>>>>>>>>>>>> > > > 3. When i try to read a config from /cfg/run i get the following response: > > newtmgr -c myserial config testing -ldebug > > >>>>>>>>>>>>>>>>>>>>>>>>>>>> > 2017/04/29 00:33:52 [DEBUG] Writing newtmgr request &{Op:0 Flags:0 Len:14 > Group:3 Seq:0 Id:0 Data:[161 100 110 97 109 101 103 116 101 115 116 105 110 > 103]} > 2017/04/29 00:33:52 [DEBUG] Serializing request &{Op:0 Flags:0 Len:14 Group:3 > Seq:0 Id:0 Data:[161 100 110 97 109 101 103 116 101 115 116 105 110 103]} > into buffer [0 0 0 14 0 3 0 0 161 100 110 97 109 101 103 116 101 115 116 105 > 110 103] > 2017/04/29 00:33:52 [DEBUG] Tx packet dump: > 00000000 00 00 00 0e 00 03 00 00 a1 64 6e 61 6d 65 67 74 |.........dnamegt| > 00000010 65 73 74 69 6e 67 |esting| > > 2017/04/29 00:33:52 [DEBUG] Writing [6 9] to data channel > 2017/04/29 00:33:52 [DEBUG] Writing [65 66 103 65 65 65 65 79 65 65 77 65 65 > 75 70 107 98 109 70 116 90 87 100 48 90 88 78 48 97 87 53 110 66 116 103 61] > to data channel > 2017/04/29 00:33:52 [DEBUG] Writing [10] to data channel > 2017/04/29 00:33:52 [DEBUG] Reading [] from data channel > 2017/04/29 00:33:52 [DEBUG] Reading [6 9 65 66 65 66 65 65 65 71 65 65 77 65 > 65 76 57 105 99 109 77 68 47 43 75 107] from data channel > 2017/04/29 00:33:52 [DEBUG] Rx packet dump: > 00000000 01 00 00 06 00 03 00 00 bf 62 72 63 03 ff |.........brc..| > > 2017/04/29 00:33:52 [DEBUG] Deserialized response &{Op:1 Flags:0 Len:6 > Group:3 Seq:0 Id:0 Data:[191 98 114 99 3 255]} > >>>>>>>>>>>>>>>>>>>>>>>>>>>> > > > I have enable the following in the syscfg.yml of my app > > CONFIG_NFFS: 1 > CONFIG_NEWTMGR: 1 > > > Best Regards, > > Chew