找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 31798|回复: 330

[N1盒子] 【骨头版代码分享】小狮子N1学习个人笔记(7月1日置顶4楼更新N1做纯AP)

 火... [复制链接]
发表于 2019-6-21 10:27 | 显示全部楼层 |阅读模式
本帖最后由 tinylion 于 2019-7-9 17:46 编辑

画外音:N1真的是个好东西,这段剁手又收了几个全新P1,终极目标是N1组集群,N1累积应该收了40多个了...
但说句实在话,LINUX真的比Windows C蛋!
装个软件在Win下一个setup就能解决的问题,在只有命令提示符的linux server版下,
先要看对应的架构,然后要安装对应的依赖,然后还要看对应的配套软件版本,然后祈求上帝保佑般开始填坑...

不过不管如何,毕竟是一个学习的过程,
本贴将记录小狮子个人学习过程中解决的问题,内容会很杂,会无序。
因此只分享一些骨头版代码,帮助只求简单解决问题而不求甚解的坛友。

******************************************************************************************

基于本人修改的Armbian 5.77 Ubuntu版本,保证以下分享的骨头版代码都可以运行!若别的版本出现问题,小狮子水平有限,恕不能解答了。

个人实测自己的这个版本,运行基于主路由的docker版OP,并在OP里做端口转发和DDNS设置映射,
从以下docker-compose方式安装的nextcloud里下载文件,可以跑满自家的宽带带宽(部署在电信网,从移动网访问电信网下载),BBR加速效果明显!

577版本下载地址:链接: https://pan.baidu.com/s/1IjKW8Lqh6TgAO9o5ZJolRg 提取码: vcfu
首先要安装好docker,详细步骤见mozzie大神分享
https://right.com.cn/forum/thread-430903-1-1.html

经验一: docker-compose 搞定nextcloud,含nginx、redis、cron、mariadb

1. 安装 docker-compose

apt-get update
apt-get install python-pip python-dev libffi-dev gcc libc-dev make

pip install wheel

pip install --upgrade setuptools

pip install docker-compose

docker-compose --version
docker-compose version 1.24.0, build 1110ad01 (出现该句则安装成功)

2. 安装 nextcloud ,含nginx、redis、cron、mariadb

下载以下附件,解压,目录上传到armbian中


cd nextcloud_compose

docker-compose up -d

192.168.X.X:8686 (访问nextcloud)








本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 3恩山币 +4 收起 理由
ql1307096 + 1 强大的恩山!(以下重复1万次)
hcyme + 2 强大的恩山!(以下重复1万次)
SkyTiger + 1 强大的恩山!(以下重复1万次)

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2019-6-21 15:33 | 显示全部楼层
本帖最后由 tinylion 于 2019-7-9 17:47 编辑

# 卸载Docker CE
sudo apt-get purge docker-ce

# 删除Docker镜像、容器、数据卷等文件
sudo rm -rf /var/lib/docker

一些常用资源和代码搜集

资源搜集
https://yadi.sk/d/pHxaRAs-tZiei  150大神的armbian的固件源
https://github.com/coolsnowwolf/lede  lean神的GitHub
http://rom.nanodm.net/  
https://hub.docker.com/r/80x86/typecho 灯大的


代码搜集

1. 加--rm参数,测试一个 docker 是否可用,例如:
docker run --rm fauria/vsftpd
  
2. 删除docker compose创立的整套应用
docker-compose stop
docker-compose rm
docker volume prune
docker network prune
(docker system prune,docker image prune,docker container prune 镜像、容器的删除)

3. 安装portainer
docker run -d -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:linux-arm64

4. 安装Homeassiatant
docker run -d -p 8123:8123 --name homeassistant --restart=always -v homeassistant_data:/data homeassistant/aarch64-homeassistant:latest

5. 解决nextcloud文本文档中文乱码问题
nano /var/www/html/apps/files_texteditor/lib/Controller/FileHandlingController.php

$encoding= mb_detect_encoding($fileContents. 'a', 'UTF-8, GB2312, GBK, WINDOWS-1252, ISO-8859-15, ISO-8859-1, ASCII', true)
上句加入GB2312和GBK编码支持即可

6. 禁用讨厌的ttyS0日志提示
sudo systemctl disable serial-getty@ttyS0
Removed /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service.

7. 查找某个文件,例如
sudo find / -name 'frps.ini'
cat /proc/sys/net/ipv4/ip_forward  查看ip转发是否开启,返回为1则开启
8.清理ubuntu垃圾

sudo apt-get autoclean --清理旧版本的软件缓存

sudo apt-get clean--清理所有软件缓存

sudo apt-get autoremove--删除系统不再使用的孤立软件

这三个命令主要清理升级缓存以及无用包的。
9. hostapd -dd /etc/hostapd/hostapd.conf   显示hostapd的相关信息

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-6-21 16:45 | 显示全部楼层
本帖最后由 tinylion 于 2019-7-2 15:45 编辑

coreelec 相关

1. 安装entware
installentware  需要梯子,然后重启
卸载 rm -rf /opt/*  ,然后重启

2. 安装vsftpd
opkg install vsftpd-ext
opkg install curl --force-overwrite 强行安装包ipk包

http://bin.entware.net/aarch64-k3.10/   Coreelec用到的软件包
3. 检查当前是否跑在1000M
ethtool eth0 看speed项是否为1000
ethtool -s eth0 speed 1000 duplex full autoneg off 设置为1000

编译相关


1. 编译openwrt 18.06.2
git clone https://github.com/openwrt/openwrt.git && cd openwrt
git tag
git checkout v18.06.2
./scripts/feeds update -a
./script/feeds install -a

make menuconfig
make  -j4 V=s

修改内核参数(比如开启大内存支持,多核心支持):make kernel_menuconfig







我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-7-1 16:17 | 显示全部楼层
本帖最后由 tinylion 于 2019-7-1 21:22 编辑

N1做纯AP(小狮子想实现AP和主路由或旁路由同网段)

主要参考几位大神的帖子
http://www.manongjc.com/detail/6-cahueeaayragwvv.html
https://www.right.com.cn/forum/forum.php?mod=viewthread&tid=385337&ordertype=1
https://injoy.work/archives/858db735.html

1. apt-get install hostapd rng-tools

2. nano /etc/default/hostapd
去掉前面#,改 DAEMON_CONF="/etc/hostapd.conf" 为 DAEMON_CONF="/etc/hostapd/hostapd.conf"
3. nano /etc/hostapd/hostapd.conf
贴入如下代码
  1. #
  2. # armbian hostapd configuration example
  3. #
  4. # nl80211 mode
  5. #

  6. interface=wlan0
  7. hw_mode=g
  8. channel=44
  9. bridge=br0
  10. driver=nl80211

  11. logger_syslog=0
  12. logger_syslog_level=0
  13. wmm_enabled=1
  14. wpa=2
  15. preamble=1

  16. wpa_psk=66eb31d2b48d19ba216f2e50c6831ee11be98e2fa3a8075e30b866f4a5ccda27
  17. wpa_passphrase=12345678
  18. wpa_key_mgmt=WPA-PSK
  19. wpa_pairwise=TKIP
  20. rsn_pairwise=CCMP
  21. auth_algs=1
  22. macaddr_acl=0

  23. noscan=1

  24. ## IEEE 802.11n
  25. ieee80211n=1
  26. ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]
  27. country_code=CN
  28. ieee80211d=1
  29. ## IEEE 802.11n

  30. ## IEEE 802.11a
  31. hw_mode=a
  32. ## IEEE 802.11a

  33. ### IEEE 802.11ac
  34. ieee80211ac=1
  35. vht_capab=[MAX-MPDU-3895][SHORT-GI-80][SU-BEAMFORMEE]
  36. vht_oper_chwidth=1
  37. vht_oper_centr_freq_seg0_idx=42
  38. basic_rates=60 90 120 180 240 360 480 540
  39. disassoc_low_ack=0
  40. ssid=N1
  41. ### IEEE 802.11ac

  42. # controlling enabled
  43. ctrl_interface=/var/run/hostapd
  44. ctrl_interface_group=0
复制代码


4. nano /etc/network/interface贴入如下代码:
  1. source /etc/network/interfaces.d/*

  2. auto lo br0
  3. iface lo inet loopback   # wireless wlan0
  4. allow-hotplug wlan0
  5. iface wlan0 inet manual   # eth0 connected to the ISP router
  6. allow-hotplug eth0
  7. iface eth0 inet manual   # Setup bridge  
  8. iface br0 inet static
  9.     bridge_ports wlan0 eth0
  10.     address 192.168.2.99
  11.     netmask 255.255.255.0
  12.     network 192.168.2.0
  13.     ## isp router ip, 192.168.2.2 also runs DHCPD ##
  14.     gateway 192.168.2.2
  15.     dns-nameservers 192.168.2.2
复制代码

DHCP服务器,IP地址为192.168.2.2提供(改为自己主路由或旁路提供DHCP的路由器地址就好,比如K2P,K3的地址)
本台AP的地址是192.168.2.99,参照代码自己改。

5. reboot    然后会看到WIFI名称为N1,输入密码12345678,连接成功,顺利上网。



我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 10:36 | 显示全部楼层
1111111111
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 10:36 | 显示全部楼层
ffff
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 10:44 | 显示全部楼层
不明学厉😊
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 10:50 | 显示全部楼层
40多个,想干嘛,不过N1的确能折腾
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 10:50 | 显示全部楼层
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 10:51 | 显示全部楼层
学习一下                                          
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 11:00 | 显示全部楼层
不错不错,我也剁了十几个p1,试过一圈各种固件软件后,还是觉得直接上docker最方便快捷,想用什么直接pull就可以了,再加个portainer管理镜像,完美!

点评

哈哈,兄弟,同道中人哈, 的确,现在迷上docker了,想装什么就装什么,想干掉什么就干掉什么, 系统干净  详情 回复 发表于 2019-6-21 11:04
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-6-21 11:04 | 显示全部楼层
jdpnews 发表于 2019-6-21 11:00
不错不错,我也剁了十几个p1,试过一圈各种固件软件后,还是觉得直接上docker最方便快捷,想用什么直接pull ...

哈哈,兄弟,同道中人哈,
的确,现在迷上docker了,想装什么就装什么,想干掉什么就干掉什么,
系统干净

点评

docker系统开销比直接安装大50%左右吧?对于性能要求高的应用,可能带不起来?小狮子测试过吗?求教。  详情 回复 发表于 2019-6-21 23:07
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 11:08 | 显示全部楼层
学习一下     
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 11:20 来自手机 | 显示全部楼层
感谢分享感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 11:22 | 显示全部楼层

学习一下  
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 11:22 | 显示全部楼层
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 11:25 | 显示全部楼层
感谢收集分享  收藏学习了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-6-21 11:28 | 显示全部楼层
学习,感谢分享!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 19:09

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表