0

I don't actually need to debrick this WNR2000v3, I'm just trying to learn how to connect to an embedded device using a serial connection to see if I can do it.

I believe I have setup the wires so that they correspond to the following diagram (please let me know if I have not)...

Diagram from https://johanbijker.blogspot.com/2012/07/tp-link-mr3420-serial-connection-with.html

I found this in a blog about serial connecting to another router using minicom.

pi@raspberrypi:~$ sudo -i
root@raspberrypi:~# ps -ef | grep ttyAMA0
root       818     1  0 19:34 ttyAMA0  00:00:00 /sbin/getty -L ttyAMA0 115200 vt100
root       920   913  0 19:36 pts/0    00:00:00 grep ttyAMA0
root@raspberrypi:~# kill 818
root@raspberrypi:~# minicom -b 115200 -o -D /dev/ttyAMA0

Then it says to power on the router...

Found additional information about which pin was which on the UART of the router from this page:

WNR2000v3

The serial port is at JP1: 115200 8N1 at 3.3V. Pads are, from left to right with the ethernet ports on right: [Vcc] [Tx] [Rx] [GND]

Wiring Setup

When I used minicom I did receive a bit of output, but eventually it falls apart, and I'm unable (as far as I can tell) to communicate back to the serial terminal:

Welcome to minicom 2.7                                                                

OPTIONS: I18n                                                                         
Compiled on May  7 2017, 05:18:49.                                                    
Port /dev/ttyAMA0, 15:32:21                                                           

Press CTRL-A Z for help on special keys                                               



U-Boot 1.1.4-g98735ae5 (Mar 24 2011 - 15:19:45)                                       

WNR2000v3 (ar7241) U-boot dni17 V1.3                                                  
DRAM:                                                                                 
sri                                                                                   
ar7240_ddr_initial_config(138): virian ddr1 init                                      
#### TAP VALUE 1 = 0x2, 2 = 0x2 [0xadfe85da: 0xd6b9dbf9]                              
32 MB                                                                                 
Top of RAM usable for U-Boot at: 82000000                                             
Reserving 283k for U-Boot at: 81fb8000
Reserving 192k for m
                    Reserving 44 Bytes for Board Info at: 81f87fd4

                                                                  Reserving 36 Bytes for Global Data at:0

                                                                                                        0

                                                                                                        8


                                                                                                        f

                                                                                                        4

                                                                                                        B

                                                                                                        l

                                                                                                        l

                                                                                                        l

                                                                                                        h

                                                                                                        .

Is it possible the resister I'm using is too strong?

resistor

Or do I need to change something in my minicom settings?

Edit

Thanks to Joan's input about minicom, I'm now able to read:

U-Boot 1.1.4-g98735ae5 (Mar 24 2011 - 15:19:45)                           

WNR2000v3 (ar7241) U-boot dni17 V1.3                                      
DRAM:                                                                     
sri                                                                       
ar7240_ddr_initial_config(138): virian ddr1 init                          
#### TAP VALUE 1 = 0x2, 2 = 0x2 [0xadfa85da: 0xd6b9dbf9]                  
32 MB                                                                     
Top of RAM usable for U-Boot at: 82000000                                 
Reserving 283k for U-Boot at: 81fb8000
Reserving 192k for malloc() 
                            Reserving 44 Bytes for Board Info at: 81f87fd4

Reserving 36 Bytes for Global Data at: 81f87fb0                                       
                            Reserving 128k for boot params() at: 81f67fb0                                                                          

      Stack Pointer at: 81f67f98                                                


                                id read 0x100000ff                              

                                                  sector count = 64             

                                                                   Flash:  4 MB 

                                                                               In:    serial                                                                    
                                                                               Out:   serial                                                       
                                                       Err:   serial                                          

                                      Misc:  force GPIO1 output high            

                                                                    Net:   ag7240_enet_initialize...                                                            

                    Fetching MAC Address from 0x81fea470                        

                                                        Fetching MAC Address from 0x81fea470                                                                    

            Virian MDC CFG Value ==> 4                                          

                                      : cfg1 0xf cfg2 0x7014                    

                                                            eth0: 84:1b:5e:73:15:7d                                                                             

   eth0 up                                                                      

          Virian MDC CFG Value ==> 4                                            

                                    : cfg1 0xf cfg2 0x7214                      

                                                          eth1: 84:1b:5e:73:15:7c                                                                               

 ATHRS26: resetting s26                                                         

                       ATHRS26: s26 reset done                                  
                                              Trying eth1                       
                                                         eth1 link down         

                                                                       FAIL     

                                                                           Trying eth0                                                                          

      eth0 link down                                                            

                    FAIL                                                        




                        Retry count exceeded; boot the image as usual                                                                   
                        nmrp server is stopped or failed !                                                        

Although, I've edited the above to make it easier to read...it isn't coming in one character at a time, but it does seem to be displaying out of alignment.

I've also started receiving some sort of prompt, but I can't input into it, when I do the cursor starts flying across the screen...it looks like this:

Unknown command '^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G
^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G^G' - try 'help'






ar7240>    NTERRUPT>                                                                                            


                    Unknown command 'NTERRUPT>' - try 'help'                                                    

                                                            ar7240> ERRUPT>                                     


                                                                           Unknown command 'ERRUPT>' - try 'help'

                                                                                                                 ar7240> 


                                                                                                                         ar7240>  


                                                                                                                                  ar7240> 
leeand00
  • 704
  • 2
  • 9
  • 23
  • Is the pull-up on the RXD pin required by the device? I've not seen one used before. – joan Jun 23 '18 at 00:03
  • Following a 6 year old link (on an undisclosed model Pi - although it looks like a model B) is not a good idea. I am unsure what the resistor is supposed to achieve, but it will do no harm. What OS? Have you enabled serial? See [How-do-i-make-serial-work-on-the-raspberry-pi3](http://raspberrypi.stackexchange.com/a/45571/8697) – Milliways Jun 23 '18 at 00:28
  • @Milliways It's not a pi3 that I'm using. It's a Pi2. It's pretty old, I got it in a MAKER kit; can't you tell that from looking at the picture above? – leeand00 Jun 23 '18 at 02:18
  • @joan RXD? I believe it's marked in the OpenWRT documentation as just RX, I see RXD on the diagram from the blog post, but that's from another router...I just figured it was 3v3 volts like the other router; the WNR2000v3 is the one I'm using not that other one from the post. But I figured since they were both 3v3 it would work itself out. I thought that RXD was maybe how the input would get there since it's RX (receive on the router end and TX transmit on the Raspberry pi end) so if the resister is in place it would stop the signal if it resists too much. – leeand00 Jun 23 '18 at 02:22
  • 1
    The link is specifically about Pi3, but the information applies to recent Raspbian images. The picture you posted is **NOT** a Pi2 see [What OS version is installed](https://raspberrypi.stackexchange.com/questions/85015/what-os-version-is-installed) – Milliways Jun 23 '18 at 02:30
  • @Millways okay so it's probably a B+...2011.12 is on it there. – leeand00 Jun 23 '18 at 09:51

2 Answers2

1

It looks like you need to add a newline character.

In Minicom settings select Screen and Keyboard and then experiment with the Add linefeed and Line Wrap options.

joan
  • 67,803
  • 5
  • 67
  • 102
  • The first text that shows up on the screen seems to display correctly...I don't know why, but after that it does a appear to need some new line characters since it's displaying one character at a time after that.... – leeand00 Jun 23 '18 at 02:20
  • That helped a little bit, I can read some things I couldn't read before now, but it's still got some issues...things are being displayed just not consistently...it's as if someone added a bunch of random spaces to an otherwise perfectly fine text file. – leeand00 Jun 23 '18 at 11:59
  • I would remove that pull-up if possible. I do not understand why it's present. It might be powerful enough to scramble the received data. – joan Jun 23 '18 at 12:13
  • What's a pull-up? – leeand00 Jun 23 '18 at 12:27
  • Also I'm somewhat receiving a prompt with the name of the SoC `ar7240` is there some way I can use the information about what SoC it is to determine how I should configure `minicom`? – leeand00 Jun 23 '18 at 12:33
  • 1
    The pull-up is the resistor shown on the diagram between the Pi's 3V3 pin and the Pi's RXD pin. – joan Jun 23 '18 at 12:58
  • @joan: start bit is a high-to-low transition, and IIRC some older hardware (and marginal installations) needed a pullup to guarantee the receiver didn't "see" line glitches as start bits. AFAIK, that's pretty much deprecated now. – Seamus Jun 23 '18 at 21:37
1

It does not look like a layer-1 (hardware) problem.

The first problem I see is that for each newline it only does a linefeed. In the little that I have used minicom, this was a constant battle. You need to tell it to convert incoming nl to cr, nl.

nl = newline character. cr = carriage return character.

ctrl-alt-delor
  • 251
  • 1
  • 11
  • `nl` is that like `\n`? I believe that by `cr` you mean Carriage Return, is that correct? – leeand00 Jul 27 '18 at 16:13
  • 1
    Yes both correct – ctrl-alt-delor Jul 27 '18 at 16:18
  • Maybe this is it: https://unix.stackexchange.com/questions/283924/how-can-minicom-permanently-translate-incoming-newline-n-to-crlf – leeand00 Jul 27 '18 at 16:29
  • So that was part of it...when I added `pu addcarreturn Yes` (and made sure everything lined up correctly) to `$HOME/.minirc.dfl` I was able to obtain discernable input and a prompt, only trouble is the prompt kept pressing enter and it doesn't stop. – leeand00 May 20 '20 at 00:03
  • The saga continues here: https://forum.openwrt.org/t/debricking-wnr2000v3-with-raspberry-pi-and-a-serial-connection/64243 – leeand00 May 20 '20 at 00:31