Former-commit-id: cb3988b49c99e3d7831de2692fdbb0adc5fe8317
TangShanKaiPing
wanggang 6 years ago
parent 5fd6388237
commit cec0a2d598

@ -23,7 +23,7 @@ namespace IdGen
var values = input.Split(' '); var values = input.Split(' ');
var sn = values[0]; var sn = values[0];
var days = Convert.ToInt32(values[1]); var days = Convert.ToInt32(values[1]);
var endTime = days == 0 ? 0 : new DateTimeOffset(DateTime.UtcNow.Date.AddDays(days + 1).AddSeconds(-1)).ToUnixTimeMilliseconds(); var endTime = days == 0 ? 0 : new DateTimeOffset(DateTime.UtcNow.Date.AddDays(days + 1).AddSeconds(-1)).ToUnixTimeSeconds();
Console.WriteLine($"{sn}-{endTime}".DESEncrypt(sn)); Console.WriteLine($"{sn}-{endTime}".DESEncrypt(sn));
} }
catch (Exception ex) catch (Exception ex)

@ -443,7 +443,7 @@ namespace IoT.Shared.DeviceServices.FBee
{ {
deviceName = "烟雾传感器"; deviceName = "烟雾传感器";
} }
else if (zoneType == 0x000d) else if (zoneType == 0x000d || zoneType == 0x00ff)
{ {
deviceName = "红外感应器"; deviceName = "红外感应器";
} }

@ -381,6 +381,7 @@ namespace IoT.Shared.DeviceServices.Onvif
private Process SetProcess(string file, string arguments) private Process SetProcess(string file, string arguments)
{ {
Console.WriteLine(file); Console.WriteLine(file);
Console.WriteLine(arguments);
var process = new Process var process = new Process
{ {
StartInfo = new ProcessStartInfo StartInfo = new ProcessStartInfo

@ -115,6 +115,7 @@ namespace IoT.Shared.Infrastructure
{ {
this._notifyHost = this._cfg["notify:host"]; this._notifyHost = this._cfg["notify:host"];
var url = $"http://{this._notifyHost}/hub?group={this._cfg["sn"]}"; var url = $"http://{this._notifyHost}/hub?group={this._cfg["sn"]}";
Console.WriteLine($"init connection for {url}");
if (this.Connection != null) if (this.Connection != null)
{ {
this.Connection.DisposeAsync(); this.Connection.DisposeAsync();
@ -144,6 +145,10 @@ namespace IoT.Shared.Infrastructure
{ {
this.Connection.SendAsync(Methods.ClientToServer, method, message, fromConnectionId); this.Connection.SendAsync(Methods.ClientToServer, method, message, fromConnectionId);
} }
else
{
Console.WriteLine($"{_notifyHost} not connected");
}
} }
catch (Exception ex) catch (Exception ex)
{ {

@ -22,6 +22,7 @@ namespace IoT.Shared.Infrastructure
public override void OnConnected() public override void OnConnected()
{ {
Console.WriteLine($"{_notifyHost} OnConnected");
using (var scope = this.applicationServices.CreateScope()) using (var scope = this.applicationServices.CreateScope())
{ {
//同步Node //同步Node
@ -271,7 +272,7 @@ namespace IoT.Shared.Infrastructure
{ {
try try
{ {
Console.WriteLine("send node to server"); Console.WriteLine($"send node to server {_notifyHost}");
this.ClientToServer(method, data.ToJson()); this.ClientToServer(method, data.ToJson());
} }
catch (Exception ex) catch (Exception ex)

@ -27,7 +27,7 @@ namespace IoTNode.Controllers
public IActionResult Index() public IActionResult Index()
{ {
var model = this._nodeRepo.ReadOnlyTable().FirstOrDefault(); var model = this._nodeRepo.ReadOnlyTable().FirstOrDefault();
return View("Views/Home/Node.cshtml", model); return View();
} }
public IActionResult GetNode(Guid id) public IActionResult GetNode(Guid id)

@ -0,0 +1,5 @@
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}

@ -1,5 +1,5 @@
{ {
"version": "1.0.0-rc.2", "version": "1.0.0-rc.4",
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Warning", "Default": "Warning",

@ -3,14 +3,6 @@
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>netcoreapp2.2</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Remove="wwwroot\home.default.html" />
<Content Remove="wwwroot\node.default.html" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\node.default.html" />
<EmbeddedResource Include="wwwroot\home.default.html" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />

@ -1,5 +1,5 @@
{ {
"version": "1.0.0-rc.2", "version": "1.0.0-rc.4",
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Warning", "Default": "Warning",

@ -196,7 +196,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6 control">
<div class="box box-solid"> <div class="box box-solid">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"><img src="/images/switch2.png" style="height:18px;margin-right:10px;" />三路开关</h3> <h3 class="box-title"><img src="/images/switch2.png" style="height:18px;margin-right:10px;" />三路开关</h3>
@ -225,7 +225,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6 control">
<div class="box box-solid"> <div class="box box-solid">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"><img src="/images/switch2.png" style="height:18px;margin-right:10px;" />插座</h3> <h3 class="box-title"><img src="/images/switch2.png" style="height:18px;margin-right:10px;" />插座</h3>
@ -251,7 +251,7 @@
</div> </div>
</div> </div>
<template v-for="device in GetDevices('调色灯')"> <template v-for="device in GetDevices('调色灯')">
<div class="col-md-6"> <div class="col-md-6 control">
<div class="box box-solid"> <div class="box box-solid">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"><img src="/images/light2.png" style="height:18px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3> <h3 class="box-title"><img src="/images/light2.png" style="height:18px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3>
@ -298,7 +298,7 @@
</div> </div>
</template> </template>
<template v-for="device in GetDevices('红外转发器')"> <template v-for="device in GetDevices('红外转发器')">
<div class="col-md-6"> <div class="col-md-6 control">
<div class="box box-solid btns"> <div class="box box-solid btns">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"><img src="/images/control.png" style="height:18px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3> <h3 class="box-title"><img src="/images/control.png" style="height:18px;margin-right:10px;" />{{device.DisplayName||device.Name}}</h3>

@ -1,5 +1,5 @@
{ {
"version": "1.0.0-rc.2", "version": "1.0.0-rc.4",
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Warning" "Default": "Warning"

@ -8,7 +8,8 @@ echo d|xcopy "./src" "./dist/" /s /e /y /f
dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -r linux-x64 -o ../../publish/dist/linux-x64/publish/apps/UserCenter dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -r linux-x64 -o ../../publish/dist/linux-x64/publish/apps/UserCenter
dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -r linux-x64 -o ../../publish/dist/linux-x64/publish/apps/IoTCenter dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -r linux-x64 -o ../../publish/dist/linux-x64/publish/apps/IoTCenter
dotnet publish ../projects/IoT/IoTNode/IoTNode.csproj -c Release -o ../../../publish/dist/linux-arm64/publish/apps/IoTNode dotnet publish ../projects/IoT/IoTNode/IoTNode.csproj -c Release -r linux-arm64 -o ../publish/dist/linux-arm64/publish/apps/IoTNode
dotnet publish ../projects/IoT/IoTNode/IoTNode.csproj -c Release -r linux-arm -o ../publish/dist/linux-arm/publish/apps/IoTNode
::dotnet publish ../projects/IoT/IoTServices/WinService/WinService.csproj -c Release -r win-x86 -o "../../publish/dist/win-x86/Program Files (x86)/WinService" ::dotnet publish ../projects/IoT/IoTServices/WinService/WinService.csproj -c Release -r win-x86 -o "../../publish/dist/win-x86/Program Files (x86)/WinService"
::dotnet publish ../projects/IoT/IoTServices/APService/APService.csproj -c Release -o ../../publish/dist/linux-arm64/publish/apps/APService ::dotnet publish ../projects/IoT/IoTServices/APService/APService.csproj -c Release -o ../../publish/dist/linux-arm64/publish/apps/APService
::dotnet publish ../projects/IoT/IoTServices/FBeeService/FBeeService.csproj -c Release -r linux-arm64 -o ../publish/dist/linux-arm64/publish/apps/FBeeService ::dotnet publish ../projects/IoT/IoTServices/FBeeService/FBeeService.csproj -c Release -r linux-arm64 -o ../publish/dist/linux-arm64/publish/apps/FBeeService

@ -1,56 +1,49 @@
#!/bin/bash #!/bin/bash
#set root password #set root password
sudo passwd root<<! #sudo passwd root<<!
pi #pi
pi #pi
! #!
#install packages http://archive.raspbian.org/raspbian/pool/main/ #install packages http://archive.raspbian.org/raspbian/pool/main/
sudo dpkg -i ~/publish/files/openntpd_6.0p1-2_armhf.deb #sudo dpkg -i ~/publish/files/openntpd_6.0p1-2_armhf.deb
sudo dpkg -i ~/publish/files/python-meld3_1.0.2-2_all.deb #sudo dpkg -i ~/publish/files/python-meld3_1.0.2-2_all.deb
sudo dpkg -i ~/publish/files/supervisor_3.3.5-1_all.deb sudo dpkg -i ~/publish/files/supervisor_3.3.5-1_all.deb
sudo dpkg -i ~/publish/files/fonts-wqy-zenhei_0.9.45-7_all.deb #sudo dpkg -i ~/publish/files/fonts-wqy-zenhei_0.9.45-7_all.deb
sudo dpkg -i ~/publish/files/n2n_2.5.0-170_armhf.deb #sudo dpkg -i ~/publish/files/n2n_2.5.0-170_armhf.deb
#http://packages.ntop.org/ #http://packages.ntop.org/
sudo dpkg -i ~/publish/files/n2n_2.5.0-170_armhf.deb #sudo dpkg -i ~/publish/files/n2n_2.5.0-170_armhf.deb
mkdir -p ~/dotnet #mkdir -p ~/dotnet
tar zxf ~/publish/files/dotnet-sdk-2.2.300-linux-arm.tar.gz -C ~/dotnet #tar zxf ~/publish/files/dotnet-sdk-2.2.300-linux-arm.tar.gz -C ~/dotnet
if [ "`which dotnet`" == "" ]; then #if [ "`which dotnet`" == "" ]; then
echo 'export PATH=$PATH:/home/pi/dotnet'>>~/.bashrc # echo 'export PATH=$PATH:/home/pi/dotnet'>>~/.bashrc
echo 'export DOTNET_ROOT=/home/pi/dotnet'>>~/.bashrc # echo 'export DOTNET_ROOT=/home/pi/dotnet'>>~/.bashrc
fi #fi
#sudo dpkg --purge oracle-java8-jdk #sudo dpkg --purge oracle-java8-jdk
if [ `uname -m` == "aarch64" ];then #if [ `uname -m` == "aarch64" ];then
sudo dpkg -i ~/publish/files/bellsoft-jdk1.8.0-linux-arm64.deb # sudo dpkg -i ~/publish/files/bellsoft-jdk1.8.0-linux-arm64.deb
fi #fi
#config system #config system
sudo systemctl enable ssh #sudo systemctl enable ssh
#sudo systemctl enable vncserver-x11-serviced.service #sudo systemctl enable vncserver-x11-serviced.service
sudo timedatectl set-timezone 'Asia/Shanghai' #sudo timedatectl set-timezone 'Asia/Shanghai'
sudo timedatectl set-ntp true #sudo timedatectl set-ntp true
#config autostart #config autostart
mkdir -p ~/.config/autostart #mkdir -p ~/.config/autostart
touch ~/.config/autostart/chromium.desktop #touch ~/.config/autostart/chromium.desktop
echo ''>~/.config/autostart/chromium.desktop #echo ''>~/.config/autostart/chromium.desktop
echo '[Desktop Entry]'>>~/.config/autostart/chromium.desktop #echo '[Desktop Entry]'>>~/.config/autostart/chromium.desktop
#echo 'Exec=bash -c "chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=file:///home/pi/publish/apps/IoTNode/wwwroot/index.html"'>>~/.config/autostart/chromium.desktop #echo 'Exec=bash -c "chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=file:///home/pi/publish/apps/IoTNode/wwwroot/index.html"'>>~/.config/autostart/chromium.desktop
echo 'Exec=bash -c "sleep 20&&chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=http://localhost:8002/index.html"'>>~/.config/autostart/chromium.desktop #echo 'Exec=bash -c "sleep 20&&chromium-browser -kiosk --disable-session-crashed-bubble --disable-infobars -app=http://localhost:8002/index.html"'>>~/.config/autostart/chromium.desktop
#config apps #config apps
sudo cp -f ~/publish/supervisord.conf /etc/supervisor/supervisord.conf sudo cp -f ~/publish/supervisord.conf /etc/supervisor/supervisord.conf
sudo chmod 755 ~/publish/apps/IoTNode/IoTNode.dll sudo chmod 755 ~/publish/apps/IoTNode/IoTNode
sudo chmod 755 ~/publish/apps/NJWLService/start.sh sudo chmod 755 ~/publish/apps/IoTNode/wwwroot/ffmpeg-linux-arm
sudo chmod 755 ~/publish/apps/NJWLService/NJWLService.jar sudo chmod 755 ~/publish/apps/IoTNode/wwwroot/ffmpeg-linux-arm64
sudo chmod 755 ~/publish/apps/APService/APService.dll
sudo chmod 755 ~/publish/apps/ONVIFService/ONVIFService.dll
sudo chmod 755 ~/publish/apps/ONVIFService/wwwroot/ffmpeg-linux-arm
sudo chmod 755 ~/publish/apps/ONVIFService/wwwroot/ffmpeg-linux-arm64
sudo chmod 755 ~/publish/apps/SerialPortService/SerialPortService.dll
sudo chmod 755 ~/publish/apps/LiChuangService/LiChuangService.dll
sudo chmod 755 ~/publish/apps/srs/objs/srs
#restart #restart
sudo reboot sudo reboot

@ -1,6 +0,0 @@
[program:apservice]
directory=/home/pi/publish/apps/APService/
command=bash -c "~/dotnet/dotnet APService.dll"
autostart=true
autorestart=true
user=pi

@ -1,6 +1,6 @@
[program:iotnode] [program:iotnode]
directory=/home/pi/publish/apps/IoTNode/ directory=/home/pi/publish/apps/IoTNode/
command=bash -c "~/dotnet/dotnet IoTNode.dll" command=/home/pi/publish/apps/IoTNode/IoTNode
autostart=true autostart=true
autorestart=true autorestart=true
user=pi user=pi

@ -1,6 +0,0 @@
[program:lichangservice]
directory=/home/pi/publish/apps/LiChuangService/
command=bash -c "~/dotnet/dotnet LiChuangService.dll"
autostart=true
autorestart=true
user=pi

@ -1,8 +0,0 @@
[program:onvifservice]
directory=/home/pi/publish/apps/ONVIFService/
command=bash -c "~/dotnet/dotnet ONVIFService.dll"
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=pi

@ -1,6 +0,0 @@
[program:spservice]
directory=/home/pi/publish/apps/SerialPortService/
command=bash -c "~/dotnet/dotnet SerialPortService.dll"
autostart=true
autorestart=true
user=pi

@ -1,6 +0,0 @@
[program:srs]
directory=/home/pi/publish/apps/srs
command=bash -c "./objs/srs -c conf/srs.conf
autostart=true
autorestart=true
user=pi

@ -33,4 +33,16 @@ vhost __defaultVhost__ {
hls_m3u8_file [app]/[stream].m3u8; hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts; hls_ts_file [app]/[stream]-[seq].ts;
} }
} dvr {
enabled off;
dvr_path ./objs/nginx/html/[app].[stream].[timestamp].flv;
dvr_plan session;
dvr_duration 30;
dvr_wait_keyframe on;
time_jitter full;
}
http_hooks {
enabled on;
on_dvr http://localhost/IoTCenter/App/OnDvr;
}
}

@ -23,7 +23,7 @@ http {
keepalive_timeout 65; keepalive_timeout 65;
server { server {
listen 192.168.3.124:80; listen 127.0.0.1:80;
server_name localhost; server_name localhost;
location ^~ /live/ { location ^~ /live/ {
@ -47,5 +47,4 @@ http {
root html; root html;
} }
} }
} }

Loading…
Cancel
Save