Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

MK808/Wheezy - hostap, WPA does not work but WEP is working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MK808/Wheezy - hostap, WPA does not work but WEP is working

    Hi all,

    I have an old MK808, this version has RK901 built in (without Bluetooth). The wifi chip is bcm40181.
    Wifi clients are able to connect to MK808/hostap when I set WEP autentification or if I desable athentifacation at all.
    I do not know why the clients can not connect to it when I set WPA or WPA2.

    When WPAor WPA2 is set in hostap.conf, If I run /usr/local/bin/hostapd -B /etc/hostapd/hostapd.conf I have the following log
    tail -f /var/log/syslog

    ...[ 19.844800] [DHD]
    ...[ 19.844806] Dongle Host Driver, version 5.90.125.69
    ...[ 19.844813] Compiled in drivers/net/wireless/bcmdhd on Jul 15 2014 at 23:05:20
    ...[ 19.847145] CFGP2P-ERROR) wl_cfgp2p_supported : wl p2p error -23
    ...[ 19.917520] [DHD] DHD-MON: dhd_mon_if_subif_start_xmit enter
    ...[ 19.917813] [DHD] DHD-MON: dhd_mon_if_subif_start_xmit radiotap len (should be 14): 14
    ...[ 20.139687] 802.1Q VLAN Support v1.8
    ...[ 20.224561] [DHD] wl_host_event: Invalid ifidx 0 for wl0

    Hostap.conf:

    interface=eth0
    driver=nl80211
    ssid=myssid
    hw_mode=b
    channel=6
    auth_algs=1
    beacon_int=100
    dtim_period=2
    max_num_sta=255
    rts_threshold=2347
    fragm_threshold=2346

    logger_syslog=-1
    logger_syslog_level=0
    logger_stdout=-1
    logger_stdout_level=0

    macaddr_acl=0
    ignore_broadcast_ssid=0
    wpa=3
    wpa_passphrase=mypassword
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP
    rsn_pairwise=CCMP

    # Static WEP key configuration
    #wep_default_key=0
    #wep_key0=123456789a

    #wpa_passphrase=123456789a
    #wpa_key_mgmt=WPA-PSK
    #wpa_pairwise=TKIP

    Please, do some one has an idea of this problem ?

    #2
    # AP Setup for MK808 by JBOX

    ################################################## ####################################

    # Check your hardware

    sudo apt-get install iw
    iw list

    # ********* Check if you get *************
    # Supported interface modes:
    # * IBSS
    # * managed
    # * AP <---- This means the access point mode is supported by the device and driver.
    # * AP/VLAN
    # * WDS
    # * monitor
    # ****************************************
    # If yes, please try setting up the access point as follows.

    ################################################## ####################################
    # Download extra packages before your wifi internet access is removed by AP settings!
    # On RockChip devices (with android kernel source) hostapd needs to be recompiled with android.conf
    # If Broadcom wifi chips are used upgrade bcmdhd (kernel) source code and recompile, etc.
    ################################################## ####################################

    # Download packages

    sudo apt-get install hostapd
    sudo apt-get install dnsmasq

    # Stop daemons from loading

    cd /etc/init.d
    sudo service hostapd stop
    sudo service dnsmasq stop
    sudo update-rc.d -f hostapd remove
    sudo update-rc.d -f dnsmasq remove

    ################################################## ####################################
    # Replace /usr/sbin/hostapd on RockChip devices
    ################################################## ####################################

    sudo nano /etc/network/interfaces

    ****** Paste these lines *******
    auto lo
    iface lo inet loopback

    #auto eth0
    #iface eth0 inet dhcp
    #wpa-ssid MySSID
    #wpa-psk xxxxxxxxxxxx

    ################################################## ####################################

    sudo nano /etc/default/hostapd

    ****** EDIT THE LINE WITH DAEMON_CONF TO...*******
    DAEMON_CONF="/etc/hostapd/hostapd.conf"

    ################################################## ####################################

    sudo nano /etc/hostapd/hostapd.conf

    ****** Paste these lines for WEP *******
    interface=eth0
    driver=nl80211
    ssid=APwithWEP
    channel=1
    hw_mode=g
    macaddr_acl=0
    ignore_broadcast_ssid=0
    auth_algs=1
    wep_default_key=0
    wep_key0="xxxxxxxxxxxx"

    ****** Paste these lines for WPA2 *******
    interface=eth0
    driver=nl80211
    ssid=APwithWPA2
    channel=1
    ieee80211n=1
    wpa=2
    rsn_pairwise=CCMP
    wpa_passphrase=xxxxxxxxxxxx

    ################################################## ####################################

    sudo nano /etc/dnsmasq.conf

    **** Paste these lines at the bottom *******
    interface=eth0
    dhcp-range=10.0.0.2,10.0.0.5,255.255.255.0,12h

    ################################################## ####################################

    # Start AP from the command line or add the following lines to /etc/rc.local

    sudo ifconfig eth0 down
    sudo ifconfig eth0 10.0.0.1 netmask 255.255.255.0 up
    sudo service hostapd restart
    sudo service dnsmasq restart

    ################################################## ####################################

    # Check your AP SSID from an other wireless device

    Comment


      #3
      Linuxroot for MK808 by JBOX

      DISCLAIMER: Use at your own risk.
      Run these commands on the ARM machine for which you want to create a new clean (RFS) Root File System.
      i.e.: ARM schroot code does not run on a PC.

      # HOWTO SCHROOT

      sudo apt-get install schroot
      sudo apt-get install debootstrap
      CHROOT=/var/chroot/wheezy
      sudo mkdir -p $CHROOT

      # 1 MAKE A SCHROOT DISK

      DISK=/dev/mmcblk1p1
      sudo mount $DISK $CHROOT

      # or 2 MAKE A RAM IMAGE

      dd if=/dev/zero of=wheezy.img bs=1MB count=0 seek=3072
      mkfs.ext4 -F wheezy.img
      sudo mount -o loop wheezy.img $CHROOT

      # Copy this to /etc/schroot/schroot.conf ## Check your default ftab,db and file setting!

      [wheezy]
      description=Debian Wheezy
      directory=/var/chroot/wheezy
      users=root,wheezy
      root-users=root,wheezy

      ################################################## ###########################################

      sudo debootstrap --arch armhf wheezy $CHROOT
      sudo leafpad $CHROOT/etc/apt/sources.list

      # Copy this to /var/chroot/wheezy/etc/apt/sources.list

      deb http://ftp.nl.debian.org/debian wheezy main contrib non-free
      deb-src http://ftp.nl.debian.org/debian wheezy main contrib non-free

      # ENTER SCHROOT

      sudo schroot -l
      sudo schroot --config wheezy
      sudo schroot -c wheezy -u root

      # INSIDE SCHROOT

      apt-get update
      apt-get upgrade
      apt-get install wireless-tools
      apt-get install iw
      apt-get install wpasupplicant

      # Add extra packages

      apt-get install mc
      apt-get install htop
      apt-get install usbutils

      #

      exit

      # AFTER SCHROOT copy your MK808 firmware and modules

      sudo schroot -e-c wheezy
      sudo cp -av /lib/firmware $CHROOT/lib/
      sudo cp -av /lib/modules $CHROOT/lib/
      sync

      ################################################## ###########################################

      sudo leafpad $CHROOT/etc/shadow

      # Change this in /var/chroot/wheezy/etc/shadow

      root::15884:0:99999:7:::

      ################################################## ###########################################

      sudo leafpad $CHROOT/etc/hostname

      wheezy

      ################################################## ###########################################

      sudo leafpad $CHROOT/etc/network/interfaces

      # Copy this to /var/chroot/wheezy/etc/network/interfaces to connect to your WIFI router

      auto lo
      iface lo inet loopback

      auto eth0
      iface eth0 inet dhcp
      wpa-ssid MySSID
      wpa-psk **********

      ################################################## ###########################################

      sudo leafpad $CHROOT/etc/modules

      # Add this to /var/chroot/wheezy/etc/modules if you have a bcm40181 WIFI module

      bcmdhd

      ################################################## ###########################################

      sudo tar -cvzf wheezy+modules.tar.gz -C $CHROOT .
      sync
      sudo umount $DISK # 1 if disk drive
      sudo umount $CHROOT # 2 if ram image

      # Extract archive to a SD card class 10 with label: linuxroot
      # with help of an extra card reader or a PC. Writing a full SD card is slow: Use SYNC!

      cd ???
      sudo tar -xvzf wheezy+modules.tar.gz
      sync
      sync
      sync

      # Poweroff your ARM machine and replace the SD card

      sudo poweroff

      # Usefull commands afer login as root on your new linuxroot

      passwd root
      useradd wheezy -m -s /bin/bash
      usermod -aG root,sudo wheezy
      passwd wheezy
      export LC_ALL=C
      dpkg-reconfigure locales
      dpkg-reconfigure tzdata

      # Add extra packages

      apt-get install ntp samba
      apt-get install build-essential debootstap schroot
      apt-get install lxde

      ################################################## ###########################################

      reboot
      Last edited by Guest; 26 August 2014, 22:16.

      Comment


        #4
        Howto compile and flash a Linux kernel for MK808 by JBOX

        Prerequierments

        - USB harddisk or SD card 8GB class 10 with an ext4 partition
        called linuxroot + ARMHF rootfs

        Software

        - PC with Linux installed
        - rkflashtool (flashes the software to nand)
        - rkcrc (adds a crc to the kernel image)
        - mkbootimg (makes a recovery image)

        - MK808 Finless 1.7c ROM (gives root access)
        - original firmware:


        Inside a terminal:

        sudo apt-get install libusb-1.0-0-dev
        sudo apt-get install git
        sudo apt-get install libncurses5-dev
        sudo apt-get install lzop
        sudo apt-get install gcc-arm-linux-gnueabi

        export RK=~/rk

        mkdir $RK
        cd $RK
        git clone https://github.com/olegk0/tools.git

        git clone https://github.com/Galland/rk30_linux_initramfs.git initramfs
        cd initramfs
        gzip -dc debian-3.0.8+fkubi.cpio.gz > initramfs.cpio
        cd $RK

        git clone https://github.com/naobsd/rkutils.git
        cd rkutils
        gcc -o rkcrc rkcrc.c
        cd $RK

        git clone https://github.com/justgr/arnova-tools.git
        cd arnova-tools/rkflashtool
        gcc -o rkflashtool rkflashtool.c -lusb-1.0
        cd $RK

        cd /usr/local/bin
        sudo ln -s $RK/tools/mkbootimg mkbootimg
        sudo ln -s $RK/rkutils/rkcrc rkcrc
        sudo ln -s $RK/arnova-tools/rkflashtool/rkflashtool rkflashtool
        cd $RK

        # connect mk808 OTG USB to PC with reset button pressed
        # after button release check for ID 2207:300a

        lsusb

        # check also if mtdparts=rk29xxnand equels to mtdparts in mk808.config
        # at CONFIG_CMDLINE else change

        sudo rkflashtool r 0 1 | head -n 11

        # if mtdparts gives 0x00008000@0x00004000(kernel) as kernel position
        # then backup old kernel else change rkflashtool parameters first

        sudo rkflashtool r 0x4000 0x8000 > kernel_old.img

        ## if mtdparts gives 0x00008000@0x00014000(recovery) as recovery position
        ## then backup old recovery else change rkflashtool parameters first
        ## sudo rkflashtool r 0x14000 0x8000 > recovery_old.img

        # download or copy your favorite kernel source
        # for example:

        wget https://s3.amazonaws.com/tabletfirmw...rie_GPL.tar.gz
        tar xzvf bqCurie_GPL.tar.gz
        cd kernel

        # export your toolchain settings

        dpkg -L gcc-arm-linux-gnueabi
        export ARCH=arm
        export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-

        # copy a default config as starting point

        cp mk808.config .config

        # make some changes in kernel source and config
        # make HDMI and (blacklight) blue led work together
        # add bcmdhd module and set the right GPIO bits
        # etc.

        # select your modules

        make menuconfig

        # if make gives an error then
        # make clean
        # and return to
        # make menuconfig

        make -j2

        # copy your modules as su
        # (change INSTALL_MOD_PATH to /lib/modules of your mounted linuxroot)

        sudo make modules_install INSTALL_MOD_PATH=../modules/

        # sync and unmount linuxroot on your USB harddisk or SD card
        # and connect/insert it with/in the MK808

        # add crc to kernel zImage if you want linux only

        rkcrc -k ./arch/arm/boot/zImage ../mk808.img

        ## make a recovery image if you want to keep android
        ## mkbootimg --kernel ./arch/arm/boot/Image
        ## --ramdisk ../initramfs/fakeramdisk.gz --base 60400000
        ## --pagesize 16384 --ramdiskaddr 62000000 -o ../recovery.img

        cd ..

        # if mtdparts gives 0x00008000@0x00004000(kernel) as kernel position
        # then flash else change rkflashtool parameters first

        sudo rkflashtool w 0x4000 0x8000 < mk808.img

        ## if mtdparts gives 0x00008000@0x00014000(recovery) as recovery position
        ## then flash else change rkflashtool parameters first
        ## sudo rkflashtool w 0x14000 0x8000 < recovery.img

        # finish flashing and the MK808 will boot with 2 pinguins on the screen

        sudo rkflashtool b

        # disconnect the MK808 from the PC and connect it to it's own power supply
        # and enjoy your new fanless Linux system

        Comment


          #5
          Typo fixes:

          ==> export CHROOT=/var/chroot/wheezy
          ==> export DISK=/dev/mmcblk1p1
          ==> sudo schroot -e -c wheezy

          add extra line to rkflashtool.c:

          if (!(h = libusb_open_device_with_vid_pid(c, 0x2207, 0x290a)))
          if (!(h = libusb_open_device_with_vid_pid(c, 0x2207, 0x281a)))
          ==> if (!(h = libusb_open_device_with_vid_pid(c, 0x2207, 0x300a)))

          Comment

          Working...
          X