2020
+2020
2020
Ushio V2ray 使用方法。
Ushio V2ray Instruction..
流程总览
- 用户注册
- v2ray软件安装
用户注册
在开始安装软件前,请先前往https://v2ray.yimian.xyz/使用手机号进行账户注册。
v2ray软件安装
本文包含Win10,安卓,IOS/Ipad OS的软件安装方法,请根据相应流程进行安装。
如果您有任何疑惑,请在下方评论中提出!
Win10
下载
- 使用浏览器访问http://eee.dog/8bcc14下载名为
Windows_v2rayN-Core.zip
的压缩文件。
解压
将下载的压缩文件解压到C盘根目录,如下图
如果提示需要管理员权限,请一律选是
配置
请打开C盘中刚才解压的文件夹,找到名为
V2ray
或V2rayN.exe
的程序,双击打开。如下图。找到右下角任务栏,找到下图中的图标,双击打开
选中窗口上方的订阅,点击订阅设置如下图
打开https://v2ray.yimian.xyz并登录,待出现二维码后点击Copy。如下图
回到订阅设置的窗口,将刚才复制的内容粘贴到地址URL框中,勾选启用,点击确定。如下图
点击主窗口上方的参数设置如下图
- 选择V2rayN设置,勾选开机自动启动,点击下方确定。如下图
- 回到主窗口,点击更新订阅如下图
此时,主窗口中会多出一个或几个服务器,如下图
关闭主窗口,右键右下角状态栏中的V2ray,选择服务器->Vmess-Los_Angeles(….。如下图
右键右下角状态栏中的V2ray,选择Http代理->…(PAC模式)。如下图
验证
- 浏览器打开https://google.com试一下能否访问。
Android
下载安装软件
- 浏览器打开http://eee.dog/6db2e3下载V2ray安卓安装包
- 点开安装包进行安装
配置
- 使用手机浏览器,打开https://v2ray.yimian.xyz/,进行登录
- 待页面显示出二维码,点击Copy
- 打开安装的V2rayNG软件,点击左上角三条杠,展开左侧栏,点击订阅设置
- 进入订阅设置页面后,点击右上角加号
- 备注中填ushio, 地址url中填刚才复制的东西,点击右上角对勾。
- 回到主页面,点击左上角三条杠,展开左侧栏,点击设置
- 进入设置页面后,点击分应用代理
- 勾选分应用代理模式,然后在列表中勾选需要访问外网的app,如twitter, youtube等
- 回到主页面,点击右上角三个点,点击更新订阅
- 点一下主页面列表中的Los_Angeles,使其左侧变绿
- 点击主页面右下角的V图标,使其变绿
验证
- 点击主页面下方已连接,点击测试连接语句,检测连接是否成功
Ios
- 在系统设置中更改苹果账户的地区到中国大陆以外的地方,比如英国、美国等。
- 在app store购买并安装Shadowrocket软件
- 使用浏览器打开https://v2ray.yimian.xyz,进行登录
- 待页面显示出二维码,点击Copy
- 打开Shadowrocket软件
- 点击右上角加号
- 类型选择Subscribe
- URL中粘贴刚才复制的东西
- 点击右上角完成
- 点击首页中的api.yimian.xyz,点击Los_Angeles
- 在首页第一行,勾选Los_Angeles
- 使用浏览器访问https://google.com试一下
Process overview
- User registration
- v2ray software installation
User registration
Before installing the software, please go to https://v2ray.yimian.xyz/ to register with your mobile phone number.
v2ray software installation
This article contains software installation methods for Win10, Android, IOS/Ipad OS, please install according to the corresponding process.
Win10
download
- Use a browser to visit http://eee.dog/8bcc14 and download the name
Windows_v2rayN-Core.zip
The compressed file.
Unzip
Decompress the downloaded compressed file to the root directory of drive C, as shown below
If you are prompted to require administrative permissions, please select all yes
Configuration
Please open the folder just unzipped in the C drive, find the program named
V2ray
orV2rayN.exe
, and double-click to open it. As shown below.Find the taskbar in the lower right corner, find the icon in the figure below, double-click to open
Select Subscription at the top of the window, and click Subscription Settings as shown below
Open https://v2ray.yimian.xyz and log in. After the QR code appears, click Copy. As shown below
Go back to the subscription settings window, paste the content you just copied into the Address URL box, check Enable, and click OK. As shown below
Click Parameter Settings at the top of the main window as shown below
- Select V2rayN Settings, tick Autostart at boot, and click OK below. As shown below
- Back to the main window, click Update Subscription as shown below
At this time, there will be one or more servers in the main window, as shown below
Close the main window, right-click V2ray in the status bar at the bottom right corner, and select Server->Vmess-Los_Angeles(….. As shown below
Right-click V2ray in the status bar at the bottom right corner, and select Http Proxy->…(PAC Mode). As shown below
verification
- Open https://google.com in your browser to check if you can access it.
Android
Download and install software
- Open the browser http://eee.dog/6db2e3 to download the V2ray Android installation package
- Click to open the installation package to install
Configuration
- Use your mobile browser to open https://v2ray.yimian.xyz/ and log in
- When the QR code is displayed on the page, click Copy
- Open the installed V2rayNG software, click the three bars in the upper left corner, expand the left column, and click Subscription Settings
- After entering the subscription settings page, click the plus sign in the upper right corner
- Fill in ushio in the remarks, fill in the things you just copied in the address url, and click the tick in the upper right corner.
- Back to the main page, click the three bars in the upper left corner, expand the left column, and click Settings
- After entering the settings page, click Sub App Proxy
- Check the Sub App Proxy mode, and then check the apps that need to access the Internet, such as twitter, youtube, etc.
- Back to the main page, click the three dots in the upper right corner, and click Update Subscription
- Tap Los_Angeles in the main page list to make the left side green
- Click the V icon in the lower right corner of the main page to make it green
verification
- Click Connected at the bottom of the main page, click the test connection statement to check whether the connection is successful
Ios
- Change the Apple account area in the system settings to a place outside of mainland China, such as the United Kingdom, the United States, etc.
- Purchase and install Shadowrocket software in the app store
- Use a browser to open https://v2ray.yimian.xyz and log in
- When the QR code is displayed on the page, click Copy
- Open the Shadowrocket software
- Click the plus sign in the upper right corner
- Type selection Subscribe
- Paste what you just copied in the URL
- Click on the upper right corner to finish
- Click api.yimian.xyz on the homepage, click Los_Angeles
- On the first line of the homepage, check Los_Angeles
- Use a browser to visit https://google.com to try
本文将讨论wiot项目下一步的发展目标与实施方法。
This article will discuss the next development goals and implementation methods of the Wiot project.
wIoT
wiot,一个基于NodeJS的分布式物联网操作系统。
项目简介
立项初衷
本项目旨在帮助不熟悉固件编程的网络开发者实现出自己的物联网应用。
在开发传统的物联网程序时,我们需要一次又一次的编写,烧录,调试每一个开发板,以某种方式将其相连结,以提供某种服务。这样的方式非常繁琐,开发成本和门槛都比较高。此外,古老的C和C++语言缺少成熟的依赖管理工具,以至于我们在编写开发板时难以像开发python或nodeJS程序一样轻松便捷。
本项目试图提供一种方法,将烧录,调试开发板的流程自动化,并将逻辑编写的步骤移动到远程计算机的NodeJS界面上。通过此方式,我们进而得以将分布式物联网节点的功能进行集中化管理。此外,借助NodeJS成熟的依赖管理器npm,使得物联网应用的开发更加便捷高效。
至此,下到每一个物联网节点,上到各种类型的数据库、用户终端,都可以在同一个nodeJS界面上配置、操作。开发者将能够专注于物联网逻辑的开发,实现出更加丰富多彩的物联网应用。
第一轮开发
第一轮开发完成于2019.5,详见这篇博客
实现了对D1 MINI开发板对nodeJS的pin口映射,并支持诸如ota等一系列功能。
第二轮开发
待进行,计划当做FYP项目
支持的开发版
实现方法
通过提供标准化的单片机固件以及自动化的烧录工具,wiot将各开发板的pin口功能进行抽象,整理,并映射为可调用的NodeJS接口。
如上图所示,wiot架构主要包含三部分:Node节点,wiot Cloud Module云模块,wiot cli命令行程序。其中,Node节点为烧录好wiot固件的NodeMCU单片机,他们通过IEEE 802.11 WiFi进行分布式通信,并于某个节点接入路由器以连接wiot云模块。用户在自己的PC上使用NodeJS调用wiot依赖编写物联网程序。完成后,用户使用wiot cli对开发好的程序进行检查、测试和部署。被部署的物联网程序将运行在wiot云模块上,并可使用nodeJS的接口与其它云服务或数据库进行交互。
Node节点
Node节点使用的是NodeMCU开发板(基于ESP8266的扩展板)。在使用wiot-cli烧录wiot固件后,NodeMCU将成为wiot节点。
模式
wiot节点有四种模式:master模式、slave模式、bridge模式和debug模式。此模式只能在烧录固件时配置。master模式和bridge模式下,nodeMCU将同时开启STA和AP模式。slave模式下则只开启STA模式。master需要有稳定且无限制的电源供电,其功率较大(包含RSA, 协议转换等),不适合低功耗场景。bridge与slave则可以灵活调整功率,可用于低功耗场景。
debug模式下节点工作在STA和AP模式,用户可以使用手机等设备连接到此节点,并打开根目录网页。网页上将实时显示此节点当前所处位置的各种信息,比如收到各其它节点的信号强度等,适用于挑选部署场景。
低功耗
wiot节点支持低功耗(Low Power)状态。但此状态仅能在slave模式和bridge下开启。此状态可通过wiot api或者wiot-cli进行开启或关闭。低功耗状态由esp8266睡眠功能实现。此状态下可由干电池供电工作数年[1]。
组网
wiot节点使用分布式组网。在路由器信号较强的地方,master节点将接入路由器WiFi网络,并桥接。在路由器信号不强的地方,每一个节点都会找到信号最强的另一个上游的master或bridge节点,并桥接(slave除外)。
如上图,两个距离路由器近的master节点自动接入到路由器wifi。下游的其它节点分别连接至信号最强的上游节点。
认证
wiot节点支持使用射频指纹识别[2]来实现下游通信认证。此方法使用esp8266的RSSI函数以及scan返回参数。在下游设备试图接入网络时,上游设备将搜集指纹信息并向服务器汇报。服务器将指纹与数据库存储的先前版本进行比对,并作出是否允许入网的决策。
云模块
云模块充当wiot的云部分,提供云的功能。云模块能够守护运行run-time状态下的wiot程序。此外,云模块还能够提供测试,部署等功能。云模块使用Docker进行虚拟化。
命令行程序
即wiot-cli。是wiot在开发者终端上提供的操作工具集。通过wiot-cli,开发者可以实现对wiot程序的测试,部署,恢复等功能。此外,wiot-cli也支持一系列debug等常用功能。详见下方wiot-cli命令
。
用户操作步骤
- 用户下载安装并配置好NodeJS环境。
- 用户通过命令行运行
npm i -g wiot-cli
指令安装wiot命令行工具 - 用户运行命令
wiot init my-wiot-proj
在当前目录新建并配置一个wiot项目文件夹,项目名称为my-wiot-proj。此时,会提示用户填写此项目的一些信息,比如项目描述,作者信息,路由器WiFi账户密码,wiot云模块地址,项目主脚本等。 - 用户进入到项目目录,将nodeMCU通过数据线连接到电脑,运行
wiot node init my-first-node [--type=<master|slave|bridge|debug>]
。这将自动配置并将wiot固件烧录到nodeMCU开发板,并将其命名为my-first-node。type为可选参数,可设置为master
或slave
或bridge
或debug
,默认为master
。 - 依次按照此方法烧录好所有的开发板,将其部署在生产环境。
- 在项目文件夹运行指令
wiot status
查看是否所有节点均已在线。如果没有,使用指令wiot log
配合grep
工具查找日志定位问题。 - 从项目主脚本(默认是
index.js
)开始编写你的wiot程序。 - 使用指令
wiot check
检查你wiot程序的逻辑问题。 - 使用指令
wiot test
将挂起云模块中正在运行的程序,并运行当前项目文件夹中的程序。此时,所有控制台输出将显示在你的命令行窗口。使用Ctrl+C
终止当前测试并恢复云模块先前的程序。 - 使用指令
wiot push
将本地的wiot程序部署到云端。
其它操作
部署自己的wiot云模块
默认使用wiot官方wiot云模块。你也可以部署自己的wiot云服务,方法如下:
安装docker并运行指令docker run -d --name=wiot-cloud -p 3594:3594 -v /var/wiot/data/:/var/wiot/data/ iotcat/wiot
。
wiot-cli命令
wiot help [command]
查看帮助wiot clone <host:user/project>
将项目从云模块克隆到本地wiot pull
使用远程代码覆盖本地代码wiot push
将当前文件夹wiot程序部署到云模块wiot ls
显示当前所有节点wiot map [nodeID]
显示某节点的连接路径wiot log [nodeID] [--head=<number>|--tail=<number>]
查看某节点的日志wiot stop
停止wiot服务wiot start
开启wiot服务wiot restart
重启wiot服务wiot reload
在不重置flash变量情况下重启wiot服务wiot init <name>
新建并初始化wiot项目文件夹wiot node init <node-name> [--type=<master|slave|bridge|debug>]
配置并烧录nodeMCU开发板wiot check
检查当前文件夹项目逻辑问题。wiot test
将挂起云模块中正在运行的程序,并运行当前项目文件夹中的程序。此时,所有控制台输出将显示在你的命令行窗口。使用Ctrl+C
终止当前测试并恢复云模块先前的程序。wiot status [nodeID]
显示当前项目或节点状态信息wiot debug start
终止当前云端程序并进入debug模式wiot debug set <nodeID> <pinID> <0-255>
debug模式下设置某个节点pin的PWM输出值wiot debug reset <nodeID>
debug模式下重置某个节点的数据存储,并重连wiot debug get <nodeID> <pinID>
debug模式下获取某个节点pin的PWM值wiot debug sleep <nodeID> <pinID> <HIGH|LOW>
debug模式下设置某节点轻度休眠,直到被某pin的高或低电平唤醒wiot debug dsleep <nodeID> <millisecond>
debug模式下设置某节点深度休眠多少毫秒wiot debug reconnect [nodeID]
debug模式下重新组网或断开重连某个节点wiot debug setphymode <nodeID> <b|g|n>
debug模式下配置节点WiFi协议为802.11b|g|n
···
常用API
待设计,请参考一轮开发wiot文档
wIoT
Wiot, a distributed IoT operating system based on NodeJS.
Project Description
The original intention of the project
This project aims to help web developers who are not familiar with firmware programming to implement their own IoT applications.
When developing traditional Internet of Things programs, we need to write, burn, and debug each development board again and again, and connect them in a certain way to provide a certain service. This method is very cumbersome, and the development cost and threshold are relatively high. In addition, the ancient C and C++ languages lack mature dependency management tools, so that it is difficult for us to write development boards as easy and convenient as developing python or nodeJS programs.
This project is trying to provide a method to automate the process of burning and debugging the development board, and move the steps of logic writing to the NodeJS interface of the remote computer. In this way, we are able to centrally manage the functions of distributed IoT nodes. In addition, with NodeJS’s mature dependency manager npm, the development of IoT applications is more convenient and efficient.
So far, down to every IoT node, up to various types of databases and user terminals, all can be configured and operated on the same nodeJS interface. Developers will be able to focus on the development of IoT logic and realize more colorful IoT applications.
First round of development
The first round of development was completed in May 2019, please refer to this blog
Realize the pin port mapping of D1 MINI development board to nodeJS, and support a series of functions such as ota.
Second round of development
To be carried out, plan as FYP project
Supported development version
Implementation
By providing standardized microcontroller firmware and automated burning tools, wiot abstracts, organizes, and maps the pin port functions of each development board into a callable NodeJS interface.
As shown in the figure above, the wiot architecture mainly consists of three parts: Node node, wiot Cloud Module, and wiot cli command line program. Among them, the Node node is the NodeMCU microcontroller with the wiot firmware burned. They use IEEE 802.11 WiFi for distributed communication, and connect to a router at a node to connect to the wiot cloud module. Users use NodeJS to call Wiot on their own PCs and rely on writing IoT programs. After completion, the user uses wiot cli to check, test and deploy the developed program. The deployed IoT program will run on the wiot cloud module, and can use the nodeJS interface to interact with other cloud services or databases.
Node node
Node node uses NodeMCU development board (expansion board based on ESP8266). After using wiot-cli to burn the wiot firmware, NodeMCU will become a wiot node.
Mode
Wiot nodes have four modes: master mode, slave mode, bridge mode and debug mode. This mode can only be configured when burning firmware. In master mode and bridge mode, nodeMCU will enable STA and AP mode at the same time. In slave mode, only STA mode is enabled. The master needs to have a stable and unlimited power supply, which has a large power and is not suitable for low power consumption scenarios. Bridge and slave can flexibly adjust power, which can be used in low power consumption scenarios.
In debug mode, the node works in STA and AP mode. Users can use mobile phones and other devices to connect to this node and open the root directory webpage. The web page will display various information about the current location of this node in real time, such as the signal strength received from other nodes, which is suitable for deployment scenarios.
Low power
Wiot nodes support Low Power state. But this state can only be opened in slave mode and bridge. This state can be turned on or off through wiot api or wiot-cli. The low power consumption state is realized by the sleep function of esp8266. In this state, it can be powered by dry batteries for several years [1].
Networking
Wiot nodes use distributed networking. Where the router signal is strong, the master node will access the router WiFi network and bridge it. Where the router signal is not strong, each node will find another upstream master or bridge node with the strongest signal and bridge it (except slave).
As shown in the figure above, the two master nodes close to the router are automatically connected to the router wifi. The other downstream nodes are respectively connected to the upstream node with the strongest signal.
Certification
Wiot nodes support the use of RF Fingerprint Recognition[2] to achieve downstream communication authentication. This method uses the RSSI function of esp8266 and scan return parameters. When the downstream device attempts to access the network, the upstream device will collect fingerprint information and report to the server. The server compares the fingerprint with the previous version stored in the database and makes a decision whether to allow access to the network.
Cloud Module
The cloud module acts as the cloud part of Wiot and provides cloud functions. The cloud module can guard the wiot program running in the run-time state. In addition, the cloud module can also provide functions such as testing and deployment. The cloud module uses Docker for virtualization.
Command Line Program
That is wiot-cli. It is a set of operation tools provided by Wiot on the developer terminal. Through wiot-cli, developers can implement functions such as testing, deploying, and restoring wiot programs. In addition, wiot-cli also supports a series of common functions such as debug. See the wiot-cli command
below for details.
User operation steps
- The user downloads, installs and configures the NodeJS environment.
- The user runs the command
npm i -g wiot-cli
through the command line to install the wiot command line tool - The user runs the command
wiot init my-wiot-proj
to create and configure a wiot project folder in the current directory, the project name is my-wiot-proj. At this point, the user will be prompted to fill in some information about this project, such as project description, author information, WiFi account password, wiot cloud module address, project main script, etc. - The user enters the project directory, connects the nodeMCU to the computer through the data cable, and runs
wiot node init my-first-node [--type=<master|slave|bridge|debug>]
. This will automatically configure and burn the Wiot firmware to the nodeMCU development board and name it my-first-node. type is an optional parameter, which can be set tomaster
orslave
orbridge
ordebug
, and the default ismaster
. - Follow this method to burn all the development boards and deploy them in the production environment.
- Run the command
wiot status
in the project folder to see if all nodes are online. If not, use the commandwiot log
with thegrep
tool to find the log location problem. - Start writing your wiot program from the main project script (default is
index.js
). - Use the command
wiot check
to check the logic of your wiot program. - Use the command
wiot test
to suspend the running program in the cloud module and run the program in the current project folder. At this point, all console output will be displayed in your command line window. UseCtrl+C
to terminate the current test and restore the previous program of the cloud module. - Use the command
wiot push
to deploy the local wiot program to the cloud.
Other operations
Deploy your own wiot cloud module
Install docker and run the command docker run -d --name=wiot-cloud -p 3594:3594 -v /var/wiot/data/:/var/wiot/data/ iotcat/wiot
.
wiot-cli command
wiot help [command]
view helpwiot clone <host:user/project>
to clone the project from the cloud module to the localwiot pull
uses remote code to overwrite local codewiot push
deploys the current folder wiot program to the cloud modulewiot ls
shows all current nodeswiot map [nodeID]
shows the connection path of a nodewiot log [nodeID] [--head=<number>|--tail=<number>]
view the log of a nodewiot stop
stop wiot servicewiot start
to start wiot servicewiot restart
restart wiot servicewiot reload
restarts the wiot service without resetting the flash variablewiot init <name>
creates and initializes the wiot project folderwiot node init <node-name> [--type=<master|slave|bridge|debug>]
configure and burn nodeMCU development boardwiot check
checks the current folder project logic problem.wiot test
will suspend the running program in the cloud module and run the program in the current project folder. At this point, all console output will be displayed in your command line window. UseCtrl+C
to terminate the current test and restore the previous program of the cloud module.wiot status [nodeID]
displays current project or node status informationwiot debug start
terminates the current cloud program and enters debug modewiot debug set <nodeID> <pinID> <0-255>
Set the PWM output value of a node pin in debug mode- In
wiot debug reset <nodeID>
debug mode, reset the data storage of a node and reconnect wiot debug get <nodeID> <pinID>
get the PWM value of a node pin in debug modewiot debug sleep <nodeID> <pinID> <HIGH|LOW>
debug mode to set a node to lightly sleep until it is awakened by a pin’s high or low levelwiot debug dsleep <nodeID> <millisecond>
set how many milliseconds a node deeply sleeps in debug mode- In
wiot debug reconnect [nodeID]
debug mode, reconnect to the network or disconnect and reconnect to a node
Common API
]]>To be designed, please refer to One-round development wiot document
本文将讨论wiot项目下一步的发展目标与实施方法。
This article will discuss the next development goals and implementation methods of the Wiot project.
wIoT
wiot,一个基于NodeJS的分布式物联网操作系统。
项目简介
立项初衷
本项目旨在帮助不熟悉固件编程的网络开发者实现出自己的物联网应用。
在开发传统的物联网程序时,我们需要一次又一次的编写,烧录,调试每一个开发板,以某种方式将其相连结,以提供某种服务。这样的方式非常繁琐,开发成本和门槛都比较高。此外,古老的C和C++语言缺少成熟的依赖管理工具,以至于我们在编写开发板时难以像开发python或nodeJS程序一样轻松便捷。
本项目试图提供一种方法,将烧录,调试开发板的流程自动化,并将逻辑编写的步骤移动到远程计算机的NodeJS界面上。通过此方式,我们进而得以将分布式物联网节点的功能进行集中化管理。此外,借助NodeJS成熟的依赖管理器npm,使得物联网应用的开发更加便捷高效。
至此,下到每一个物联网节点,上到各种类型的数据库、用户终端,都可以在同一个nodeJS界面上配置、操作。开发者将能够专注于物联网逻辑的开发,实现出更加丰富多彩的物联网应用。
第一轮开发
第一轮开发完成于2019.5,详见这篇博客
实现了对D1 MINI开发板对nodeJS的pin口映射,并支持诸如ota等一系列功能。
第二轮开发
待进行,计划当做FYP项目
架构想法
在设计物联网系统时,我一直有一个愿景。历史必然性。打造手足。
wiot的目标是提供一套
系统架构在分类上分为静态的环境和动态的用户。实现上分为模块,服务和程序。
模块
类似于计算机操作系统中的驱动,模块负责将物理层面上的各种功能,比如led照明,抽象为操作系统层面的标准接口。
服务
服务是运行在边缘的docker中的守护进程。开发者通过调用模块,实现编写服务,实现各种各样的标准功能。
程序
程序是由用户定义的一套自定义逻辑,用于打造自定义场景。结合地理围栏公共服务LIS,调用环境服务提供的标准接口。
支持的开发版
实现方法
通过提供标准化的单片机固件以及自动化的烧录工具,wiot将各开发板的pin口功能进行抽象,整理,并映射为可调用的NodeJS接口。
如上图所示,wiot架构主要包含三部分:Node节点,wiot Cloud Module云模块,wiot cli命令行程序。其中,Node节点为烧录好wiot固件的NodeMCU单片机,他们通过IEEE 802.11 WiFi进行分布式通信,并于某个节点接入路由器以连接wiot云模块。用户在自己的PC上使用NodeJS调用wiot依赖编写物联网程序。完成后,用户使用wiot cli对开发好的程序进行检查、测试和部署。被部署的物联网程序将运行在wiot云模块上,并可使用nodeJS的接口与其它云服务或数据库进行交互。
Node节点
Node节点使用的是NodeMCU开发板(基于ESP8266的扩展板)。在使用wiot-cli烧录wiot固件后,NodeMCU将成为wiot节点。
模式
wiot节点有四种模式:master模式、slave模式、bridge模式和debug模式。此模式只能在烧录固件时配置。master模式和bridge模式下,nodeMCU将同时开启STA和AP模式。slave模式下则只开启STA模式。master需要有稳定且无限制的电源供电,其功率较大(包含RSA, 协议转换等),不适合低功耗场景。bridge与slave则可以灵活调整功率,可用于低功耗场景。
debug模式下节点工作在STA和AP模式,用户可以使用手机等设备连接到此节点,并打开根目录网页。网页上将实时显示此节点当前所处位置的各种信息,比如收到各其它节点的信号强度等,适用于挑选部署场景。
低功耗
wiot节点支持低功耗(Low Power)状态。但此状态仅能在slave模式和bridge下开启。此状态可通过wiot api或者wiot-cli进行开启或关闭。低功耗状态由esp8266睡眠功能实现。此状态下可由干电池供电工作数年[1]。
组网
wiot节点使用分布式组网。在路由器信号较强的地方,master节点将接入路由器WiFi网络,并桥接。在路由器信号不强的地方,每一个节点都会找到信号最强的另一个上游的master或bridge节点,并桥接(slave除外)。
如上图,两个距离路由器近的master节点自动接入到路由器wifi。下游的其它节点分别连接至信号最强的上游节点。
认证
wiot节点支持使用射频指纹识别[2]来实现下游通信认证。此方法使用esp8266的RSSI函数以及scan返回参数。在下游设备试图接入网络时,上游设备将搜集指纹信息并向服务器汇报。服务器将指纹与数据库存储的先前版本进行比对,并作出是否允许入网的决策。
云模块
云模块充当wiot的云部分,提供云的功能。云模块能够守护运行run-time状态下的wiot程序。此外,云模块还能够提供测试,部署等功能。云模块使用Docker进行虚拟化。
命令行程序
即wiot-cli。是wiot在开发者终端上提供的操作工具集。通过wiot-cli,开发者可以实现对wiot程序的测试,部署,恢复等功能。此外,wiot-cli也支持一系列debug等常用功能。详见下方wiot-cli命令
。
用户操作步骤
- 用户下载安装并配置好NodeJS环境。
- 用户通过命令行运行
npm i -g wiot-cli
指令安装wiot命令行工具 - 用户运行命令
wiot init my-wiot-proj
在当前目录新建并配置一个wiot项目文件夹,项目名称为my-wiot-proj。此时,会提示用户填写此项目的一些信息,比如项目描述,作者信息,路由器WiFi账户密码,wiot云模块地址,项目主脚本等。 - 用户进入到项目目录,将nodeMCU通过数据线连接到电脑,运行
wiot node init my-first-node [--type=<master|slave|bridge|debug>]
。这将自动配置并将wiot固件烧录到nodeMCU开发板,并将其命名为my-first-node。type为可选参数,可设置为master
或slave
或bridge
或debug
,默认为master
。 - 依次按照此方法烧录好所有的开发板,将其部署在生产环境。
- 在项目文件夹运行指令
wiot status
查看是否所有节点均已在线。如果没有,使用指令wiot log
配合grep
工具查找日志定位问题。 - 从项目主脚本(默认是
index.js
)开始编写你的wiot程序。 - 使用指令
wiot check
检查你wiot程序的逻辑问题。 - 使用指令
wiot test
将挂起云模块中正在运行的程序,并运行当前项目文件夹中的程序。此时,所有控制台输出将显示在你的命令行窗口。使用Ctrl+C
终止当前测试并恢复云模块先前的程序。 - 使用指令
wiot push
将本地的wiot程序部署到云端。
其它操作
部署自己的wiot云模块
默认使用wiot官方wiot云模块。你也可以部署自己的wiot云服务,方法如下:
安装docker并运行指令docker run -d --name=wiot-cloud -p 3594:3594 -v /var/wiot/data/:/var/wiot/data/ iotcat/wiot
。
wiot-cli命令
wiot help [command]
查看帮助wiot clone <host:user/project>
将项目从云模块克隆到本地wiot pull
使用远程代码覆盖本地代码wiot push
将当前文件夹wiot程序部署到云模块wiot node ls
显示当前所有节点wiot map [nodeID]
显示某节点的连接路径wiot log [nodeID] [--head=<number>|--tail=<number>]
查看某节点的日志wiot stop
停止wiot服务wiot start
开启wiot服务wiot restart
重启wiot服务wiot reload
在不重置flash变量情况下重启wiot服务wiot init <name>
新建并初始化wiot项目文件夹wiot node init <node-name> [--type=<master|slave|bridge|debug>]
配置并烧录nodeMCU开发板wiot check
检查当前文件夹项目逻辑问题。wiot test
将挂起云模块中正在运行的程序,并运行当前项目文件夹中的程序。此时,所有控制台输出将显示在你的命令行窗口。使用Ctrl+C
终止当前测试并恢复云模块先前的程序。wiot status [nodeID]
显示当前项目或节点状态信息wiot debug start
终止当前云端程序并进入debug模式wiot debug set <nodeID> <pinID> <0-255>
debug模式下设置某个节点pin的PWM输出值wiot debug reset <nodeID>
debug模式下重置某个节点的数据存储,并重连wiot debug get <nodeID> <pinID>
debug模式下获取某个节点pin的PWM值wiot debug sleep <nodeID> <pinID> <HIGH|LOW>
debug模式下设置某节点轻度休眠,直到被某pin的高或低电平唤醒wiot debug dsleep <nodeID> <millisecond>
debug模式下设置某节点深度休眠多少毫秒wiot debug reconnect [nodeID]
debug模式下重新组网或断开重连某个节点wiot debug setphymode <nodeID> <b|g|n>
debug模式下配置节点WiFi协议为802.11b|g|nwiot module search [keyword]
本地和联网搜索可用module类型wiot module install <moduleName|path>
安装并配置某个模块wiot module remove <moduleId>
卸载模块wiot module ls
显示所有已安装模块wiot search [keyword]
本地和联网搜索可用程序wiot install <programName|path>
安装并配置某个程序wiot remove <programID>
卸载某个程序wiot ls
显示所有程序
···
目录结构
1 | | |
常用API
待设计,请参考一轮开发wiot文档
- 事件
- cron定时任务
挑战
- 错误(设备离线)处理
wIoT
Wiot, a distributed IoT operating system based on NodeJS.
Project Description
The original intention of the project
This project aims to help web developers who are not familiar with firmware programming to implement their own IoT applications.
When developing traditional Internet of Things programs, we need to write, burn, and debug each development board again and again, and connect them in a certain way to provide a certain service. This method is very cumbersome, and the development cost and threshold are relatively high. In addition, the ancient C and C++ languages lack mature dependency management tools, so that it is difficult for us to write development boards as easy and convenient as developing python or nodeJS programs.
This project is trying to provide a method to automate the process of burning and debugging the development board, and move the steps of logic writing to the NodeJS interface of the remote computer. In this way, we are able to centrally manage the functions of distributed IoT nodes. In addition, with NodeJS’s mature dependency manager npm, the development of IoT applications is more convenient and efficient.
So far, down to every IoT node, up to various types of databases and user terminals, all can be configured and operated on the same nodeJS interface. Developers will be able to focus on the development of IoT logic and realize more colorful IoT applications.
First round of development
The first round of development was completed in May 2019, please refer to this blog
Realize the pin port mapping of D1 MINI development board to nodeJS, and support a series of functions such as ota.
Second round of development
To be carried out, plan as FYP project
Supported development version
Implementation
By providing standardized microcontroller firmware and automated burning tools, wiot abstracts, organizes, and maps the pin port functions of each development board into a callable NodeJS interface.
As shown in the figure above, the wiot architecture mainly consists of three parts: Node node, wiot Cloud Module, and wiot cli command line program. Among them, the Node node is the NodeMCU microcontroller with the wiot firmware burned. They use IEEE 802.11 WiFi for distributed communication, and connect to a router at a node to connect to the wiot cloud module. Users use NodeJS to call Wiot on their own PCs and rely on writing IoT programs. After completion, the user uses wiot cli to check, test and deploy the developed program. The deployed IoT program will run on the wiot cloud module, and can use the nodeJS interface to interact with other cloud services or databases.
Node node
Node node uses NodeMCU development board (expansion board based on ESP8266). After using wiot-cli to burn the wiot firmware, NodeMCU will become a wiot node.
Mode
Wiot nodes have four modes: master mode, slave mode, bridge mode and debug mode. This mode can only be configured when burning firmware. In master mode and bridge mode, nodeMCU will enable STA and AP mode at the same time. In slave mode, only STA mode is enabled. The master needs to have a stable and unlimited power supply, which has a large power and is not suitable for low power consumption scenarios. Bridge and slave can flexibly adjust power, which can be used in low power consumption scenarios.
In debug mode, the node works in STA and AP mode. Users can use mobile phones and other devices to connect to this node and open the root directory webpage. The web page will display various information about the current location of this node in real time, such as the signal strength received from other nodes, which is suitable for deployment scenarios.
Low power
Wiot nodes support Low Power state. But this state can only be opened in slave mode and bridge. This state can be turned on or off through wiot api or wiot-cli. The low power consumption state is realized by the sleep function of esp8266. In this state, it can be powered by dry batteries for several years [1].
Networking
Wiot nodes use distributed networking. Where the router signal is strong, the master node will access the router WiFi network and bridge it. Where the router signal is not strong, each node will find another upstream master or bridge node with the strongest signal and bridge it (except slave).
As shown in the figure above, the two master nodes close to the router are automatically connected to the router wifi. The other downstream nodes are respectively connected to the upstream node with the strongest signal.
Certification
Wiot nodes support the use of RF Fingerprint Recognition[2] to achieve downstream communication authentication. This method uses the RSSI function of esp8266 and scan return parameters. When the downstream device attempts to access the network, the upstream device will collect fingerprint information and report to the server. The server compares the fingerprint with the previous version stored in the database and makes a decision whether to allow access to the network.
Cloud Module
The cloud module acts as the cloud part of Wiot and provides cloud functions. The cloud module can guard the wiot program running in the run-time state. In addition, the cloud module can also provide functions such as testing and deployment. The cloud module uses Docker for virtualization.
Command Line Program
That is wiot-cli. It is a set of operation tools provided by Wiot on the developer terminal. Through wiot-cli, developers can implement functions such as testing, deploying, and restoring wiot programs. In addition, wiot-cli also supports a series of common functions such as debug. See the wiot-cli command
below for details.
User operation steps
- The user downloads, installs and configures the NodeJS environment.
- The user runs the command
npm i -g wiot-cli
through the command line to install the wiot command line tool - The user runs the command
wiot init my-wiot-proj
to create and configure a wiot project folder in the current directory, the project name is my-wiot-proj. At this point, the user will be prompted to fill in some information about this project, such as project description, author information, WiFi account password, wiot cloud module address, project main script, etc. - The user enters the project directory, connects the nodeMCU to the computer through the data cable, and runs
wiot node init my-first-node [--type=<master|slave|bridge|debug>]
. This will automatically configure and burn the Wiot firmware to the nodeMCU development board and name it my-first-node. type is an optional parameter, which can be set tomaster
orslave
orbridge
ordebug
, and the default ismaster
. - Follow this method to burn all the development boards and deploy them in the production environment.
- Run the command
wiot status
in the project folder to see if all nodes are online. If not, use the commandwiot log
with thegrep
tool to find the log location problem. - Start writing your wiot program from the main project script (default is
index.js
). - Use the command
wiot check
to check the logic of your wiot program. - Use the command
wiot test
to suspend the running program in the cloud module and run the program in the current project folder. At this point, all console output will be displayed in your command line window. UseCtrl+C
to terminate the current test and restore the previous program of the cloud module. - Use the command
wiot push
to deploy the local wiot program to the cloud.
Other operations
Deploy your own wiot cloud module
Install docker and run the command docker run -d --name=wiot-cloud -p 3594:3594 -v /var/wiot/data/:/var/wiot/data/ iotcat/wiot
.
wiot-cli command
wiot help [command]
view helpwiot clone <host:user/project>
to clone the project from the cloud module to the localwiot pull
uses remote code to overwrite local codewiot push
deploys the current folder wiot program to the cloud modulewiot ls
shows all current nodeswiot map [nodeID]
shows the connection path of a nodewiot log [nodeID] [--head=<number>|--tail=<number>]
view the log of a nodewiot stop
stop wiot servicewiot start
to start wiot servicewiot restart
restart wiot servicewiot reload
restarts the wiot service without resetting the flash variablewiot init <name>
creates and initializes the wiot project folderwiot node init <node-name> [--type=<master|slave|bridge|debug>]
configure and burn nodeMCU development boardwiot check
checks the current folder project logic problem.wiot test
will suspend the running program in the cloud module and run the program in the current project folder. At this point, all console output will be displayed in your command line window. UseCtrl+C
to terminate the current test and restore the previous program of the cloud module.wiot status [nodeID]
displays current project or node status informationwiot debug start
terminates the current cloud program and enters debug modewiot debug set <nodeID> <pinID> <0-255>
Set the PWM output value of a node pin in debug mode- In
wiot debug reset <nodeID>
debug mode, reset the data storage of a node and reconnect wiot debug get <nodeID> <pinID>
get the PWM value of a node pin in debug modewiot debug sleep <nodeID> <pinID> <HIGH|LOW>
debug mode to set a node to lightly sleep until it is awakened by a pin’s high or low levelwiot debug dsleep <nodeID> <millisecond>
set how many milliseconds a node deeply sleeps in debug mode- In
wiot debug reconnect [nodeID]
debug mode, reconnect to the network or disconnect and reconnect to a node
Common API
]]>To be designed, please refer to One-round development wiot document
本API基于华为云对象存储,使用华为CDN云加速,全球平均下载速度达10MB/s。API中已收录1100+张二次元图片,20+张Bing壁纸(每日自动抓取),150+张二次元头像,10+张图床上传图片。
This API is based on Huawei Cloud Object Storage and uses Huawei CDN Cloud acceleration. The global average download speed is 10MB/s. The API has included 1100+ two-dimensional pictures, 20+ Bing wallpapers (automatically captured daily), 150+ two-dimensional avatars, and 10+ pictures uploaded on the bed.
本API不承诺永久维护,使用前请务必斟酌使用风险!!
1 API地址
https://api.yimian.xyz/img
2 快速入门
随机二次元图片
GET/POST /img?type=moe
- 示例:https://api.yimian.xyz/img?type=moe
随机Bing壁纸
GET/POST /img?type=wallpaper
- 示例:https://api.yimian.xyz/img?type=wallpaper
随机二次元头像
GET/POST /img?type=head
- 示例:https://api.yimian.xyz/img?type=head
随机图床图片
GET/POST /img?type=imgbed
- 示例:https://api.yimian.xyz/img?type=imgbed
随机1920x1080尺寸二次元图片
GET/POST /img?type=moe&size=1920x1080
- 示例:https://api.yimian.xyz/img?type=moe&size=1920x1080
3 参数列表
名称 | 描述 | 格式 | 示例 |
---|---|---|---|
type | 图片种类 | moe /wallpaper /head /imgbed | type=moe |
size | 根据图片大小筛选 | ??x?? ;*x?? ;*x* ;??-??x?? ;??-??x??-?? ;??-??x* | display=1920x1080 ;display=1920x* ;display=1920-1950x230-500 ;display=1920-1950x* ; |
range | 尺寸误差范围 | number | range=100 |
id | 根据图片id筛选 | number | id=15 |
path | 根据路径提取图片 | abs path | path=wallpaper/img_··mal.jpg |
display | 是否以网页格式展示 | true /false (default) | display=true |
R18 | 是否显示18禁图片 | true /false (default) | R18=true |
4 参数详解
4.1 type
二次元(默认)
GET/POST /img?type=moe
- 图片来源: 呓喵酱的日常收藏(Pivix, Twitter)
- 示例:https://api.yimian.xyz/img?type=moe
bing每日壁纸
GET/POST /img?type=wallpaper
- 图片来源: Bing每日壁纸
- 示例:https://api.yimian.xyz/img?type=moe
每日自动更新中
二次元头像
GET/POST /img?type=head
- 图片来源: 从二次元图片中选择性截取
- 示例:https://api.yimian.xyz/img?type=head
呓喵酱图床
GET/POST /img?type=imgbed
- 图片来源: 呓喵酱图床
- 示例:https://api.yimian.xyz/img?type=imgbed
こいぬちゃん
GET/POST /img?type=koino
- 图片来源: @九条だんぼ(Twitter, Pivix, Google)
- 示例:https://api.yimian.xyz/img?type=koino
EasyVer人机验证
GET/POST /img?type=easyver
- 图片来源: 呓喵酱优化整理
- 示例:https://api.yimian.xyz/img?type=easyver
4.2 display
如果本参数置为true,则会禁用302跳转,直接返回完整图片编码。本方法效率极低,速度很慢,请慎用。
false(默认)
GET/POST /img?display=false
- 描述: 302跳转返回图片,建议使用
- 示例:https://api.yimian.xyz/img?display=false
true
GET/POST /img?display=true
- 描述: 直接返回图片,速度慢
- 示例:https://api.yimian.xyz/img?display=true
4.3 size
使用本参数限制图片尺寸。本参数支持以下格式:
??x??
GET/POST /img?size=??x??
- 描述: 宽度x高度
- 示例:https://api.yimian.xyz/img?size=1920x1080
??x*
GET/POST /img?size=??x*
- 描述: 宽度x任意高度
- 示例:https://api.yimian.xyz/img?size=1920x*
\x??*
GET/POST /img?size=*x??
- 描述: 任意宽度x高度
- 示例:https://api.yimian.xyz/img?size=*x1080
\x**
GET/POST /img?size=*x*
- 描述: 任意宽度x任意高度(默认)
- 示例:https://api.yimian.xyz/img?size=*x*
??-??x??
GET/POST /img?size=??-??x??
- 描述: 宽度范围x高度
- 示例:https://api.yimian.xyz/img?size=1910-1930x1080
??x??-??
GET/POST /img?size=??x??-??
- 描述: 宽度x高度范围
- 示例:https://api.yimian.xyz/img?size=1920x1070-1090
??-??x??-??
GET/POST /img?size=??-??x??-??
- 描述: 宽度范围x高度范围
- 示例:https://api.yimian.xyz/img?size=1910-1930x1070-1090
??-??x*
GET/POST /img?size=??-??x*
- 描述: 宽度范围x任意高度
- 示例:https://api.yimian.xyz/img?size=1910-1930x*
\x??-??*
GET/POST /img?size=*x??-??
- 描述: 任意宽度x高度范围
- 示例:https://api.yimian.xyz/img?size=*x1070-1090
4.4 range
本参数规定允许的size的误差,需搭配size使用,默认为0。
对于??型size参数
GET/POST /img?size=??x??&range=100
- 描述: 宽度±100 x 高度±100
- 示例:https://api.yimian.xyz/img?size=1920x1080&range=100
对于??-??型size参数
GET/POST /img?size=??-??x??-??&range=100
- 描述: 最小宽度-100|最大宽度+100 x 最小高度-100|最大高度+100
- 示例:https://api.yimian.xyz/img?size=1910-1930x1070-1090&range=100
对于*型size参数
GET/POST /img?size=*x*&range=100
- 描述: range无效
4.5 id
每一个种类都有自己的id系统,同一种类下不同图片id唯一。
二次元
GET/POST /img?type=moe&id=15
- 描述:提取id为15的二次元图片
- 示例:https://api.yimian.xyz/img?type=moe&id=15
bing每日壁纸
GET/POST /img?type=wallpaper&id=2019-07-28
- 描述:提取2019-07-28的壁纸图片
- 示例:https://api.yimian.xyz/img?type=wallpaper&id=2019-07-28
二次元头像
GET/POST /img?type=head&id=15
- 描述:提取id为15的头像
- 示例:https://api.yimian.xyz/img?type=head&id=15
呓喵酱图床
GET/POST /img?type=imgbed&id=529745e0
- 描述:提取id为529745e0的图床图片
- 示例:https://api.yimian.xyz/img?type=imgbed&id=529745e0
4.6 path
使用绝对路径直接提取图片,优先级高于type,效率最高。
GET/POST /img?path=xx/xx.xx
- 路径格式:
种类/图片文件名
- 路径格式示例:
imgbed/img_529745e0_900x900_8_null_normal.jpeg
- 描述:提取在xx/xx.xx的图片
- 示例:https://api.yimian.xyz/img/?path=imgbed/img_529745e0_900x900_8_null_normal.jpeg
4.7 R18
是否显示18禁图片,默认为false。
GET/POST /img?type=xx&R18=true
- 描述:随机提取xx类别中包含R18内容在内的图片
- 示例:https://api.yimian.xyz/img/?type=koino&R18=true
5 报错格式
5.1 找不到指定type类型
若找不到指定的type类型,将会自动返回一个moe类型的图片。
5.2 找不到符合条件的图片
返回JSON
1 | { |
每台设备每天全局调用上限500次!!
This API does not promise permanent maintenance, please be sure to consider use risks before use! !
1 API address
https://api.yimian.xyz/img
2 Quick start
Random two-dimensional picture
GET/POST /img?type=moe
- Example: https://api.yimian.xyz/img?type=moe
Random Bing Wallpaper
GET/POST /img?type=wallpaper
- Example: https://api.yimian.xyz/img?type=wallpaper
Random two-dimensional avatar
GET/POST /img?type=head
- Example: https://api.yimian.xyz/img?type=head
Random bed pictures
GET/POST /img?type=imgbed
- Example: https://api.yimian.xyz/img?type=imgbed
Random 1920x1080 size two-dimensional picture
GET/POST /img?type=moe&size=1920x1080
- Example: https://api.yimian.xyz/img?type=moe&size=1920x1080
3 Parameter list
Name | Description | Format | Example |
---|---|---|---|
type | Image type | moe /wallpaper /head /imgbed | type=moe |
size | Filter by image size | ??x?? ;*x?? ;*x* ;??-??x?? ;??-??x??-?? ;??-??x* | display=1920x1080 ;display=1920x* ;display=1920-1950x230-500 ;display=1920-1950x* ; |
range | Size error range | number | range=100 |
id | Filter by image id | number | id=15 |
path | Extract pictures based on path | abs path | path=wallpaper/img_··mal.jpg |
display | Whether to display in web page format | true /false (default) | display=true |
R18 | Whether to display 18 prohibited pictures | true /false (default) | R18=true |
4 Detailed parameters
4.1 type
Two-dimensional (default)
GET/POST /img?type=moe
- Image source: Daily Collection of Miao Miao Jiang (Pivix, Twitter)
- Example: https://api.yimian.xyz/img?type=moe
bing daily wallpaper
GET/POST /img?type=wallpaper
- Image source: Bing Daily Wallpaper
- Example: https://api.yimian.xyz/img?type=moe
Automatically updated daily
Two-dimensional avatar
GET/POST /img?type=head
- Image source: Selectively intercepted from two-dimensional images
- Example: https://api.yimian.xyz/img?type=head
Miao meow sauce picture bed
GET/POST /img?type=imgbed
- Image source: 呓喵酱图床
- Example: https://api.yimian.xyz/img?type=imgbed
こいぬちゃん
GET/POST /img?type=koino
- Image source: @九条だんぼ (Twitter, Pivix, Google)
- Example: https://api.yimian.xyz/img?type=koino
EasyVer man-machine verification
GET/POST /img?type=easyver
- Image source: Optimized finishing
- Example: https://api.yimian.xyz/img?type=easyver
4.2 display
If this parameter is set to true, 302 jump will be disabled and the complete picture encoding will be returned directly. This method is very low and slow. Please use it carefully.
false (default)
GET/POST /img?display=false
- Description: 302 Jump to return to the picture, recommended
- Example: https://api.yimian.xyz/img?display=false
true
GET/POST /img?display=true
- Description: Return to the picture directly, slow
- Example: https://api.yimian.xyz/img?display=true
4.3 size
Use this parameter to limit the image size. This parameter supports the following formats:
??x??
GET/POST /img?size=??x??
- Description: width x height
- Example: https://api.yimian.xyz/img?size=1920x1080
??x*
GET/POST /img?size=??x*
- Description: width x any height
- Example: https://api.yimian.xyz/img?size=1920x*
\x??*
GET/POST /img?size=*x??
- Description: Any width x height
- Example: https://api.yimian.xyz/img?size=*x1080
\x**
GET/POST /img?size=*x*
- Description: any width x any height (default)
- Example: https://api.yimian.xyz/img?size=*x *
??-??x??
GET/POST /img?size=??-??x??
- Description: width range x height
- Example: https://api.yimian.xyz/img?size=1910-1930x1080
??x??-??
GET/POST /img?size=??x??-??
- Description: width x height range
- Example: https://api.yimian.xyz/img?size=1920x1070-1090
??-??x??-??
GET/POST /img?size=??-??x??-??
- Description: width range x height range
- Example: https://api.yimian.xyz/img?size=1910-1930x1070-1090
??-??x*
GET/POST /img?size=??-??x*
- Description: width range x any height
- Example: https://api.yimian.xyz/img?size=1910 -1930x*
\x??-??*
GET/POST /img?size=*x??-??
- Description: Any width x height range
- Example: https://api.yimian.xyz/img?size=* x1070-1090
4.4 range
This parameter specifies the allowable size error, which needs to be used with size, and the default is 0.
For the?? type size parameter
GET/POST /img?size=??x??&range=100
- Description: width ±100 x height ±100
- Example: https://api.yimian.xyz/img?size=1920x1080&range=100
For??-?? type size parameter
GET/POST /img?size=??-??x??-??&range=100
- Description: Min width-100|Max width+100 x Min height-100|Max height+100
- Example: https://api.yimian.xyz/img?size=1910-1930x1070-1090&range=100
For *type size parameter
GET/POST /img?size=*x*&range=100
- Description: Invalid range
4.5 id
Each category has its own id system, and different image ids under the same category are unique.
*Two-dimensional *
GET/POST /img?type=moe&id=15
- Description: Extract the two-dimensional image with id 15
- Example: https://api.yimian.xyz/img?type=moe&id=15
bing daily wallpaper
GET/POST /img?type=wallpaper&id=2019-07-28
- Description: Extract wallpaper pictures from 2019-07-28
- Example: https://api.yimian.xyz/img?type=wallpaper&id=2019-07-28
Two-dimensional avatar
GET/POST /img?type=head&id=15
- Description: Extract the avatar with id 15
- Example: https://api.yimian.xyz/img?type=head&id=15
Miao meow sauce picture bed
GET/POST /img?type=imgbed&id=529745e0
- Description: Extract the picture bed with id 529745e0
- Example: https://api.yimian.xyz/img?type=imgbed&id=529745e0
4.6 path
Use absolute path to directly extract pictures, priority is higher than type, highest efficiency.
GET/POST /img?path=xx/xx.xx
- Path format:
Type/Picture File Name
- Example of path format:
imgbed/img_529745e0_900x900_8_null_normal.jpeg
- Description: Extract pictures in xx/xx.xx
- Example: https://api.yimian.xyz/img/?path=imgbed/img_529745e0_900x900_8_null_normal.jpeg
4.7 R18
Whether to display 18 prohibited pictures, the default is false.
GET/POST /img?type=xx&R18=true
- Description: Randomly extract pictures containing R18 content in xx category
- Example: https://api.yimian.xyz/img/?type=koino&R18=true
5 Error format
5.1 Cannot find the specified type
If the specified type cannot be found, a moe type picture will be automatically returned.
5.2 Can’t find matching images
Return JSON
1 | { |
]]>The maximum number of global calls for each device is 500 per day!!