Seguridad Wireless - Wifi

Equipos y materiales => Puntos de acceso, routers, switchs y bridges => Openwrt & LEDE => Mensaje iniciado por: anatulfo en 18-11-2013, 10:55 (Lunes)

Título: ( -- solucionado --) WRT160NL, problema U-boot + picocom + TFTP
Publicado por: anatulfo en 18-11-2013, 10:55 (Lunes)
Llevo una semana y no doy con la tecla.

Tengo un WRT160nl al que le instale la version "openwrt-ar71xx-wrt160nl-jffs2-factory.bin" descargada desde http://downloads.openwrt.org/backfire/10.03.1/.

Todo correcto hasta que probando cosas, luci dejo de funcionar.

Via telnet con putty cometi el error de que le borrre los datos de configuracion como si fuuese una version squashfs

- mtd -r erase rootfs_data.

El router se quedo con la luz parpadeando. BRICKED.

Le he conectado un cable USB TO DB9 . (Arkmicro Technologies Inc. ARK3116 Serial)

- RX (pc) al TX (router)
- TX (pc) al RX (router)

Con el GND conectado no sale nada por la terminal asi que no lo conecto (probado).

Compruebo que me reconozca el cable.

root@nokaid:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 6547:0232 Arkmicro Technologies Inc. ARK3116 Serial

Compruebo el puerto COM para utilizarlo.

root@nokaid:~# dmesg | grep tty
[    0.000000] console [tty0] enabled
[ 3530.137643] usb 3-3: ark3116 converter now attached to ttyUSB0

Como me estaba dando problemas con putty le cambio los permisos al directorio (todo esto como root)

- chmod 777 /dev/ttyUSB0

Abro una terminal serie com picocom

root@nokaid:~# picocom /dev/ttyUSB0 -b 115200
picocom v1.7

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        :
omap is        :
emap is        : crcrlf,delbs,

Terminal ready

 -----   Enciendo el router y esta es la salida de la terminal.
 
 
U-Boot 1.1.5 (Apr  6 2009 - 13:54:11)

DRAM:  ar7100_ddr_initial_config(237) enter!
ar7100_ddr_initial_config(269) exit!


U-Boot 1.1.5 (Apr  6 2009 - 13:54:11)

AP81 (ar7100) U-boot
sri
32 MB
WRT160NL u-boot version: 1.0.0
Top of RAM usable for U-Boot at: 82000000
Reserving 277k for U-Boot at: 81fb8000
Reserving 192k for malloc() at: 81f88000
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
Now running in RAM - U-Boot at: 81fb8000
id read 0x100000ff
flash size 8MB, sector count = 128
Flash:  8 MB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   ag7100_enet_initialize...
ag7100 get ethaddr for device eth0
Fetching MAC Address from 0x81feaf20

 --------***** Get the RTL8306SD Manufactory ID=34dc *****-------
 Reg6: speed=0 nway=1 duplex=1
 Reg5: speed=0 nway=0 duplex=0
 Reg1: a1=7fd9 a2=2890 a3=115c a4=2890 a5=0
 Reg1: a1=7fd9 a2=2890 a3=115c a4=2890
 Reg1: a1=7fd9 a2=2890 a3=115c a4=2890
 Reg1: a1=7fd9 a2=2890 a3=115c a4=2890
 Reg1: a1=7fd9 a2=2890 a3=115c a4=2890
eth0: 00:25:9c:3b:5a:41
eth0 up
eth0
### main_loop entered: bootdelay=1

Hit any key to stop autoboot:  0
## Booting image at bf04003c ...
   Image Name:   MIPS OpenWrt Linux-2.6.32.27
   Created:      2011-12-21   1:02:49 UTC
   Image Type:   MIPS Linux Kernel Image (gzip compressed)
   Data Size:    1242866 Bytes =  1.2 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
kernel: org len = 1242866, new len = 1245184
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 33554432

Starting kernel ...

Linux version 2.6.32.27 (jow@nd-build-02.linux-appliance.net) (gcc version 4.3.3 (GCC) ) #5 Wed Dec 21 01:59:33 CET 2011
bootconsole [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR9130 rev 2, CPU:400.000 MHz, AHB:200.000 MHz, DDR:400.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 board=WRT160NL
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
Memory: 29276k/32768k available (2126k kernel code, 3492k reserved, 423k data, 152k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:56
Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is Linksys WRT160NL
bio: create slab <bio-0> at 0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs Dec 10 2011 18:14:12 Installing.
msgmni has been set to 57
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: mx25l6405d (8192 Kbytes)
Searching for RedBoot partition table in spi0.0 at offset 0x7e0000
Searching for RedBoot partition table in spi0.0 at offset 0x7f0000
No RedBoot partition table detected in spi0.0
6 wrt160nl partitions found on MTD device spi0.0
Creating 6 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000170000 : "kernel"
0x000000170000-0x0000007e0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: no squashfs found in "spi0.0"
0x0000007e0000-0x0000007f0000 : "nvram"
0x0000007f0000-0x000000800000 : "art"
0x000000040000-0x0000007e0000 : "firmware"
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
Registering RTL8306SD switch with Chip ID: 0x5988, version: 0x0000
eth1: Atheros AG71xx at 0xba000000, irq 5
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: MTD device is not NAND it's type 3
VFS: Mounted root (jffs2 filesystem) readonly on device 31:2.
Freeing unused kernel memory: 152k freed
Please be patient, while OpenWrt loads ...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.



Por mas que lo intento con picocom, minicom, putty en linux debian, win wp.
No consigo parar el U-boot en  """Hit any key to stop autoboot:  0"""


Hay alguna otra forma iniciar la consola del router para subir el firm mediante tftp.

Gracias.




Título: Re: ( -- solucionado --) WRT160NL, problema U-boot + picocom + TFTP
Publicado por: anatulfo en 28-11-2013, 16:49 (Jueves)
Solucionado (Me respondo a mi mismo).

Eran los cables que utilizaba.

1 - Compre en ebay un cable  DKU-5 de Nokia (http://www.ebay.es/itm/111188415531?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649), y tras cortarlo e identificar el pinout del puerto POR-PORT,  con putty en windows xp solo me mostraba por pantalla los datos de inicio del router. En mi debian me reconocia el cable pero no me creaba ningun elace usb to serial (/dev/ttyUSB).

2 - Cable usb to serial DB9 que utilizaba para el  SATICOM (por probar). me mostraba los datos de inicio del router, me funcionaba ponerlo en "eco local" tanto en win como linux, pero no me paraba el U.boot del router. No lo he medido pero supongo que sera tema de voltaje.

3 - Cable de ebay USB To RS232 TTL UART PL2303H (http://www.ebay.es/itm/310676792112?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649). Perfecto. Eso si con el cable (Negro) de masa conectado salian caracteres raros y el de voltaje (rojo) medido con polimetro, es de 5V. El router necesita 3.3V. Solo le he conectado los cables de TX y RX al puerto serie + su trasformador. Seguir los pasos para parar el U-boot, y cargar un nuevo Firm mediante TFTP.

Todo esto por presuponer que el cable DKU-5 estaba bien y que el problema seria otro.

Gracias por el gran foro que teneis y que me he leido hasta la saciedad para encontrar una solucion a mi problema.
Título: Re: ( -- solucionado --) WRT160NL, problema U-boot + picocom + TFTP
Publicado por: jar229 en 29-11-2013, 09:38 (Viernes)
Gracias por postear la solución.

A veces los problemas están dónde menos lo imaginamos  ;D