diff --git a/.gitignore b/.gitignore index 4ecfffc7..6e3ed41d 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,6 @@ ci.sh data/ apps/dgiot_parse/etc/dgiot_parse.conf apps/dgiot_jieshun/ +apps/dgiot_mingcheng/ +apps/dgiot_xinchuangwei/ apps/dgiot_http/etc/dgiot_http.conf diff --git a/apps/dgiot/src/storage/dgiot_data.erl b/apps/dgiot/src/storage/dgiot_data.erl index 5c2a8eac..361f4cfe 100644 --- a/apps/dgiot/src/storage/dgiot_data.erl +++ b/apps/dgiot/src/storage/dgiot_data.erl @@ -291,3 +291,4 @@ dets_loop(Name, Fun, Key, Acc) -> dets_loop(Name, Fun, dets:next(Name, Key), Acc); '$end_of_table' -> ok end. + diff --git a/apps/dgiot_task/src/dgiot_task.erl b/apps/dgiot_task/src/dgiot_task.erl index a12376ad..dcb2b6a4 100644 --- a/apps/dgiot_task/src/dgiot_task.erl +++ b/apps/dgiot_task/src/dgiot_task.erl @@ -72,7 +72,7 @@ start(#{ } = Args) -> %% 设备没上线则不加入到采集任务队列中 dgiot_data:set_consumer(<<"taskround/", Channel/binary, "/", DtuId/binary>>, 1000000), - case dgiot_task:get_pnque(DtuId) of + case dgiot_task:get_pnque(<<"207636730b">>) of not_find -> %% ?LOG(info, "not_find ~p", [DtuId]); pass; diff --git a/apps/dgiot_task/src/dgiot_task_channel.erl b/apps/dgiot_task/src/dgiot_task_channel.erl index ddbae4db..f9e4219a 100644 --- a/apps/dgiot_task/src/dgiot_task_channel.erl +++ b/apps/dgiot_task/src/dgiot_task_channel.erl @@ -83,7 +83,7 @@ order => 4, type => string, required => false, - default => <<"2020-05-28 10:35:10"/utf8>>, + default => <<"2025-05-28 10:35:10"/utf8>>, title => #{ zh => <<"结束时间"/utf8>> }, @@ -95,7 +95,7 @@ order => 5, type => integer, required => false, - default => 20, + default => 180, title => #{ zh => <<"采集频率/秒"/utf8>> }, diff --git a/apps/dgiot_task/src/dgiot_task_worker.erl b/apps/dgiot_task/src/dgiot_task_worker.erl index 045a9fb2..423f94c8 100644 --- a/apps/dgiot_task/src/dgiot_task_worker.erl +++ b/apps/dgiot_task/src/dgiot_task_worker.erl @@ -200,7 +200,7 @@ send_msg(#task{tid = Channel, product = Product, devaddr = DevAddr, ref = Ref, q _ -> erlang:cancel_timer(Ref) end, NewQue = lists:nthtail(NewCount, Que), - State#task{que = NewQue, dis = Dis, ref = erlang:send_after((Interval + 5) * 1000, self(), retry)}. + State#task{que = NewQue, dis = Dis, ref = erlang:send_after(Interval * 1000, self(), retry)}. get_next_pn(#task{mode = Mode, dtuid = DtuId, firstid = DeviceId, product = ProductId, devaddr = DevAddr, round = Round, ref = Ref} = State) -> diff --git a/apps/dgiot_tdengine/src/handler/dgiot_tdengine_handler.erl b/apps/dgiot_tdengine/src/handler/dgiot_tdengine_handler.erl index d6280cbc..f1922430 100644 --- a/apps/dgiot_tdengine/src/handler/dgiot_tdengine_handler.erl +++ b/apps/dgiot_tdengine/src/handler/dgiot_tdengine_handler.erl @@ -339,28 +339,29 @@ get_app(ProductId, Results) -> error -> Acc; {ok, Name} -> - {NewV, Unit, Ico} = + {NewV, Unit, Ico, Devicetype} = case maps:find(Name, Props) of error -> {V, <<"">>, <<"">>}; {ok, #{<<"dataType">> := #{<<"type">> := Type, <<"specs">> := Specs}} = Prop} -> + Devicetype1 = maps:get(<<"devicetype">>, Prop, <<"others">>), case Type of Type1 when Type1 == <<"enum">>; Type1 == <<"bool">> -> Value = maps:get(dgiot_utils:to_binary(V), Specs, V), Ico1 = maps:get(<<"ico">>, Prop, <<"">>), - {Value, <<"">>, Ico1}; + {Value, <<"">>, Ico1, Devicetype1}; Type2 when Type2 == <<"struct">> -> Ico1 = maps:get(<<"ico">>, Prop, <<"">>), - {V, <<"">>, Ico1}; + {V, <<"">>, Ico1, Devicetype1}; _ -> Unit1 = maps:get(<<"unit">>, Specs, <<"">>), Ico1 = maps:get(<<"ico">>, Prop, <<"">>), - {V, Unit1, Ico1} + {V, Unit1, Ico1, Devicetype1} end; _ -> - {V, <<"">>, <<"">>} + {V, <<"">>, <<"">>, <<"">>} end, - Acc ++ [#{<<"name">> => Name, <<"number">> => NewV, <<"time">> => NewTime, <<"unit">> => Unit, <<"imgurl">> => Ico}] + Acc ++ [#{<<"name">> => Name, <<"number">> => NewV, <<"time">> => NewTime, <<"unit">> => Unit, <<"imgurl">> => Ico, <<"devicetype">> => Devicetype}] end end, [], R) end, [], Results). diff --git a/data/loaded_plugins.tmpl b/data/loaded_plugins.tmpl index 3295888c..1ca13d61 100644 --- a/data/loaded_plugins.tmpl +++ b/data/loaded_plugins.tmpl @@ -25,3 +25,5 @@ {dgiot_modbus, {{enable_plugin_dgiot_modbus}}}. {dgiot_group, {{enable_plugin_dgiot_group}}}. {dgiot_ffmpeg, {{enable_plugin_dgiot_ffmpeg}}}. +{dgiot_ffmpeg, {{enable_plugin_dgiot_xinchuangwei}}}. +{dgiot_ffmpeg, {{enable_plugin_dgiot_mingcheng}}}. diff --git a/rebar.config.erl b/rebar.config.erl index b5647c21..989b7ef8 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -218,6 +218,8 @@ overlay_vars_rel(RelType) -> , {enable_plugin_dgiot_modbus, true} , {enable_plugin_dgiot_group, true} , {enable_plugin_dgiot_ffmpeg, true} + , {enable_plugin_dgiot_xinchuangwei, true} + , {enable_plugin_dgiot_mingcheng, true} , {vm_args_file, VmArgs} ]. @@ -345,6 +347,8 @@ relx_plugin_apps_per_rel(cloud) -> , dgiot_modbus , dgiot_group , dgiot_ffmpeg + , dgiot_xinchuangwei + , dgiot_mingcheng ]; relx_plugin_apps_per_rel(edge) -> [].