Shop OBEX P1 Docs P2 Docs Learn Events
WiFi & IOT for home controllers/monitors using WR703N $20 routers and xx-WRT - Page 11 — Parallax Forums

WiFi & IOT for home controllers/monitors using WR703N $20 routers and xx-WRT

18911131419

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-26 04:35
    Didnt get to try anything today :)
    still catching up with friends after being away for so long.

    thats interesting that mips can do eithrr endian. i havenever looked at the mips processors.

    heater, i tried wget friday, but it failed to my website with no http or ftp connection available.
    however, i found out how to determine my ip address. i have setup a no-ip.net ddns link but currently i cannot get past the router. need to do a bit more reading.
  • Mike CookMike Cook Posts: 829
    edited 2014-07-26 04:41
    Well first success I was able to load OpenWRT without a hitch.

    I’m doing two new things here:
    1. Trying to learn Linux, Kubuntu
    2. Loading OpenWRT on a WR703N

    My WR703N arrived with a Chinese firmware load, I assume most do. I think the original firmware loaded was 3.15.2 build 130321 Rel 37153N. The sticker on the outside of the router indicated v1.6

    I started with this web page http://wiki.openwrt.org/toh/tp-link/tl-wr703n downloaded squashfs-factory.bin to a USB stick, then renamed the file to factory.bin.

    Then from the above link went to: http://cmikavac.net/2012/06/03/how-to-flash-tp-link-wr703n-with-openwrt/ to flash the router.

    I connected my Kubuntu laptop via Cat5 cable to the WR703N, followed these instructions http://www.howtoforge.com/linux-basics-set-a-static-ip-on-ubuntu to give the laptop a static IP.

    Since the web address listed in step 5, of the instructions, did not work I had to follow the screen shots located at http://wiki.cementhorizon.com/display/CH/Installing+OpenWRT+on+the+TP-Link+WR703N+v1.6 After the router rebooted, the web browser refreshed and displayed: OpenWrt | OpenWrt Attitude Adjustment 12.09 |Load 0.15.0.42 0.23

    Then I confirmed that I could telnet into it, from a terminal window (I call it a command prompt, sorry DOS/Windows guy here) I was able to issue telnet 192.168.1.1 and get the QpenWrt Shell screen.


    From here I’m going to poke around a bit before going further and maybe do the serial interface mod. Might order another WR703N, these things are tiny!
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 04:55
    Cluso,


    I just did that WIFI enable and setup thing in Luci again and it went without a hitch. I really am now suspecting the problem was that I filled up the file system.


    I was about to get a PIC32, just because I had never used a MIPS machine before. Little did I know I already had two MIPS machines.


    big or little endian has an impact on performance when networking. All to do with the ordering of bytes as they come down the pipe. So called "network byte order". I forget which way round it is or whether big or little endian is better for the CPU there.


    That's odd about wget. If you can surf the net through that router then wget from the router should work.


    Mike,


    Wow, you have taken on a lot there. Looks like it's going well for you though.
  • Mike CookMike Cook Posts: 829
    edited 2014-07-26 05:34
    Heater. – Thanks! Not a total noob to Linux but, but dangerous enough to do lots of damage! One reason I’m using a laptop that I can blow away and re load if I need to.

    I was able to use the web interface; I believe its referred to as LuCI, to configure the WR703N as a client on my Wi-Fi network. My main router connected to the internet is a WRT54G running DD-WRT, it’s been bullet proof for years.

    Ya’ll have sparked my interest in trying to load the propeller with one of these routers. Once that’s accomplished using a PropPlug I hope it can be accomplished without the need for the PropPlug and you can load the Propeller that’s directly attached to the router.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 05:42
    @Mike Cook
    Welcome.. the more the merrier.

    In theory, the WR703N could replace a PropPlug as a wireless Propeller programming interface. So the $20USD could be very well spent. We just have to get the GPIO to Reset working.

    +++++++++++++++++
    Cluso and Mike Cook
    Here is an interesting link for the wifi hardware involved. It seems that the configuration of Antheros and the MAC80211 requires some special handling. The link does NOT apply to Heaters DIR-615 with Ralink.

    http://wiki.openwrt.org/doc/recipes/atheroswds
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 05:51
    Mike,

    I'm itching to see if the propeller-loader I posted in #293 runs for anyone out there.

    That loader already has some code in it to use a GPIO pin as a Prop reset so we should be able to use a UART on a router soon. It's needs some further massaging.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 05:55
    @Heater
    I just have to do a lsmod check for an FTDI driver and then load your binary to see if the USB port to USB2SER (or PropPlug) to Propeller is good.

    But I am moving slow today. (I need time to read all the OpenWRT material that I don't quite understand.)
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 06:06
    Loopy,

    Ahhhggg...never mind all that dorky reading business and who cares if the USB/serial works?...I just want to know if the binary runs at all! :)
  • Mike CookMike Cook Posts: 829
    edited 2014-07-26 07:19
    Heater. - after a fair amount of fumbling around I got the following:
    root@OpenWrt:/tmp# ./propeller-load
    usage: propeller-load
             [ -b <type> ]     select target board (default is 'default:default')
             [ -p <port> ]     serial port (default is to auto-detect the port)
             [ -P ]            list serial ports with Propeller chips
             [ -Q ]            list available serial ports
             [ -I <path> ]     add a directory to the include path
             [ -D var=value ]  define a board configuration variable
             [ -e ]            write the program into EEPROM
             [ -r ]            run the program after loading
             [ -g ]            set up the program for debugging after loading
             [ -s ]            write a spin .binary file for use with the Propeller Tool
             [ -x ]            write a .pex binary file for use with the SD loader or SD cache
             [ -l ]            write a program to the sd card and use the SD loader
             [ -z ]            write a program to the sd card and use the SD cache
             [ -f ]            write a file to the SD card
             [ -t ]            enter terminal mode after running the program
             [ -t<baud> ]      enter terminal mode with a different baud rate
             [ -q ]            quit on the exit sequence (0xff, 0x00, status)
             [ -v ]            verbose output
             [ -S ]            slow down the loader by adding 5 microseconds delay
             [ -S<n> ]         slow down the loader by adding <n> microseconds delay
             [ -? ]            display a usage message and exit
             <name>            elf or spin binary file to load
     
    Target board type can be either a single identifier like 'propboe' in which case the subtype defaults to 'default' or it can be of the form <type>:<subtype> like 'c3:ram'.
     
    Variables that can be set with -D are:
      clkfreq clkmode baudrate reset rxpin txpin tvpin
      cache-driver cache-size cache-param1 cache-param2
      sd-driver sdspi-do sdspi-clk sdspi-di sdspi-cs
      sdspi-clr sdspi-inc sdspi-start sdspi-width spdspi-addr
      sdspi-config1 sdspi-config2 eeprom-first
     
    Value expressions for -D can include:
      rcfast rcslow xinput xtal1 xtal2 xtal3 pll1x pll2x pll4x pll8x pll16x k m mhz true false
      an integer or two operands with a binary operator + - * / % & | or unary + or -
      all operators have the same precedence
     
    The -b option defaults to the value of the environment variable PROPELLER_LOAD_BOARD.
    The -p option defaults to the value of the environment variable PROPELLER_LOAD_PORT if it is set. If not the port will be auto-detected.
     
    The 'sd loader' loads AUTORUN.PEX from an SD card into external memory.
    It requires a board with either external RAM or ROM.
     
    The 'sd cache' arranges to run AUTORUN.PEX directly from the SD card.
    It can be used on any board with an SD card slot.
    root@OpenWrt:/tmp# 
    
    
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 07:34
    Ohhh riiight! Thanks Mike.

    Now I'm inspired for the next part.

    The loader I'm hacking on can use GPIO but it is fixed to GPIO number 17 which is what we have been using on the Raspberry Pi.

    Who knows what GPIO number people will want to use on their routers? So this needs a bit more configuration option tweaking.

    Also I have to drag in all the other junk the loader uses to Program all kind of boards with external RAM/FLASH/SDcards when used with C.

    Anyone had any luck getting a PropPlug recognized on their router yet? My D-LINK does not have USB ports.
  • Mike CookMike Cook Posts: 829
    edited 2014-07-26 07:46
    I have a Propeller activity board connected via the USB on the router to the USB port on the Activity board, don't know if this is correct or not, but not getting anything from -Q or -P
    root@OpenWrt:~# cd /
    root@OpenWrt:/# ls
    bin             mnt             rom             tmp
    dev             overlay         root            usr
    etc             proc            sbin            var
    lib             propeller-load  sys             www
    root@OpenWrt:/# ./propeller-load -P
    root@OpenWrt:/# ./propeller-load -Q
    root@OpenWrt:/# 
    
    
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 07:47
    Heater. wrote: »
    Loopy,

    Ahhhggg...never mind all that dorky reading business and who cares if the USB/serial works?...I just want to know if the binary runs at all! :)

    Okay, I am back home with my MR3020 active.

    I had to load kmod-usb-serial-ftdi from th opkg packages. And I can actually see a serial port /dev/ttyUSB0.

    I am going to try a quick hook up in Minicom to my Propeller Protoboard via Forth. If that works... then I can get to your binary (I have never used command line binary loads for the Propeller, so I want to try this first

    [drum roll............]

    WE HAVE Forth! 115200 8N1 via the USB port in the MR3020 on /dev/ttyUSB0. I have still not gotten /dev/ttyATH0 to work right.

    ++++++++++++
    @Heater
    I will get to your binary immediately. I suspect it will work fine.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 07:59
    Mike,

    Can you remove Activity board, then plug it in again, then issue a "dmesg" command, seeing the output might give us some clues.

    Sounds like you might to install that kmod-usb-serial-ftdi package to get the USB/serial driver. Loopy, how did you do that?

    Also can you post the out put of "ls -l /dev"?

    I have a feeling that the loader only looks for certain kinds of names of serial ports "/dev/ttyS0", "/dev/ttyUSB0" so it might not see anything with odd names.
  • Mike CookMike Cook Posts: 829
    edited 2014-07-26 08:10
    Heater. - tried that, no LUV

    BUT!!!!

    Followed Loopy's tid bit from above installed the FDTI drivers. see bottom line! (Propeller Version 1 on /dev/ttyUSB0)
    root@OpenWrt:~# cd /dev
    root@OpenWrt:/dev# ls
    bus        mtd1       mtd5       null       ttyATH0    ttyS15     ttyS9
    console    mtd1ro     mtd5ro     port       ttyS0      ttyS2      urandom
    full       mtd2       mtdblock0  ppp        ttyS1      ttyS3      watchdog
    kmsg       mtd2ro     mtdblock1  ptmx       ttyS10     ttyS4      zero
    log        mtd3       mtdblock2  pts        ttyS11     ttyS5
    mem        mtd3ro     mtdblock3  random     ttyS12     ttyS6
    mtd0       mtd4       mtdblock4  shm        ttyS13     ttyS7
    mtd0ro     mtd4ro     mtdblock5  tty        ttyS14     ttyS8
    root@OpenWrt:/dev# cd
    root@OpenWrt:~# opkg update
    Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/Packages.gz.
    Updated list of available packages in /var/opkg-lists/attitude_adjustment.
    root@OpenWrt:~# opkg install kmod-usb-serial kmod-usb-serial-ftdi 
    Installing kmod-usb-serial (3.3.8-1) to root...
    Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-usb-serial_3.3.8-1_ar71xx.ipk.
    Installing kmod-usb-serial-ftdi (3.3.8-1) to root...
    Downloading http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/kmod-usb-serial-ftdi_3.3.8-1_ar71xx.ipk.
    Configuring kmod-usb-serial.
    Configuring kmod-usb-serial-ftdi.
    root@OpenWrt:/dev# ls
    bus        mtd1       mtd5       null       ttyATH0    ttyS15     ttyS9
    console    mtd1ro     mtd5ro     port       ttyS0      ttyS2      ttyUSB0
    full       mtd2       mtdblock0  ppp        ttyS1      ttyS3      urandom
    kmsg       mtd2ro     mtdblock1  ptmx       ttyS10     ttyS4      watchdog
    log        mtd3       mtdblock2  pts        ttyS11     ttyS5      zero
    mem        mtd3ro     mtdblock3  random     ttyS12     ttyS6
    mtd0       mtd4       mtdblock4  shm        ttyS13     ttyS7
    mtd0ro     mtd4ro     mtdblock5  tty        ttyS14     ttyS8
    root@OpenWrt:/dev# cd
    root@OpenWrt:~# cd /
    root@OpenWrt:/# ls
    bin             mnt             rom             tmp
    dev             overlay         root            usr
    etc             proc            sbin            var
    lib             propeller-load  sys             www
    root@OpenWrt:/# ./propeller-load -P
    Propeller Version 1 on /dev/ttyUSB0
    root@OpenWrt:/# 
    
    
    
    


    And the command you asked for:
    root@OpenWrt:/# ls -l /dev
    drwxr-xr-x    3 root     root            60 Jul 26 14:53 bus
    crw-r--r--    1 root     root        5,   1 Jan  1  1970 console
    crw-rw-rw-    1 root     root        1,   7 Jan  1  1970 full
    crw-r--r--    1 root     root        1,  11 Jan  1  1970 kmsg
    srw-rw-rw-    1 root     root             0 Jul 26 14:53 log
    crw-r--r--    1 root     root        1,   1 Jan  1  1970 mem
    crw-r--r--    1 root     root       90,   0 Jan  1  1970 mtd0
    crw-r--r--    1 root     root       90,   1 Jan  1  1970 mtd0ro
    crw-r--r--    1 root     root       90,   2 Jan  1  1970 mtd1
    crw-r--r--    1 root     root       90,   3 Jan  1  1970 mtd1ro
    crw-r--r--    1 root     root       90,   4 Jan  1  1970 mtd2
    crw-r--r--    1 root     root       90,   5 Jan  1  1970 mtd2ro
    crw-r--r--    1 root     root       90,   6 Jan  1  1970 mtd3
    crw-r--r--    1 root     root       90,   7 Jan  1  1970 mtd3ro
    crw-r--r--    1 root     root       90,   8 Jan  1  1970 mtd4
    crw-r--r--    1 root     root       90,   9 Jan  1  1970 mtd4ro
    crw-r--r--    1 root     root       90,  10 Jan  1  1970 mtd5
    crw-r--r--    1 root     root       90,  11 Jan  1  1970 mtd5ro
    brw-r--r--    1 root     root       31,   0 Jan  1  1970 mtdblock0
    brw-r--r--    1 root     root       31,   1 Jan  1  1970 mtdblock1
    brw-r--r--    1 root     root       31,   2 Jan  1  1970 mtdblock2
    brw-r--r--    1 root     root       31,   3 Jan  1  1970 mtdblock3
    brw-r--r--    1 root     root       31,   4 Jan  1  1970 mtdblock4
    brw-r--r--    1 root     root       31,   5 Jan  1  1970 mtdblock5
    crw-rw-rw-    1 root     root        1,   3 Jan  1  1970 null
    crw-r--r--    1 root     root        1,   4 Jan  1  1970 port
    crw-------    1 root     root      108,   0 Jul 26 14:53 ppp
    crw-rw-rw-    1 root     root        5,   2 Jul 26 15:15 ptmx
    drwxr-xr-x    2 root     root             0 Jan  1  1970 pts
    crw-r--r--    1 root     root        1,   8 Jan  1  1970 random
    drwxr-xr-x    2 root     root            40 Jan  1  1970 shm
    crw-rw-rw-    1 root     root        5,   0 Jan  1  1970 tty
    crw-rw-rw-    1 root     root      253,   0 Jan  1  1970 ttyATH0
    crw-rw-rw-    1 root     root        4,  64 Jan  1  1970 ttyS0
    crw-rw-rw-    1 root     root        4,  65 Jan  1  1970 ttyS1
    crw-rw-rw-    1 root     root        4,  74 Jan  1  1970 ttyS10
    crw-rw-rw-    1 root     root        4,  75 Jan  1  1970 ttyS11
    crw-rw-rw-    1 root     root        4,  76 Jan  1  1970 ttyS12
    crw-rw-rw-    1 root     root        4,  77 Jan  1  1970 ttyS13
    crw-rw-rw-    1 root     root        4,  78 Jan  1  1970 ttyS14
    crw-rw-rw-    1 root     root        4,  79 Jan  1  1970 ttyS15
    crw-rw-rw-    1 root     root        4,  66 Jan  1  1970 ttyS2
    crw-rw-rw-    1 root     root        4,  67 Jan  1  1970 ttyS3
    crw-rw-rw-    1 root     root        4,  68 Jan  1  1970 ttyS4
    crw-rw-rw-    1 root     root        4,  69 Jan  1  1970 ttyS5
    crw-rw-rw-    1 root     root        4,  70 Jan  1  1970 ttyS6
    crw-rw-rw-    1 root     root        4,  71 Jan  1  1970 ttyS7
    crw-rw-rw-    1 root     root        4,  72 Jan  1  1970 ttyS8
    crw-rw-rw-    1 root     root        4,  73 Jan  1  1970 ttyS9
    crw-rw-rw-    1 root     root      188,   0 Jul 26 15:04 ttyUSB0
    crw-r--r--    1 root     root        1,   9 Jan  1  1970 urandom
    crw-r--r--    1 root     root       10, 130 Jul 26 14:53 watchdog
    crw-rw-rw-    1 root     root        1,   5 Jan  1  1970 zero
    root@OpenWrt:/#
     
    
    


    And dmesg
    root@OpenWrt:~# dmesg
    [    0.000000] Linux version 3.3.8 (blogic@Debian-60-squeeze-64-minimal) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Sat Mar 23 16:49:30 UTC 2013
    [    0.000000] MyLoader: sysp=388dd517, boardp=04505212, parts=7709ac36
    [    0.000000] bootconsole [early0] enabled
    [    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
    [    0.000000] SoC: Atheros AR9330 rev 1
    [    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
    [    0.000000] Determined physical RAM map:
    [    0.000000]  memory: 02000000 @ 00000000 (usable)
    [    0.000000] Initrd not found or empty - disabling initrd
    [    0.000000] Zone PFN ranges:
    [    0.000000]   Normal   0x00000000 -> 0x00002000
    [    0.000000] Movable zone start PFN for each node
    [    0.000000] Early memory PFN ranges
    [    0.000000]     0: 0x00000000 -> 0x00002000
    [    0.000000] On node 0 totalpages: 8192
    [    0.000000] free_area_init_node: node 0, pgdat 802f1100, node_mem_map 81000000
    [    0.000000]   Normal zone: 64 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 8128 pages, LIFO batch:0
    [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
    [    0.000000] pcpu-alloc: [0] 0
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
    [    0.000000] Kernel command line:  board=TL-WR703N console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd
    [    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
    [    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
    [    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
    [    0.000000] Writing ErrCtl register=00000000
    [    0.000000] Readback ErrCtl register=00000000
    [    0.000000] Memory: 29000k/32768k available (2211k kernel code, 3768k reserved, 418k data, 212k init, 0k highmem)
    [    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [    0.000000] NR_IRQS:51
    [    0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
    [    0.080000] pid_max: default: 32768 minimum: 301
    [    0.080000] Mount-cache hash table entries: 512
    [    0.090000] NET: Registered protocol family 16
    [    0.090000] gpiochip_add: registered GPIOs 0 to 29 on device: ath79
    [    0.100000] MIPS: machine is TP-LINK TL-WR703N v1
    [    0.350000] bio: create slab <bio-0> at 0
    [    0.360000] Switching to clocksource MIPS
    [    0.360000] NET: Registered protocol family 2
    [    0.370000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.370000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
    [    0.370000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.380000] TCP: Hash tables configured (established 1024 bind 1024)
    [    0.390000] TCP reno registered
    [    0.390000] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.400000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.400000] NET: Registered protocol family 1
    [    0.410000] PCI: CLS 0 bytes, default 32
    [    0.430000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.430000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
    [    0.440000] msgmni has been set to 56
    [    0.440000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
    [    0.450000] io scheduler noop registered
    [    0.450000] io scheduler deadline registered (default)
    [    0.460000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
    [    0.470000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
    [    0.480000] console [ttyATH0] enabled, bootconsole disabled
    [    0.490000] m25p80 spi0.0: found s25sl032a, expected m25p80
    [    0.500000] m25p80 spi0.0: s25sl032a (4096 Kbytes)
    [    0.500000] 5 tp-link partitions found on MTD device spi0.0
    [    0.510000] Creating 5 MTD partitions on "spi0.0":
    [    0.510000] 0x000000000000-0x000000020000 : "u-boot"
    [    0.520000] 0x000000020000-0x000000109cac : "kernel"
    [    0.520000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
    [    0.540000] 0x000000109cac-0x0000003f0000 : "rootfs"
    [    0.540000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
    [    0.550000] mtd: partition "rootfs" set to be root filesystem
    [    0.560000] mtd: partition "rootfs_data" created automatically, ofs=2E0000, len=110000
    [    0.570000] 0x0000002e0000-0x0000003f0000 : "rootfs_data"
    [    0.570000] 0x0000003f0000-0x000000400000 : "art"
    [    0.580000] 0x000000020000-0x0000003f0000 : "firmware"
    [    0.600000] ag71xx_mdio: probed
    [    0.610000] eth0: Atheros AG71xx at 0xb9000000, irq 4
    [    1.160000] ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
    [    1.170000] TCP cubic registered
    [    1.170000] NET: Registered protocol family 17
    [    1.180000] Bridge firewalling registered
    [    1.180000] 8021q: 802.1Q VLAN Support v1.8
    [    1.190000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
    [    1.200000] Freeing unused kernel memory: 212k freed
    [    3.250000] Registered led device: tp-link:blue:system
    [    6.190000] eth0: link up (100Mbps/Full duplex)
    [    6.550000] JFFS2 notice: (436) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 13 of xref (0 dead, 3 orphan) found.
    [    6.760000] eth0: link down
    [    8.500000] Compat-drivers backport release: compat-drivers-2012-09-04-2-gddac993
    [    8.510000] Backport based on wireless-testing.git master-2012-09-07
    [    8.510000] compat.git: wireless-testing.git
    [    8.550000] cfg80211: Calling CRDA to update world regulatory domain
    [    8.550000] cfg80211: World regulatory domain updated:
    [    8.560000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    [    8.560000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    8.570000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    [    8.580000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    [    8.590000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    8.590000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    8.940000] usbcore: registered new interface driver usbfs
    [    8.940000] usbcore: registered new interface driver hub
    [    8.950000] usbcore: registered new device driver usb
    [    9.500000] ath: EEPROM regdomain: 0x0
    [    9.500000] ath: EEPROM indicates default country code should be used
    [    9.500000] ath: doing EEPROM country->regdmn map search
    [    9.500000] ath: country maps to regdmn code: 0x3a
    [    9.500000] ath: Country alpha2 being used: US
    [    9.500000] ath: Regpair used: 0x3a
    [    9.510000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
    [    9.510000] Registered led device: ath9k-phy0
    [    9.510000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
    [    9.510000] cfg80211: Calling CRDA for country: US
    [    9.520000] cfg80211: Regulatory domain changed to country: US
    [    9.530000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    [    9.530000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
    [    9.540000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
    [    9.550000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    9.560000] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    9.560000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    9.570000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
    [    9.640000] PPP generic driver version 2.4.2
    [    9.890000] ip_tables: (C) 2000-2006 Netfilter Core Team
    [   10.110000] NET: Registered protocol family 24
    [   10.130000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [   10.130000] ehci-platform ehci-platform: Generic Platform EHCI Controller
    [   10.140000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
    [   10.180000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
    [   10.200000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
    [   10.200000] hub 1-0:1.0: USB hub found
    [   10.200000] hub 1-0:1.0: 1 port detected
    [   10.230000] nf_conntrack version 0.5.0 (456 buckets, 1824 max)
    [   10.470000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [   10.550000] usb 1-1: new full-speed USB device number 2 using ehci-platform
    [   10.600000] usbcore: registered new interface driver usbserial
    [   10.610000] USB Serial support registered for generic
    [   10.720000] usbcore: registered new interface driver usbserial_generic
    [   10.720000] usbserial: USB Serial Driver core
    [   10.770000] USB Serial support registered for FTDI USB Serial Device
    [   10.770000] ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
    [   10.780000] usb 1-1: Detected FT-X
    [   10.780000] usb 1-1: Number of endpoints 2
    [   10.790000] usb 1-1: Endpoint 1 MaxPacketSize 16384
    [   10.790000] usb 1-1: Endpoint 2 MaxPacketSize 16384
    [   10.800000] usb 1-1: Setting MaxPacketSize 64
    [   10.810000] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
    [   10.810000] usbcore: registered new interface driver ftdi_sio
    [   10.820000] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
    [   14.400000] device eth0 entered promiscuous mode
    [   15.210000] eth0: link up (100Mbps/Full duplex)
    [   15.210000] br-lan: port 1(eth0) entered forwarding state
    [   15.220000] br-lan: port 1(eth0) entered forwarding state
    [   17.220000] br-lan: port 1(eth0) entered forwarding state
    root@OpenWrt:~# 
    
    
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 08:14
    Having no luck with SCP.
    The kmod-serial-usb package ate another 36Kb of storage. I am down to 632Kb available.

    I will keep trying. I do have scp active on my computer, but when I type scp propeller-load root@a.b.c.d , it merely hangs for awhile and then I get a prompt. I have Dropbear SSH active, so I should get a login challenge, shouldn't I?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 08:17
    To install the FTDI driver for serial USB, you have to use opkg repository and proceedures. You need to be able to reach the WWW to get your package

    ===========
    From a SSH session prompt

    opkg update
    opkg install kmod-usb-serial-ftdi
    reboot

    I think that should do it nicely.
  • Mike CookMike Cook Posts: 829
    edited 2014-07-26 08:23
    Loopy - make sure you have passwd from the telnet prompt then what I used seem to work
    scp propeller-load root@192.168.1.1:/
    
    

    mike@mike-Latitude-D630:~$ scp -v propeller-load root@192.168.1.1:/
    Executing: program /usr/bin/ssh host 192.168.1.1, user root, command scp -v -t / OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.
    debug1: Connection established.
    debug1: identity file /home/mike/.ssh/id_rsa type -1
    debug1: identity file /home/mike/.ssh/id_rsa-cert type -1
    debug1: identity file /home/mike/.ssh/id_dsa type -1
    debug1: identity file /home/mike/.ssh/id_dsa-cert type -1
    debug1: identity file /home/mike/.ssh/id_ecdsa type -1
    debug1: identity file /home/mike/.ssh/id_ecdsa-cert type -1
    debug1: identity file /home/mike/.ssh/id_ed25519 type -1
    debug1: identity file /home/mike/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
    debug1: Remote protocol version 2.0, remote software version dropbear_2011.54
    debug1: no match: dropbear_2011.54
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: server->client aes128-ctr hmac-md5 none
    debug1: kex: client->server aes128-ctr hmac-md5 none
    debug1: sending SSH2_MSG_KEXDH_INIT
    debug1: expecting SSH2_MSG_KEXDH_REPLY
    debug1: Server host key: RSA 63:9b:00:16:d5:3b:d0:3c:cc:38:c1:13:1a:2f:77:46
    debug1: Host '192.168.1.1' is known and matches the RSA host key.
    debug1: Found key in /home/mike/.ssh/known_hosts:1
    debug1: ssh_rsa_verify: signature correct
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: Roaming not allowed by server
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,password
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/mike/.ssh/id_rsa
    debug1: Trying private key: /home/mike/.ssh/id_dsa
    debug1: Trying private key: /home/mike/.ssh/id_ecdsa
    debug1: Trying private key: /home/mike/.ssh/id_ed25519
    debug1: Next authentication method: password root@192.168.1.1's password:
    debug1: Authentication succeeded (password).
    Authenticated to 192.168.1.1 ([192.168.1.1]:22).
    debug1: channel 0: new [client-session]
    debug1: Entering interactive session.
    debug1: Sending environment.
    debug1: Sending env LANG = en_US.UTF-8
    debug1: Sending command: scp -v -t /
    Sending file modes: C0755 133960 propeller-load
    Sink: C0755 133960 propeller-load
    propeller-load                                100%  131KB 130.8KB/s   00:00   
    debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
    debug1: channel 0: free: client-session, nchannels 1
    debug1: fd 0 clearing O_NONBLOCK
    debug1: fd 1 clearing O_NONBLOCK
    Transferred: sent 137136, received 1640 bytes, in 2.3 seconds Bytes per second: sent 58789.4, received 703.1
    debug1: Exit status 0
    mike@mike-Latitude-D630:~$ 
    
    

    root@OpenWrt:/# ./propeller-load -Q
    /dev/ttyUSB0
    root@OpenWrt:/#
     
    
    
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 08:25
    If the propeller-load won't recognize /dev/ttyATH0, I suspect that only /dev/ttyUSB0 will work until the code gets modified.

    I have been running successful hardwire loopbacks on /dev/ttyATH0. And I have had to modify /etc/inittab to disable the Serial Console from thinking it should participate in the same serial port.

    I am NOT sure that I did my Serial Console disable properly. OpenWRT has a proceedure.. follow that and NOT other blog discussions. If appears I missed Item 1 and did only Item 2.

    http://wiki.openwrt.org/doc/recipes/terminate.console.on.serial
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 08:44
    Hi,
    Apparently I was not including a directory path after the IP#.
    I got SCP to work fine and the only difference is I downloaded to /usr instead of /

    I ran it and it does come up. So now I just have to figure out how and where to get a Propeller binary, and how to properly reach /dev/ttyUSB0.

    (I have never used Propeller-load before, so it will take a bit of time to sort this all out).


    Should I expect propeller-load to auto-detect /dev/ttyUSB0? Interesting thought........
    ++++++++++++++
    Memory resource report.
    Prior to downloading this, had 632KB, now have 592KB.
    So the Propeller load seems to require 40KB space

    More to come quite soon.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 08:54
    @Mike Cook
    I do see that yours and my own scp of propeller-load reported 131KB total transfer

    Actually I see this " 100% 131KB 130.8KB/s ". but it seems to have been compacted to 40Kb on the MR3020. Not sure what is going on here.

    It any even the follow ducks are in a row.

    1. The FTDI USB2SER is working on my MR3020 after loading the right driver
    2. Propeller-loader is on the MR3020 and responds to the command line
    3. Have enough space to acquire a 32K Propeller binary to attempt to install (I guess I have to do yet another SCP, but Heater has been very interested in WGET as an alternative).

    More to come in a few moments.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 09:38
    Okay ........... SUCCESS ! ! !

    I have loaded a Tachyon V2.1 binary from the MR3020 via the USB port and Heater's propeller-loader executable through a USB2SER into a Propeller Protoboard. Baud rate is 57600 8N1.
    And then I brought up the same board in Minicom on the MR3020 to confirm a good install.

    @Heater
    It seems that we only have the /dev/ttyATH0 RS232 solution left to resolve.
    If that doesn't work out, any router with a USB port that is OpenWrt supported might program a Propeller wirelessly or over LAN.

    So far, I can't use /dev/ttyATH0 for anything with the Propeller.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 09:53
    Go Mike!
    root@OpenWrt:/# ./propeller-load -P
    Propeller Version 1 on /dev/ttyUSB0
    
    You have just achieved the first Propeller to OpenWRT router connection in the history of mankind!
    Streaking ahead of all a dawdlers here.

    Loopy,

    You need the colon on the end of that scp command:
    $ scp propeller-load root@a.b.c.d: 
    
    That will put propeller-load in root's home directory on the target. Without the colon it just copies the file to your local machine with a weird name. Add a path after the colon if you want the file in some other directory.

    propeller-load will detect USB serial ports, for some odd reason it does not look for real serial ports!

    Look at this:
    # ls /dev/tty*
    /dev/tty      /dev/ttyS0    /dev/ttyS1    /dev/ttyUSB0
    root@OpenWrt:~# ls /dev/tty* -l
    crw-r--r--    1 root     root        5,   0 Jan  1  1970 /dev/tty
    crw-r--r--    1 root     root        4,  64 Jan  1  1970 /dev/ttyS0
    crw-r--r--    1 root     root        4,  65 Jan  1  1970 /dev/ttyS1
    lrwxrwxrwx    1 root     root            10 Jul 26 19:30 /dev/ttyUSB0 -> /dev/ttyS0
    root@OpenWrt:~# 
    root@OpenWrt:~# ./propeller-load -Q
    /dev/ttyUSB0
    
    the USB/serial is detected, the two actual serial ports are not.

    No I don't really have a USBSerial here I faked it by creating symbolic link:
    root@OpenWrt:~# ln  -s /dev/ttyS0 /dev/ttyUSB0
    
    Which may be a useful trick.

    propeller-load should be able to use any port even if it does not see it automatically by adding the -p option:
    root@OpenWrt:~# ./propeller-load -r -p /dev/ttyATH0 some.bin
    
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 10:09
    Go Loopy as well!

    Things have stalled here today. It's so damn hot I can't move. 30C in the shade may not be much to many but we are not used to it around here. This apartment has windows and a balcony with a clear view to the south so we are cooking here!
  • Mike CookMike Cook Posts: 829
    edited 2014-07-26 10:19
    Well I'm going to take a break for a while.

    I need to go read up on OpenWRT. Took me a while to figure out how to hit the WR703N from the rest of the network. My original configuration, while I was setting it up was: Laptop connected to Wr703N's RJ-45 then the WR703N configured as a client on my WRT54g router. I could not ssh to the WR703N from other network clients. Fiddled around on the firewall settings and was able to make it work but I'm afraid I might have opened up too much stuff. But now I can ssh from any client on my wifi network. Right now I'm hitting it from my iPad.

    image.jpg
    1024 x 768 - 67K
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-26 15:30
    Wow, what fantastic progress!

    I thought I read that the AT9331 had bugs with the USB port and could not run FS which is what the FT232RL (used on the propplug) uses. Seems you have made it work.

    Hoping to get some time today.

    heater, the wget failed because of my website end which is hosted by ixwebhosting,com From what I can tell, I don't have FTP enabled. Not sure what/why http doesn't work tho'.

    no-ip ddns isn't working either. I need to go directly to my main router/hotspot first and get that working first. Then I can see what I need to do with my 703 - probably the firewall blocking the ports. My son has this working with his ADSL landline so I can compare to what he has. In the end, it could be my ISP (mobile cell provider) blocking this type of access.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-26 15:49
    Cluso,

    Yep, fabulous progress these guys have been making.

    no-ip will assign a host name to the external, public, network address of the router that connects to the internet. Is that router actually the one you have at home or is it somewhere in your cell network?

    In order to get HTTP requests from the internet to your OpenWRT router you will need to set up port forwarding in the internet facing router. We talked about this the other day. If that is in the cell network you are out of luck.

    It is possible your mobile provider will be blocking incoming connections. I have never tried it over a cell network. But as I said above it possible your cell modem is already on a non-publicly addressed LAN.

    Also, for some reason that I never figured out, the last time I had this sort of port forwarding working I could access my home machines from out side, but trying to use the host name or public address from within the home LAN did not work.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-07-26 20:36
    The other day when I setup no-ip and found my IP address, I was able toget to my router address so maybe I am in luck.
    Looks like I wont get to do anything today as my wife needs my laptop :(
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-26 21:18
    Hello to all,
    Thanks to Heater compiling propeller-load for the Antheros devices, it seems with have reached both milestones in a modified manner (using the USB for an RS232 connection, rather than /dev/ttyATH0).
    This may or may not satisfy many of us. I will continue to try on /dev/ttyATH0.

    I certainly have a lot of learning to do about routers as there are so many modes, configuration options, and security alternatives that one's head begins to spin. But that is part of what attracted me to these tiny routers -- a chance to explore the topic without messing up my link to the outside world.

    This has also been a great way to improve a lot of Linux Systems Administration skills. It is an area that we tend to ignore until we really need something that can't be done any other way. But there is a ton of handy features available.

    ++++++++++++
    Next?
    I guess I have to trace where Tx and Rx go on my MR3020. I still strongly suspect a ttl level incompatablity that might be cleared up with just buffering the input and out. There may be a voltage divider and capacitor on the Tx that create problems. I suspect that these could be by-passed.

    My RS232 configuration
    I have been using a 10K pull-up to 3.3v on the Tx as recommended. And this worked well with the USB2SER when I needed to reach the Serial Console.

    It seems obvious that I should disconnect pull-up and see what happens. If that doesn't work, maybe add another 10k pull-up on the Rx side is required as well. I really do need an oscilloscope at this point to make a good prognosis, but I don't have one.

    And I am not sure that the WR703N has the same serial port oddities. The two boards are different.

    ++++++++++
    Another possibility is that the WR703N and MR3020 are half-duplex RS232 and simply do not want to respond to the outside world in a variety of ways. So I guess I will try to find out more about what is included in the Antheros chip.


    **************
    Dreams of installing a Propeller IDE.......
    I do wonder if the httpd provided in OpenWrt for LuCi could also work with a compile or modified compile of SimpleIDE or Brad's Spin Tool. I have been told 'no', that would require the XWindows video system... but it still seems to me to be a remote possibility.
  • Heater.Heater. Posts: 21,230
    edited 2014-07-27 01:01
    Cluso,

    Was hacking away in the cool of the small hours of the morning. Which meant I was horribly tired and nothing worked!

    I tried getting port forwarding for HTTP on my internet facing WRT router working. It did not lock me out this time but when trying to make HTTP requests from a server out on the net I only get "connection refused". There must be a firewall rule I need to allow this but I have not found it yet. The port forwarding on the original d-link firmware was very easy.

    Loopy,

    I very much doubt your /dev/ttyATH0 is half duplex. I have never seen such on many similar SoC and Linux based devices.

    No you are not going to get SimpleIDE or BST working on these devices. If you could find/create all the libs for Qt the result would not fit in your fs. It would be horrible slow. You would need to export the X session over the net to make it work, making it even slower. It just not going to happen, impossible!

    However...SimpleIDE uses the command line openspin compiler to do it's Spin compilations. That can be built to run on the routers. With that you can develop Spin code and program Props all on the router!

    Which brings us to: A WEB based Spin compiler, openespin.js...

    I made a simple demo of a Spin IDE that can compile Spin in the browser. I used Emsripten to compile the openspin compiler, used by SimpleIDE, into JavaScipt and wrapped it up in a WEB page with a syntax highlighting editor.

    msrobots has extended that to an IDE that can handle multiple source files, and send the sources back to a server for compilation and loading to a Propeller!

    If the routers could serve up the openspin.js web pages and handle the AJAX calls they could do the whole job.

    http://forums.parallax.com/showthread.php/152711-A-Propeller-WebTool-Framework-for-Compiled-Languages

    Meanwhile....I was busy trying to weld a DIP Propeller and associated components to a proto-board to use as by router connected Propeller. Of course as I was so tired, the 3.3v regulator did not work. And then smoke came out. And then it worked even less well!

    The Prop should be OK as it was not connected to anything yet....
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-07-27 01:38
    Okay, I do understand that Http is not equal to a gull GUI.
    It is interesting that a Propeller binary might compile on one of these wifi routers. I guess an editor application on a touchpad would have to provide services fro writng and editting code. That isn't a bad compromise.

    +++++++++
    What's next?
    1. I am beginning to explore the /dev/ttyATH0 port with hopes of still getting it to be useful on the MR3020. It seems be wired oddly.

    The WR703N and DIR-615 may be wired completely differently and easier to deploy. I can't see the benefits of setting up a GPIO to Reset on the MR3020 without the Tx and Rx working well. I may get lucky and discover a good fix, or this miight have to wait for someone with a scope to investigate fully.

    2. I installed Tachyon because I wanted to learn it more deeply. So I am studying Tachyon V2.1 for more wifi uses. I had explored PropForth and ptth in depth, but never got to Tachyon. The ability to use wifi to login is a big win.

    3. Need to learn more about routers and wifi routing features. There are some exotic wifi networks that can be done. Ham Radio Meets often set up a Wifi Mesh network on a temporary basis. Since that takes several wifi nodes participating, I've not looked into it before.

    +++++++
    Thanks again for the AR7xxx binary for propeller-load. I suppose I should get the tool chain established and learn to do this myself. But it is always motivating to know that it can be done and one is trying to do something that might be impossible.
Sign In or Register to comment.