- 博客(54)
- 收藏
- 关注
原创 openwrt opkg install 强制替换安装
查询 opkg list-installed | grep XXXopkg install XXX.ipk --force-downgrade
2021-03-01 16:03:53
7053
原创 opkg list 报错
opkg listCollected errors:* opkg_conf_load: Could not lock /var/lock/opkg.lock: Resource temporarily unavail echo "nameserver 114.114.114.114">/tmp/resolv.conf rm -f /var/lock/opkg.lock opkg update
2021-02-22 16:37:19
2164
原创 mt7621 uboot编译报错
CHK include/config/uboot.release CHK include/generated/version_autogenerated.h UPD include/generated/version_autogenerated.h CHK include/generated/timestamp_autogenerated.h UPD include/generated/timestamp_autogenerated.h CHK ...
2020-11-25 17:37:58
962
原创 openwrt路由器接华为E3372(E8372)网卡实现4G转有线和WIFI
Hilink在openwrt系统中安装kmod-usb-net-rndis kmod-usb-net kmod-usb2 usb-modeswitch kmod-usb-net-cdc-ether。安装完成后,把E3372(E8372)插入路由器USB口,待4G指示灯亮起,打开openwrt路由器wan口(没有就添加它)设置界面,你会发现物理设置接口多了一项以太网适配器: "eth2" ,eth后面的数字是在已有接口基础上增加的。那么它就是4G设备接口,就选中它并保存应用。wan口协议设置成DHCP客
2020-10-12 13:32:00
5145
1
原创 Linux C atoi() 字符串转整形
1.函数功能:把字符串转换成整型数.master->relation_buf = atoi(rd_buff);printf("relation_buf:%d\n", master->relation_buf);
2020-09-28 19:30:51
580
原创 openwrt wifi默认启动
/NXP/feiling/openwrt/package/kernel/mac80211/files/lib/wifi/mac80211.sh1改为 0
2020-09-16 17:21:09
1318
2
原创 openwrt 插拔重新获取IP
while true; do status=`swconfig dev switch0 port 4 get link | awk '{print $2}' | cut -d":" -f2` #这个是获取当前网线的拔插状态,UP就是插着网线,down就是拔出网线 if [ "$status" = "up" ]; then ech...
2020-09-08 17:44:43
1365
原创 OpenWrt OpenMPTCProuter feed
echo "src-git OpenMPTCProuter https://github.com/Ysurac/openmptcprouter-feeds.git" >> feeds.conf.default./scripts/feeds update -a./scripts/feeds install -amake menuconfig
2020-08-17 13:41:52
1971
2
原创 linux c 读写文件
#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <stdio.h>#include <string.h>#include <unistd.h>void main(){int fd,size;char s[] = "hello !" ,buff[1024];fd = open("xx.txt",O...
2020-08-11 19:59:55
243
转载 Openwrt添加内核patch
Openwrt添加内核patch在openwrt根目录执行以下指令 切换到内核路径下 增加新的patch 编辑要修改的文件 查看修改内容 生成新的patch 更新patch(切换到openwrt根目录) 重新编译固件 编译后patch会存在以下目录(openwrt根目录查看) 环境说明:ubuntu16.04openwrt 18.06(Linux-4.9.120)在openwrt根目录执行以下指令make target/linux/{clean,p.
2020-08-10 18:56:39
1117
原创 Openwrt 19.07.03 NXP LS1046A
编译固件完后,制作镜像 cd /home/forlinx/work/openwrt/staging_dir/target-aarch64_generic_musl rm root-layerscape/lib/preinit/80_mount_root sudo make_ext4fs -s -T -I -l 7489978368 OpenWRT.img root-layerscape 注意:make_ext4fs 工具可以通过 apt-get install android-tools
2020-08-10 18:49:52
942
原创 linux c 如何判断 字符数组是否为空
1、学符数组str[];if(strlen(str)==0)则该字符数组为空2、判断:if (strcmp(buf,"")==0)strcmp在"string.h"中,buf是你要判断的字符串
2020-08-10 14:43:29
1572
原创 linux c char * char[]相互转换
1、char[]转char*可以直接赋值。char pp[20] = "helloworld";char* p = pp;2、char*转char[]主要有两种方法可以将char*转换为char[]类型,分别是:strcpy()、循环遍历。其中,strcpy()可能会报安全性错误,自行解决即可。2.1 strcpy()方法char arr[20];char* tmp = "helloworld";strcpy(arr, tmp);2.2 循环遍历char arr[20];c
2020-07-28 14:05:30
1220
原创 openwrt MT7623 刷机
http://wiki.banana-pi.org/%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B_%E9%A6%99%E8%95%89%E6%B4%BE_BPI-R2根据上面步骤 。插上sd卡win32diskmanager,直接写入。插卡 一直按住PWR。直到有打印
2020-07-19 15:35:25
1328
原创 linux创建线程pthread_create
函数简介 pthread_create是UNIX环境创建线程函数头文件 #include<pthread.h>函数声明 int pthread_create(pthread_t*restrict tidp,const pthread_attr_t *restrict_attr,void*(*start_rtn)(void*),void *restrict arg);返回值 若成功则返回0,否则返回出错编号参数 第一个参数为指向线程标识符的指针。.
2020-07-16 11:05:28
352
原创 Linux OpenWRT查看CPU,RAM,Flash信息参数
查看RAM容量大小(可以理解为电脑的内存条)root@OpenWrt:/# cat /proc/meminfo |grep MemTotal #查看RAM大小MemTotal: 61348 kBroot@OpenWrt:/# free -h |grep Mem | awk -F ' ' '{print $2}' #查看RAM大小 (单位kB)61348root@OpenWrt:/# free -h |grep Mem | awk -F ' ' '{print $3}'...
2020-07-16 10:40:27
2980
原创 openwrt wifi PSK设置
Network*hostapd········· Mhostapd-basic*hostapd-common······*hostapd-utils··············
2020-07-16 10:24:31
383
原创 openwrt 获取网口MAC地址
static int get_mac(char* mac,char* brifc){ struct ifreq tmp; int sock_mac; char mac_addr[32]={0}; sock_mac = socket(AF_INET, SOCK_STREAM, 0); if( sock_mac == -1) { perror("create socket fail\n"); return -1; }...
2020-07-13 18:08:22
2110
原创 openwrt linux 设置ip
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<sys/ioctl.h>#include<sys/socket.h>#include<arpa/inet.h>#include<netinet/in.h>#include<net/if.h>#include "setip.h"//设置IP地址/** 函数名称 : i.
2020-07-13 18:07:20
651
原创 openwrt 动态分配有规律IP地址
vi /etc/config/dhcpconfig dhcp 'lan' option interface 'lan' option start '1' option limit '100' option leasetime '12h' option dhcpv6 'server' option ra 'server'
2020-07-07 18:33:42
2380
原创 linux c ioctl ifconfig
ioctl(sock,SIOCGIFHWADDR,&ifr)函数中 SIOCGIFHWADDR 用来获取网卡硬件地址(MAC地址)
2020-07-04 17:14:23
529
原创 openwrt 19.07 resolv.conf 域名解析
search lannameserver 114.114.114.114nameserver 127.0.0.1nameserver 表明DNS服务器的IP地址。domain 声明主机的域名。很多程序用到它,如邮件系统;search 它的多个参数指明域名查询顺序。sortlist 允许将得到域名结果进行特定的排序。它的参数为网络/掩码对,允许任意的排列顺序。...
2020-07-03 15:39:42
857
原创 openwrt linux c 修改系统时间
#include <stdio.h>#include<sys/time.h>#include<unistd.h>#include <time.h>typedef struct _SettimeInfo_{ char settime[32]; //输入要修改的系统时间 %d-%d-%d %d:%d:%d}SETTIMEINFO;int SetSystemTime(SETTIMEINFO * SetTime){ stru...
2020-06-28 13:47:51
901
原创 openwrt log
vim/etc/config/systemconfig system... option log_ip <destination IP> option log_port <destination port> option log_proto <tcp or udp>
2020-06-05 18:49:35
455
原创 openwrt 报错小记
1. uboot烧录固件之后一直jffs2:jffs2_scan_eraseblock():Magicbitmask大概率是刷的时候没刷完
2020-06-03 14:40:05
730
原创 openwrt 19.07 恢复出厂设置
设置GPIO后7 cat /etc/rc.button/reset 8 #!/bin/sh 9 . /lib/functions.sh 10 OVERLAY="$( grep ' /overlay ' /proc/mounts )" 11 case "$ACTION" in 12 pressed) 13 [ -z "$OVERLAY" ] && return 0 14 return 5 15 ;; 16 timeo...
2020-05-30 10:55:18
2727
原创 openwrt 19.07 ECMP 负载均衡
转载至:https://lwz322.github.io/2019/11/03/ECMP.html https://cumulusnetworks.com/blog/celebrating-ecmp-part-two/ https://cloud.tencent.com/developer/article/1449969 https://blog.youkuaiyun.com/wdscq1234/article/details/5264...
2020-05-28 11:47:42
1927
原创 openwrt uci 交叉编译
修改CMakeLists.txtcmake_minimum_required(VERSION 2.6)PROJECT(uci C)SET(TOOLCHAIN_DIR "/home/dream/opt/openwrt-toolchain-ramips-mt7621_gcc-7.5.0_musl.Linux-x86_64/toolchain-mipsel_24kc_gcc-7.5...
2020-04-17 11:39:48
747
原创 openwrt mtk wifi 7603/7612
1, mv mt7620-p4rev-120998.tar.bz2 openwrt/dl/2, mv mtk-wfi-openwrt18.06 openwrt/packages/ramips3, make menuconfig->MTK Properties4, make V=s
2020-04-14 16:30:40
2449
原创 openwrt 使用memcpy
使用memcpy一定要注意内存偏移发生错误memcpy(,buffer,sizeof(buffer));一定不要越界!!!!
2020-04-03 11:54:54
135
原创 linux 压缩和解压
1.zip命令例如:zip -r mysql.zip mysql该句命令的含义是:将mysql文件夹压缩成mysql.zipzip -r abcdef.zip abc def.txt这句命令的意思是将文件夹abc和文件def.txt压缩成一个压缩包abcdef.zip2.unzip命令与zip命令相反,这是解压命令,用起来很简单。 如:unzip mysql....
2020-01-03 14:43:38
1710
转载 widora openwrt 搭建环境和编译固件
编译前要安装以下依赖: $ sudo apt-get update $ sudo apt-get install git g++ make libncurses5-dev subversion libssl-dev gawk libxml-parser-perl unzip wget python xz-utils vim zlibc zlib1g zlib1g-dev openjd...
2019-07-28 13:36:43
620
转载 ESP8266 在线构建 固件
1.NodeMCU模块2.ESP8266Flasher.exe 烧录工具3.ESPlorer v0.2.0-rc6 官方ide构建固件Building the firmware提供了三种构建你自己固件的方式。这里推荐使用简单的云构建服务NodeMCU custom builds来定制自己的固件,只需要在该网站选择你需要的库,...
2019-05-28 09:19:38
1721
原创 ESP8266 固件擦除
折腾了两天 真是醉了 首先确认安装 pythonpython2是否安装python2 --versionsudo apt- isntall python-pip安装pip和他的许多其他依赖 pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)测试python3python3 -...
2019-05-16 14:24:54
7461
原创 配置OpenWrt开发环境
安装开发环境,选择速度最快的源,然后执行 sudo apt-get update;接下来执行 sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils libncurses5-dev ncurses-term zlib1g-dev g...
2019-05-13 14:42:22
286
原创 openWRT u盘挂载
USB盘的文件系统通常是vfat 格式 ,我们首先安装 vfat 格式的相关软件包,然后将USB盘挂载到/src 目录下。
2018-11-21 17:25:43
1368
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人