liyi 1 год назад
Родитель
Сommit
3077be78c1

+ 11 - 0
output/t113s/prod/PDUInfo.txt

@@ -0,0 +1,11 @@
+"product_name": "SmartPDU"
+"product_sn": "XX1101010"
+"device_name": "YY110001"
+"device_date": "2024/01/01 11:10:10"
+"device_batch": "GC101X5502"
+"server_name": "购旺工业(赣州)有限公司"
+"server_net": "https://www.gowone.com"
+"server_mail": "steven@gowone.com"
+"server_address": "江西省赣州市赣州经济技术开发区香江科技园11栋"
+"server_telephone": "400-013-7168"
+

+ 57 - 0
output/t113s/prod/push.bat

@@ -0,0 +1,57 @@
+@ECHO OFF
+
+SET IP=192.168.1.132
+
+SET BAT=0
+IF "%~1" NEQ "" (
+    SET IP=%1
+    SET BAT=1
+)
+
+SET CURDIR=%~dp0
+SET CURDIR=%CURDIR:~0,-1%
+
+SET  TMPDIR=tmp
+SET  DEVDIR=/root
+
+SET PSCP=%CURDIR%\tools\pscp 
+SET PLINK=%CURDIR%\tools\plink
+
+SET USR=root
+SET FBAT=%CURDIR%\tools\script.sh
+SET PWD=tina
+
+SET FILE=PDUInfo.txt
+::test ip
+ECHO ping %IP% ...
+PING -n 3 -w 500 %IP%  >NUL
+IF %ERRORLEVEL% NEQ 0 (
+    IF %BAT% EQU 0 (
+    ECHO %IP% can't reached!
+        TIMEOUT /T 2 > NUL
+    )
+    EXIT /B 1
+)
+
+::send files
+ECHO send %FILE% to device ...
+ECHO  y  | %PSCP% -pw %PWD%  %FILE% %USR%@%IP%:%DEVDIR%
+IF %ERRORLEVEL% NEQ 0 (
+    ECHO send failed!
+    EXIT /B 2
+)
+
+ECHO send finished, release files now ...
+ECHO  y  | %PLINK%  -ssh -t  -pw %PWD% %USR%@%IP% -m %FBAT%
+IF %ERRORLEVEL% NEQ 0 (
+    ECHO upgrade failed!
+    EXIT /B 3
+)
+
+IF %BAT% EQU 0  (
+    ECHO quit now ...
+    TIMEOUT /T 2 > NUL
+)
+
+EXIT /B 0
+

BIN
output/t113s/prod/tools/plink.exe


BIN
output/t113s/prod/tools/pscp.exe


+ 17 - 0
output/t113s/prod/tools/script.sh

@@ -0,0 +1,17 @@
+#!/bin/sh
+
+ftmp=PDUInfo.txt
+
+cp -f  $ftmp  /usr/share/
+rm -f  $ftmp
+
+exit 0
+
+
+
+
+
+
+
+
+

+ 3 - 0
pro/config/cfg.h

@@ -210,6 +210,9 @@
     #define PHASE_GROUP                         8
     #define PHASE_GROUP                         8
     #define CHANNEL_DELAY                       8
     #define CHANNEL_DELAY                       8
     #define PROD_POWER_TYPE                     3
     #define PROD_POWER_TYPE                     3
+    #define CONFIG_XPORT
+    #define LOG_SEND_MAIL
+    #define NOT_USE_CONTROL
 #else
 #else
     #error define a PRJ_XXXX please!
     #error define a PRJ_XXXX please!
 #endif
 #endif

+ 11 - 1
pro/src/app.c

@@ -1511,6 +1511,7 @@ static void* breaker_thread(void *arg)
                     break;
                     break;
                 }
                 }
             }
             }
+            
         }
         }
         lock_s_release(LOCK_ID_BREAKER);
         lock_s_release(LOCK_ID_BREAKER);
         sleep(1);
         sleep(1);
@@ -2033,7 +2034,11 @@ static int ntp_init(void)
 int snmp_config(SNMPManager *m, int quit)
 int snmp_config(SNMPManager *m, int quit)
 {
 {
     char path[200];
     char path[200];
+#if (CHIP_TYPE == CHIP_T113s)
+    char *conf="/mnt/UDISK/app/snmp/conf/snmpd.conf";
+#else
     char *conf="/snmp/conf/snmpd.conf";
     char *conf="/snmp/conf/snmpd.conf";
+#endif
     char user[100],pass[200],cmd[400],trapinfo[200];
     char user[100],pass[200],cmd[400],trapinfo[200];
     sys_get_path(path, conf);
     sys_get_path(path, conf);
 
 
@@ -2066,8 +2071,13 @@ int snmp_config(SNMPManager *m, int quit)
             system(cmd);
             system(cmd);
         }
         }
     }
     }
-
+#if (CHIP_TYPE == CHIP_T113s)
+    system("killall snmpd");
+  //  system("/mnt/UDISK/app/snmp/bin/snmpd -Cc /mnt/UDISK/app/snmp/conf/snmpd.conf -Lo &");
+    sleep(2);
+#else
     system("/etc/init.d/S90PDUApp restart snmpd");
     system("/etc/init.d/S90PDUApp restart snmpd");
+#endif
     if(quit) exit(0);
     if(quit) exit(0);
 
 
     return 0;
     return 0;

+ 1 - 3
pro/src/appweb_handle.c

@@ -5427,9 +5427,7 @@ static void equipmentMintenance(void *conn)
                         free(breakerManager);
                         free(breakerManager);
                         breakerManager = NULL;
                         breakerManager = NULL;
                         ack_str = ctrl_breaker_err_ack_to_json("jdh error!!!!");
                         ack_str = ctrl_breaker_err_ack_to_json("jdh error!!!!");
-                    }
-               
-
+                }
             }else
             }else
             {
             {
                 ack_str = ctrl_breaker_err_ack_to_json("ID More 48 !!!!");
                 ack_str = ctrl_breaker_err_ack_to_json("ID More 48 !!!!");

+ 1 - 0
pro/src/cascade.h

@@ -10,6 +10,7 @@
 
 
 #define MAX_BREAKER_CHN                 (6)
 #define MAX_BREAKER_CHN                 (6)
 #define MAX_BREAKER_ID                  (49) 
 #define MAX_BREAKER_ID                  (49) 
+#define MAX_BREAKER_DIO_CHN             1
 
 
 #define CASCADE_MAX                     32
 #define CASCADE_MAX                     32
 #define ERR_MAX                         5
 #define ERR_MAX                         5

+ 33 - 4
pro/src/common.c

@@ -10,6 +10,7 @@
 #include <sys/vfs.h>
 #include <sys/vfs.h>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
 #include <linux/rtc.h>
 #include <linux/rtc.h>
+#include "cfg.h"
 
 
 #undef LOG_TAG
 #undef LOG_TAG
 #define LOG_TAG    "main"
 #define LOG_TAG    "main"
@@ -280,9 +281,9 @@ static int set_rtc(time_t t)
 {
 {
 int r=0,fd;
 int r=0,fd;
 
 
-#if (CHIP_TYPE == CHIP_T113s)
-    system("hwclock -w -f /dev/rtc0");
-#else
+// #if (CHIP_TYPE == CHIP_T113s)
+//     system("hwclock -w -f /dev/rtc0");
+// #else
     
     
     struct rtc_time *rtc;
     struct rtc_time *rtc;
 
 
@@ -302,7 +303,7 @@ int r=0,fd;
         printf("set rtc ok!\n");
         printf("set rtc ok!\n");
     }
     }
     close(fd);
     close(fd);
-#endif
+//#endif
     return r;
     return r;
 }
 }
 
 
@@ -468,7 +469,14 @@ int set_zone(int zone)
             return -1;
             return -1;
     }
     }
 #else
 #else
+
+#if (CHIP_TYPE == CHIP_T113s)
+    sprintf(buf, "ln -sf /usr/share/zoneinfo/GMT%s%d /etc/localtime", (zone<0)?"+":"-", abs(zone));
+#else
+
     sprintf(buf, "ln -sf /usr/share/zoneinfo/Etc/GMT%s%d /etc/localtime", (zone<0)?"+":"-", abs(zone));
     sprintf(buf, "ln -sf /usr/share/zoneinfo/Etc/GMT%s%d /etc/localtime", (zone<0)?"+":"-", abs(zone));
+#endif
+
 #endif
 #endif
 
 
     log_i("set_zone: %s", buf);
     log_i("set_zone: %s", buf);
@@ -746,12 +754,22 @@ void SetMenuAuthority(int RoleID)
         _GlobalMenuAuthority.SnmpszEnabled = true;
         _GlobalMenuAuthority.SnmpszEnabled = true;
         _GlobalMenuAuthority.MqszEnabled = true;
         _GlobalMenuAuthority.MqszEnabled = true;
         _GlobalMenuAuthority.NtpszEnabled = true;
         _GlobalMenuAuthority.NtpszEnabled = true;
+#ifndef NOT_USE_CONTROL
         _GlobalMenuAuthority.DsszEnabled = true;
         _GlobalMenuAuthority.DsszEnabled = true;
         _GlobalMenuAuthority.SxszEnabled = true;
         _GlobalMenuAuthority.SxszEnabled = true;
         _GlobalMenuAuthority.FzszEnabled = true;
         _GlobalMenuAuthority.FzszEnabled = true;
+#else
+        _GlobalMenuAuthority.DsszEnabled = false;
+        _GlobalMenuAuthority.SxszEnabled = false;
+        _GlobalMenuAuthority.FzszEnabled = false;
+#endif
         // 8、设备维护菜单
         // 8、设备维护菜单
         _GlobalMenuAuthority.SbcqEnabled = true;
         _GlobalMenuAuthority.SbcqEnabled = true;
+#ifndef NOT_USE_CONTROL
         _GlobalMenuAuthority.GjsjEnabled = true;
         _GlobalMenuAuthority.GjsjEnabled = true;
+#else
+         _GlobalMenuAuthority.GjsjEnabled = false;
+#endif
         _GlobalMenuAuthority.KzbsjEnabled = true;
         _GlobalMenuAuthority.KzbsjEnabled = true;
         _GlobalMenuAuthority.HhccszEnabled = true;
         _GlobalMenuAuthority.HhccszEnabled = true;
         _GlobalMenuAuthority.PzdrdcEnabled = true;
         _GlobalMenuAuthority.PzdrdcEnabled = true;
@@ -796,12 +814,22 @@ void SetMenuAuthority(int RoleID)
         _GlobalMenuAuthority.SnmpszEnabled = false;
         _GlobalMenuAuthority.SnmpszEnabled = false;
         _GlobalMenuAuthority.MqszEnabled = false;
         _GlobalMenuAuthority.MqszEnabled = false;
         _GlobalMenuAuthority.NtpszEnabled = true;
         _GlobalMenuAuthority.NtpszEnabled = true;
+#ifndef NOT_USE_CONTROL
         _GlobalMenuAuthority.DsszEnabled = true;
         _GlobalMenuAuthority.DsszEnabled = true;
         _GlobalMenuAuthority.SxszEnabled = true;
         _GlobalMenuAuthority.SxszEnabled = true;
         _GlobalMenuAuthority.FzszEnabled = true;
         _GlobalMenuAuthority.FzszEnabled = true;
+#else
+        _GlobalMenuAuthority.DsszEnabled = false;
+        _GlobalMenuAuthority.SxszEnabled = false;
+        _GlobalMenuAuthority.FzszEnabled = false;
+#endif
         // 8、设备维护菜单
         // 8、设备维护菜单
         _GlobalMenuAuthority.SbcqEnabled = true;
         _GlobalMenuAuthority.SbcqEnabled = true;
+#ifndef NOT_USE_CONTROL
         _GlobalMenuAuthority.GjsjEnabled = true;
         _GlobalMenuAuthority.GjsjEnabled = true;
+#else
+        _GlobalMenuAuthority.GjsjEnabled = false;
+#endif
         _GlobalMenuAuthority.KzbsjEnabled = true;
         _GlobalMenuAuthority.KzbsjEnabled = true;
         _GlobalMenuAuthority.HhccszEnabled = false;
         _GlobalMenuAuthority.HhccszEnabled = false;
         _GlobalMenuAuthority.PzdrdcEnabled = true;
         _GlobalMenuAuthority.PzdrdcEnabled = true;
@@ -849,6 +877,7 @@ void SetMenuAuthority(int RoleID)
         _GlobalMenuAuthority.DsszEnabled = false;
         _GlobalMenuAuthority.DsszEnabled = false;
         _GlobalMenuAuthority.SxszEnabled = false;
         _GlobalMenuAuthority.SxszEnabled = false;
         _GlobalMenuAuthority.FzszEnabled = false;
         _GlobalMenuAuthority.FzszEnabled = false;
+
         // 8、设备维护菜单
         // 8、设备维护菜单
         _GlobalMenuAuthority.SbcqEnabled = false;
         _GlobalMenuAuthority.SbcqEnabled = false;
         _GlobalMenuAuthority.GjsjEnabled = false;
         _GlobalMenuAuthority.GjsjEnabled = false;

+ 8 - 0
pro/src/common.h

@@ -77,6 +77,8 @@
 
 
 
 
 
 
+
+
 #define IMAGE_FOLDER        "image"
 #define IMAGE_FOLDER        "image"
 #define LOGO_FILE           "logo.png"
 #define LOGO_FILE           "logo.png"
 #define QRCODE_FILE         "qrcode.png"
 #define QRCODE_FILE         "qrcode.png"
@@ -93,6 +95,12 @@
 #define AC_MAX_CURRENT_VAL 100
 #define AC_MAX_CURRENT_VAL 100
 #define AC_MAX_POWER_VAL 100
 #define AC_MAX_POWER_VAL 100
 
 
+enum{
+    BREAKER_DIO = 0,
+    BREAKER_RS485
+};
+
+
 enum
 enum
 {
 {
 	TOTAL_VOLTAGE_TYPE 			= 0,//统计电压类型
 	TOTAL_VOLTAGE_TYPE 			= 0,//统计电压类型

+ 18 - 4
pro/src/sys.c

@@ -1117,16 +1117,26 @@ quit:
     #define RAM_THRD        50
     #define RAM_THRD        50
     #define RAM_PERIOD      1
     #define RAM_PERIOD      1
 #else
 #else
-    #define RAM_THRD        50
-    #define RAM_PERIOD      60
+    #if(CHIP_TYPE == CHIP_T113s)
+        #define RAM_THRD        20
+        #define RAM_PERIOD      30
+    #else
+        #define RAM_THRD        50
+        #define RAM_PERIOD      60
+    #endif
 #endif
 #endif
 
 
 #ifdef ROM_DEBUG
 #ifdef ROM_DEBUG
     #define ROM_THRD        50
     #define ROM_THRD        50
     #define ROM_PERIOD      1
     #define ROM_PERIOD      1
 #else
 #else
-    #define ROM_THRD        50
-    #define ROM_PERIOD      60
+    #if(CHIP_TYPE == CHIP_T113s)
+        #define ROM_THRD        30
+        #define ROM_PERIOD      40
+    #else
+        #define ROM_THRD        50
+        #define ROM_PERIOD      60
+    #endif
 #endif
 #endif
 
 
 static void mem_check(void)
 static void mem_check(void)
@@ -1144,7 +1154,11 @@ static void mem_check(void)
     }
     }
 
 
     if(mem_cnt%ROM_PERIOD==0) {
     if(mem_cnt%ROM_PERIOD==0) {
+#if(CHIP_TYPE != CHIP_T113s)
         avaMB = sys_get_disk_ava_MB("/");
         avaMB = sys_get_disk_ava_MB("/");
+#else
+        avaMB = sys_get_disk_ava_MB("/mnt/UDISK");
+#endif
         if(avaMB<ROM_THRD) {
         if(avaMB<ROM_THRD) {
             flag = 1;
             flag = 1;
         }
         }

+ 1 - 0
pro/upgrade/upgrade.c

@@ -14,6 +14,7 @@
 #include <dirent.h>
 #include <dirent.h>
 #include "upgrade.h"
 #include "upgrade.h"
 #include "md5.h"
 #include "md5.h"
+#include "cfg.h"
 
 
 
 
 #if 0
 #if 0