15AH, San Francisco

California, United States.

Send Your Mail At:

tianyingkejishe@sina.cn

Working Hours

Mon-Sat: 9.30am To 7.00pm

归档标题

Autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et dolore feugait.

月度归档 8月 27, 2024

【n2n】N2N参数讲解

一、supernode

sudo nohup supernode -l 7443 -v &

注:supernode需要运行在公网上。使用nobup后台运行,-l 7443监听7443端口,-v用于输出日志,便于调试。 查看日志tail -f nohup.out

二、edgenode

edge -a 10.233.233.1 -c N2NNetwork -k 85f7a0affa50d933485a215eb10fb921 -l 106.53.85.19:7443 -p 3447 -m 16:0c:98:c8:b7:92

edge -a 10.233.233.2 -c N2NNetwork -k 85f7a0affa50d933485a215eb10fb921 -l 106.53.85.19:7443 -p 3447 -m 6e:30:77:c9:4f:bf

edge -a 10.233.233.3 -c N2NNetwork -k 85f7a0affa50d933485a215eb10fb921 -l 106.53.85.19:7443 -p 3447 -m 82:e9:fc:be:e9:a7

参数说明:

  • “-a <IP地址>”选项(静态地)指定了分配给 TAP 接口的 VPN 的 IP 地址。如果你想要使用 DHCP,你需要在其中一台边缘节点上配置一台 DHCP 服务器,然后使用“-a dhcp:0.0.0.0”选项来代替。
  • “-c <组名>”选项指定了 VPN 组的名字(最大长度为 16 个字节)。这个选项可以被用来在同样一组节点中创建多个 VPN。
  • “-k <密钥>”选项指定了一个由 twofish 加密的密钥来使用。如果你想要将密钥从命令行中隐藏,你可以使用 N2N_KEY 环境变量。
  • “-l <IP地址:端口>”选项指定了超级节点的监听 IP 地址和端口号。为了冗余,你可以指定最多两个不同的超级节点(比如 -l <超级节点 A> -l <超级节点 B>)。
  • “-p <端口>” 边缘节点暴露端口
  • “-m ”给 TAP 接口分配了一个静态的 MAC 地址。不使用这个参数的话,edge 命令将会随机生成一个 MAC 地址。事实上,为一个 VPN 接口强制指定一个静态的 MAC 地址是被强烈推荐的做法。否则,比如当你在一个节点上重启了 edge 守护程序的时候,其它节点的 ARP 缓存将会由于新生成的 MAC 地址而遭到污染,它们将不能向这个节点发送数据,直到被污染的 ARP 记录被消除。

注:以上3条命令为三台机器上执行的,其中10.233.233.1,运行在supernode节点上,另外其中ip自定义,但是需要注意别与需要组网的机器中的IP冲突了,不然会找不到路由!

【phy】yt8521 phy芯片驱动移植

1、准备驱动文件

2、添加到相应目录

把motorcomm.c、yt8614-phy.h放到Linux的linux-5.19.1/drivers/net/phy/

把motorcomm_phy.h放到Linux的linux-5.19.1/include/linux/

3、修改Makefile

增加:obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm.o

4、修改Kconfig

增加:

config MOTORCOMM_PHY
        tristate "Motorcomm PHYs"
        help
          Enables support for Motorcomm network PHYs.
          Currently supports the YT8511 gigabit PHY.

【armbian】国内编译提高速度

一、更新dockers配置文件Dockerfile

修改文件:lib/functions/host/docker.sh

修改内容:修改容器内pip国内源

二、配置代码分支分支

修改文件:./config/boards/orangepizero2w.csc

修改内容:

三、修改代码源

修改文件:lib/functions/configuration/main-config.sh

修改内容:

四、编译配置参数

./compile.sh build BOARD=orangepizero2w BRANCH=current BUILD_DESKTOP=no BUILD_MINIMAL=no KERNEL_CONFIGURE=yes RELEASE=jammy UBOOT_MIRROR=gitee  DOWNLOAD_MIRROR=china REGIONAL_MIRROR=china MAINLINE_MIRROR=bfsu GHCR_MIRROR=dockerproxy GITHUB_MIRROR=ghproxy


五、内核配置快捷方式

 [ It still works, but please prefer the new way. First, run './compile.sh BOARD=orangepizero2w BRANCH=current kernel-config'; then commit your changes; then build the image as normal. This workflow ensures consistent hashing results. ]

六、内核定制

./compile.sh BOARD=orangepizero2w BRANCH=current kernel-config

七、uboot定制

./compile.sh BOARD=orangepizero2w BRANCH=current uboot-config

【vscode】vue3+vscode+element

1、安装node

下载nodejs,当前最新版本是 node 16.8

国外下载地址:https://nodejs.org/en

国内下载地址:http://nodejs.cn/download

下载完成之后双击文件【node-v16.8.0-x64.msi】安装。nodejs全局环境变量配置参考 https://www.cnblogs.com/yyee/p/15209612.html

检查nodejs是否安装:

node -v

如果未安装nodejs,照下步骤安装:

2、设置镜像,提高npm安装软件的速度。

pnpm get registry

pnpm config set registry https://registry.npmmirror.com/

pnpm config set registry https://registry.npmjs.org/

pnpm get registry

3、安装pnpm

npm install -g pnpm -registry=https://registry.npmmirror.com/

4、查看端口占用

npm run dev –port 端口号

【lx2160】How to dynamically adjust MC log level using restool

Prerequisites: The board should be running Linux and connected to terminal console.

Note: For log level debug support, the restool version should be LSDK-2003-RC1 or above and MC version should be 10.20.0 or above.

To check restool version:

$ root@localhost:~# restool -v
restool LSDK-20.04

To check MC version:

root@localhost:~# restool -m
MC firmware version: 10.24.0

For debugging, use the ls-debug script available in the LSDK rootfs. There is no need to create the debug object.

ls-debug -h 
-h, –helpls-debug help information
-ts, –timestamp=XEnable/Disable timestamp printing, X is ON or OFF
-c, –console=XEnable/Disable printing in UART console, X is ON or OFF
-l, –log=XEnable/Disable printing in DDR log, X is ON or OF
-u, –uart=XSet UART ID of the console, X = [0 – 4], 0 = OFF
-ll, –level=XSet logging level, X = [0 – 5]0: Global1: Debug2: Info3: Warning4: Error5: Critical
-m, mem, –memoryDump information about memory modules available
dpxy.zDump information about MC respective object

For example, to enable logging in console with log level INFO:

$ ls-debug --log=on --console=on --level=2              
dpdbg.0 created
DDR log printing ON
UART console printing ON
Log level set to 2
$ root@localhost:~# ls-debug --memory
Memory dumped information available in MC log/console
$ root@localhost:~# cat `find /dev/ -name "*mc_console"`
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_get_obj for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dpdbg_open on DPDBG
[I, RESMAN]  Handling command: dpdbg_dump on DPDBG
[I, DPNI]  Memory info:
[I, DPNI]  MC DDR #1 cacheable memory
[I, DPNI]        Total: 134217728 bytes
[I, DPNI]        Used: 14802708 bytes
[I, DPNI]        Free: 119415020 bytes
[I, DPNI]  MC DDR #1 non-cacheable memory
[I, DPNI]        Total: 50331648 bytes
[I, DPNI]        Used: 27680 bytes
[I, DPNI]        Free: 50303968 bytes
[I, DPNI]  DMEM1 memory
[I, DPNI]        Total: 81920 bytes
[I, DPNI]        Used: 27168 bytes
[I, DPNI]        Free: 54752 bytes
[I, DPNI]  DMEM2 memory
[I, DPNI]        Total: 81920 bytes
[I, DPNI]        Used: 27168 bytes
[I, DPNI]        Free: 54752 bytes
[I, DPNI]  DDR #1 memory
[I, DPNI]        Total: 1610612736 bytes
[I, DPNI]        Used: 143163392 bytes
[I, DPNI]        Free: 1467449344 bytes
[I, DPNI]  PEB memory
[I, DPNI]        Total: 2097152 bytes
[I, DPNI]        Used: 524288 bytes
[I, DPNI]        Free: 1572864 bytes
[I, DPNI]  DP-DDR memory
[I, DPNI]        Total: 4294967296 bytes
[I, DPNI]        Used: 0 bytes
[I, DPNI]        Free: 4294967296 bytes
[I, RESMAN]  Handling command: dpdbg_close on DPDBG
[I, RESMAN]  Handling command: dprc_close for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_set_irq_mask for DPRC 1 on portal id 0
[I, RESMAN]  Handling command: dprc_set_irq_enable for DPRC 1 on portal id 0
root@localhost:~#