Author Archives: Robins

[Solved] Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables –wait -t na…

Error message: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables –wait -t nat -I DOCKER -i br-b1938128a963 -j RETURN: iptables: No chain/target/match by that name. (exit status 1))

reason: The error report after operating the Linux firewall on/off operate.

Solution:

restart docker via the following command:

service docker restart

[Solved] Module build failed: Error: Vue packages version mismatch

1. Error message when running the project

Module build failed: Error:

Vue packages version mismatch:

- [email protected] (G:\workspace\BookShopManageVue\node_modules\vue\dist\vue.runtime.common.js)
- [email protected] (G:\workspace\BookShopManageVue\node_modules\[email protected]&#64 ;vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template- compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

2. Reason for the error

version problems,

The currently installed VUE dependency node_modules is version 2.6.14,  but the imported project uses version 2.7.10.

Just unify the two versions.

Hint: how to unify versions. Is to download and install version 2.6.14. Still version 2.7.10?

If you are using vue-loader@>=10.0, simply update vue-template-compiler.

Check the version of vue loader in package-lock.json. My vue loader version is higher than 10. So I’m going to unity 1.6.14 version. (I didn’t see vue loader directly download and install version 2.7.10 before. The result is the same error)
insert image description here

3. Solutions

  • 1. Delete node_modules
  • 2. Install npm install [email protected] --save (Need to check the version)

4. Successful operation

insert image description here

[Solved] Unity packaged and exported apk error: Failed to load libmain.so’

Today I packaged the APK on my mobile phone and found that I couldn’t enter the main page, and it kept prompting
As shown in the figure below, the part of the package name is lost

insert image description here

Failure to initialize! Your hardware does not support this
application. Failed to load libmain.so’ java.lang.
UnsatisfiedLinkError: dalvik.system.PathClassLoaderl DexPathList|(zip
file “/data/app/ package name-v9hxALnNbA
vIVbwOmlIHfw==/base.apk”I,nat iveLibraryDirectories=|/data/app/
package name-v9hxALnNb AvIVbwOmlIHfw==/lib/arm64,/data/
app/package name-v9hxALn NbAvIVbwOmlIHfw==/base.apk!/
lib/arm64 -v8a, /system/lib64, /system/product/lib64ll couldn’t find
“libmain.so” Press OK to quit.

I checked several methods but couldn’t use it. Finally, I changed the compilation settings to solve the problem.
Changed to ARMv7 as shown in the figure and it will be normal. If ARM64 is needed, it can be solved elsewhere.
Now this is the case. The package is delivered normally, record it
insert picture description here

Julia LoadError: Failed to precompile GR [How to Solve]

Julia LoadError: Failed to precompile GR problem solving

Suddenly reported an error after running,It doesn’t work whether it is uninstalled and then installed
here Insert picture description
I suddenly thought about whether the version is too high or not

Update the specified version in the package manager, I will update to the next-level version and the problem will be solved.
insert image description here

VScode Error: extension failed XHR Failed (Ubuntu Virtual Machine)

In the process of learning Linux embedded development, I encountered the following problems: after installing VS code in the Ubuntu virtual machine, it need to install appropriate plug-ins. At this point, vscode fails to expand XHR Failed, as shown in the figure:

And press the F1 key inside Vs code to open Developer:Toggle Developer Tools, enter the Console to query the reason, The error shown in the figure below appears (That is, Ubuntu system will point the domain name to the specified IP solve this problem):

After searching the Internet for many solutions, the following operations can solve the problem:

1. Open the hosts file in the Ubuntu terminal

sudo gedit /etc/hosts

2. Add the corresponding relationship between IP and domain name in the file as follows, and save the hosts file:

13.107.42.18 marketplace.visualstudio.com

3. Restart Ubuntu.

python minio client Error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certific

Built minio service, support https, python call reported error.

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='xx.xx.xx.xxx', port=9000): Max retries exceeded with url: /allstruct?location= (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)')))

Ignore the certificate error issue and try out the demo script


import os
from minio import Minio
import urllib3
from urllib.parse import urlparse
import certifi
from minio.commonconfig import REPLACE, CopySource
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


minio_endpoint = os.getenv("MINIO_ENDPOINT", "https://xxx.xxx.xxx.xxx:9000")
secure = True

minio_endpoint = urlparse(minio_endpoint)


if minio_endpoint.scheme == 'https':
    secure = True

ok_http_client=urllib3.PoolManager(
            timeout=urllib3.util.Timeout(connect=10, read=10),
            maxsize=10,
            cert_reqs='CERT_NONE',
            ca_certs= os.environ.get('SSL_CERT_FILE') or certifi.where(),
            retries=urllib3.Retry(
                total=5,
                backoff_factor=0.2,
                status_forcelist=[500, 502, 503, 504]
            )
        )


minioClient = Minio(minio_endpoint.netloc,
                    access_key='username',
                    secret_key='password',
                    http_client=ok_http_client,
                    secure=secure)

print(minioClient.list_buckets())

[Solved] KDevelop Error: Failed to specify program to start

The build was successful, but the runtime encountered an error

Failed to specify program to start

Solution:

    1. Check if Run/Current Launch Configuration is the current project
    2. If it is New Compiled Binary Launcher, select the current project
    3. If there is no current project name, go to the next option Configure Launches
    4. Click on the current project name
    5. AddCompiled Binary
    6. Go back to the first step and find that there are options, select
    7. Execute, run successfully

Android Studio: Gradle project sync failed [How to Solve]

Question:

Unable to find method ”java.lang.String org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()

Reference:

gradle issues details in discription – Stack Overflow

Solution:

Upgrade Android Studio.

Stack Overflow says to upgrade IntelliJ Idea. Similarly, The version of Android Studio is too low, and does not match the gradle version.

[Solved] Hikvision SDK: NET_DVR_GetDVRConfig failed Device does not support this function

Problem:

I have written some code based on Hikvision’s sdk for controlling the camera. One section of the program is mainly used to get NVR channel configuration information

The codes is as below:
I use the function NET_DVR_GetDVRConfig

#include  #include "HCNetSDK.h" int main() { NET_DVR_Init(); //Set connection time and reconnect time NET_DVR_SetConnectTime(2000, 1); NET_DVR_SetReconnect(10000, true); // 注册设备 LONG lUserID; //Login parameters, including device address, login user, password, etc. NET_DVR_USER_LOGIN_INFO struLoginInfo = { 0 }; struLoginInfo.bUseAsynLogin = 0; //同步登录方式 strcpy(struLoginInfo.sDeviceAddress, "192.168.20.106"); //设备IP地址 struLoginInfo.wPort = 8000; //设备服务端口 strcpy(struLoginInfo.sUserName, "admin"); //设备登录用户名 strcpy(struLoginInfo.sPassword, "111111hk"); //设备登录密码 //设备信息, 输出参数 NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = { 0 }; lUserID = NET_DVR_Login_V40(&struLoginInfo, &struDeviceInfoV40); if (lUserID < 0) { printf("Login failed, error code: %d\n", NET_DVR_GetLastError()); NET_DVR_Cleanup(); return -1; } NET_DVR_IPPARACFG_V40 ipcfg; DWORD bytesReturned = 0; ipcfg.dwSize = sizeof(NET_DVR_IPPARACFG_V40); int iGroupNO = 0; bool resCode = NET_DVR_GetDVRConfig(lUserID, NET_DVR_GET_IPPARACFG_V40, iGroupNO, &ipcfg, sizeof(NET_DVR_IPPARACFG_V40), &bytesReturned); if (! resCode) { DWORD code = NET_DVR_GetLastError(); std::cout << "NET_DVR_GetDVRConfig failed " << NET_DVR_GetErrorMsg((LONG*)(&code)) << std::endl; NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return -1; } std::cout << "设备组 " << ipcfg.dwGroupNum << " 数字通道个数 " << ipcfg.dwDChanNum << " 起始通道 " << ipcfg.dwStartDChan << std::endl << std::endl; for (int i = 0; i < ipcfg.dwDChanNum; i++) { NET_DVR_PICCFG_V30 channelInfo; bytesReturned = 0; channelInfo.dwSize = sizeof(NET_DVR_PICCFG_V30); int channelNum = i + ipcfg.dwStartDChan; NET_DVR_GetDVRConfig(lUserID, NET_DVR_GET_PICCFG_V30, channelNum, &channelInfo, sizeof(NET_DVR_PICCFG_V30), &bytesReturned); std::cout <<"通道号 "<< channelNum << "\t通道名称 " << channelInfo.sChanName; std::cout << "\t用户名 " << ipcfg.struIPDevInfo[i].sUserName << "\t密码 " << ipcfg.struIPDevInfo[i].sPassword; std::cout << "\t设备ID " << (int)ipcfg.struIPDevInfo[i].szDeviceID; std::cout << "\tip地址 " << ipcfg.struIPDevInfo[i].struIP.sIpV4 << "\t端口 " << ipcfg.struIPDevInfo[i].wDVRPort << std::endl; } //释放SDK资源 NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return 0; } 

The code was running ok, but when migrating to another machine, something went wrong.
Report the error: NET_DVR_GetDVRConfig failed Device does not support this function

Note the phrase:
If the number of IP channels supported by the device is greater than 0, then the remote parameter configuration interface NET_DVR_GetDVRConfig can be used.
This means that to use this function, you need to check the number of IP channels supported by the device first.
Also, the manual gives a sample program (check first, then call)
The sample procedure is as follows.
ps: there is a point I want to spit, the manual on the ET_DVR_GetDVRConfig function explanation, there is no mention of this issue, causing me to look for a long time to find here to write. Since this function is not supported by all devices, then the norm should be written to check first, then call.

#include  #include  #include "Windows.h" #include "string.h" #include "HCNetSDK.h" using namespace std; void main() { int i=0; BYTE byIPID,byIPIDHigh; int iDevInfoIndex, iGroupNO, iIPCh; DWORD dwReturned = 0; //--------------------------------------- // 初始化 NET_DVR_Init(); //设置连接时间与重连时间 NET_DVR_SetConnectTime(2000, 1); NET_DVR_SetReconnect(10000, true); //--------------------------------------- // 注册设备 LONG lUserID; //Login parameters, including device address, login user, password, etc. NET_DVR_USER_LOGIN_INFO struLoginInfo = {0}; struLoginInfo.bUseAsynLogin = 0; //同步登录方式 strcpy(struLoginInfo.sDeviceAddress, "192.0.0.64"); //设备IP地址 struLoginInfo.wPort = 8000; //设备服务端口 strcpy(struLoginInfo.sUserName, "admin"); //设备登录用户名 strcpy(struLoginInfo.sPassword, "abcd1234"); //设备登录密码 //设备信息, 输出参数 NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = {0}; lUserID = NET_DVR_Login_V40(&struLoginInfo, &struDeviceInfoV40); if (lUserID < 0) { printf("Login failed, error code: %d\n", NET_DVR_GetLastError()); NET_DVR_Cleanup(); return; } printf("The max number of analog channels: %d\n",struDeviceInfoV40.struDeviceV30.byChanNum); //模拟通道个数 printf("The max number of IP channels: %d\n", struDeviceInfoV40.struDeviceV30.byIPChanNum + struDeviceInfoV40.struDeviceV30.byHighDChanNum * 256);//IP通道个数 //获取IP通道参数信息 NET_DVR_IPPARACFG_V40 IPAccessCfgV40; memset(&IPAccessCfgV40, 0, sizeof(NET_DVR_IPPARACFG)); iGroupNO=0; if (! NET_DVR_GetDVRConfig(lUserID, NET_DVR_GET_IPPARACFG_V40, iGroupNO, &IPAccessCfgV40, sizeof(NET_DVR_IPPARACFG_V40), &dwReturned)) { printf("NET_DVR_GET_IPPARACFG_V40 error, %d\n", NET_DVR_GetLastError()); NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return; } else { for (i=0;i<IPAccessCfgV40.dwDChanNum;i++) { switch(IPAccessCfgV40.struStreamMode[i].byGetStreamType) { case 0: //直接从设备取流 if (IPAccessCfgV40.struStreamMode[i].uGetStream.struChanInfo.byEnable) { byIPID=IPAccessCfgV40.struStreamMode[i].uGetStream.struChanInfo.byIPID; byIPIDHigh=IPAccessCfgV40.struStreamMode[i].uGetStream.struChanInfo.byIPIDHigh; iDevInfoIndex=byIPIDHigh*256 + byIPID-1-iGroupNO*64; printf("IP channel no.%d is online, IP: %s\n", i+1, IPAccessCfgV40.struIPDevInfo[iDevInfoIndex].struIP.sIpV4); } break; case 1: //从流媒体取流 if (IPAccessCfgV40.struStreamMode[i].uGetStream.struPUStream.struStreamMediaSvrCfg.byValid) { printf("IP channel %d connected with the IP device by stream server.\n", i+1); printf("IP of stream server: %s, IP of IP device: %s\n",IPAccessCfgV40.struStreamMode[i].uGetStream.\ struPUStream.struStreamMediaSvrCfg.struDevIP.sIpV4, IPAccessCfgV40.struStreamMode[i].uGetStream.\ struPUStream.struDevChanInfo.struIP.sIpV4); } break; default: break; } } } //配置IP通道5; iIPCh=4; //支持自定义协议 NET_DVR_CUSTOM_PROTOCAL struCustomPro; if (! NET_DVR_GetDVRConfig(lUserID, NET_DVR_GET_CUSTOM_PRO_CFG, 1, &struCustomPro, sizeof(NET_DVR_CUSTOM_PROTOCAL), &dwReturned)) //获取自定义协议1 { printf("NET_DVR_GET_CUSTOM_PRO_CFG error, %d\n", NET_DVR_GetLastError()); NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return; } struCustomPro.dwEnabled=1; //启用主码流 struCustomPro.dwEnableSubStream=1; //启用子码流 strcpy((char *)struCustomPro.sProtocalName,"Protocal_RTSP"); //自定义协议名称:Protocal_RTSP,最大16字节 struCustomPro.byMainProType=1; //主码流协议类型: 1- RTSP struCustomPro.byMainTransType=2; //主码流传输协议: 0-Auto, 1-udp, 2-rtp over rtsp struCustomPro.wMainPort=554; //主码流取流端口 strcpy((char *)struCustomPro.sMainPath,"rtsp://192.168.1.65/h264/ch1/main/av_stream");//主码流取流URL struCustomPro.bySubProType=1; //子码流协议类型: 1-RTSP struCustomPro.bySubTransType=2; //子码流传输协议: 0-Auto, 1-udp, 2-rtp over rtsp struCustomPro.wSubPort=554; //子码流取流端口 strcpy((char *)struCustomPro.sSubPath,"rtsp://192.168.1.65/h264/ch1/sub/av_stream");//子码流取流URL if (! NET_DVR_SetDVRConfig(lUserID, NET_DVR_SET_CUSTOM_PRO_CFG, 1, &struCustomPro, sizeof(NET_DVR_CUSTOM_PROTOCAL))) //设置自定义协议1 { printf("NET_DVR_SET_CUSTOM_PRO_CFG error, %d\n", NET_DVR_GetLastError()); NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return; } printf("Set the custom protocol: %s\n", "Protocal_RTSP"); NET_DVR_IPC_PROTO_LIST m_struProtoList; if (! NET_DVR_GetIPCProtoList(lUserID, &m_struProtoList)) //Get the front-end protocols supported by the device { printf("NET_DVR_GetIPCProtoList error, %d\n", NET_DVR_GetLastError()); NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return; } IPAccessCfgV40.struIPDevInfo[iIPCh].byEnable=1; //启用 for (i = 0; i<m_struProtoList.dwProtoNum; i++) { if(strcmp((char *)struCustomPro.sProtocalName,(char *)m_struProtoList.struProto[i].byDescribe)==0) { IPAccessCfgV40.struIPDevInfo[iIPCh].byProType=m_struProtoList.struProto[i].dwType; //选择自定义协议 break; } } //IPAccessCfgV40.struIPDevInfo[iIPCh].byProType=0; //厂家私有协议 strcpy((char *)IPAccessCfgV40.struIPDevInfo[iIPCh].struIP.sIpV4,"192.168.1.65"); //前端IP设备的IP地址 IPAccessCfgV40.struIPDevInfo[iIPCh].wDVRPort=8000; //前端IP设备服务端口 strcpy((char *)IPAccessCfgV40.struIPDevInfo[iIPCh].sUserName,"admin"); //前端IP设备登录用户名 strcpy((char *)IPAccessCfgV40.struIPDevInfo[iIPCh].sPassword,"12345"); //前端IP设备登录密码 IPAccessCfgV40.struStreamMode[iIPCh].byGetStreamType=0; IPAccessCfgV40.struStreamMode[iIPCh].uGetStream.struChanInfo.byChannel=1; IPAccessCfgV40.struStreamMode[iIPCh].uGetStream.struChanInfo.byIPID=(iIPCh+1)%256; IPAccessCfgV40.struStreamMode[iIPCh].uGetStream.struChanInfo.byIPIDHigh=(iIPCh+1)/256; //IP通道配置,包括添加、删除、修改IP通道等 if (! NET_DVR_SetDVRConfig(lUserID, NET_DVR_SET_IPPARACFG_V40, iGroupNO, &IPAccessCfgV40, sizeof(NET_DVR_IPPARACFG_V40))) { printf("NET_DVR_SET_IPPARACFG_V40 error, %d\n", NET_DVR_GetLastError()); NET_DVR_Logout(lUserID); NET_DVR_Cleanup(); return; } else { printf("Set IP channel no.%d, IP: %s\n", iIPCh+1, IPAccessCfgV40.struIPDevInfo[iIPCh].struIP.sIpV4); } //注销用户 NET_DVR_Logout(lUserID); //释放SDK资源 NET_DVR_Cleanup(); return; } 

failed: RawInventory gets null OracleHomeInfo [How to Solve]

Error:

List of Homes on this system:

  Home name= OraDb11g_home1, Location= "/opt/oracle/products/11.2.0"
LsInventorySession failed: RawInventory gets null OracleHomeInfo

OPatch failed with error code 73

在这里插入图片描述

Solution:

Switch to ORACLE_HOME directory and add to oraInventory:

% cs $ORACLE_HOME/oui/bin

% ./attachHome.sh (Linux) execute attachHome.cmd (Windows)

在这里插入图片描述