zoukankan      html  css  js  c++  java
  • 【wifi移植 3】开发板wifi自动获取IP

    内核版本:3.4.61

    1. 配置内核,支持DHCP

      ~/kernel$ make menuconfig

      [*] Networking support  --->

        Networking options  --->

          <*> Packet socket

          [*]     IP: DHCP support

          [ ] Network packet filtering framework (Netfilter)  --->  //网上说需要选中该项,但是选择该项后功能不正常

    2. 配置busybox,支持udhcp

      默认情况下,busybox已经支持udhcp

      (1)编译busybox

      (2)将生成的udhcpc复制到开发板/sbin下

      (3)从Busybox的examples/udhcp/下copy  simple.script文件到开发板/usr/share/udhcpc/下,并重命名为default.script

          修改default.script中RESOLV_CONF="/etc/resolv.conf" 为 RESOLV_CONF="/tmp/resolv.conf"  //可指定为其他路径

      

    3. 测试

      (1)启动wifi:#ifconfig wlan0 up

      (2)连接热点:#iwconfig wlan0 essid "HWAP"

      (3)自动获取IP:#udhcpc -i wlan0

    udhcpc (v1.19.3) started
    Setting IP address 0.0.0.0 on wlan0
    Sending discover...
    Sending select for 192.168.43.22...
    Lease of 192.168.43.22 obtained, lease time 3600
    Setting IP address 192.168.43.22 on wlan0
    Deleting routers
    route: SIOCDELRT: No such process
    Adding router 192.168.43.1
    Recreating /etc/resolv.conf
     Adding DNS server 192.168.43.1

  • 相关阅读:
    常用注解
    代码自动生成插件:
    jsoup爬虫技术+druid连接池

    图书管理系统-项目介绍
    shiro
    (C#) What is the difference between "const" and "static readonly" ?
    What is a Windows USB device path and how is it formatted?
    (C/C++ interview) Static 详解
    Cpk
  • 原文地址:https://www.cnblogs.com/emlslxl/p/5587305.html
Copyright © 2011-2022 走看看