smallchi / jt808gateway Goto Github PK
View Code? Open in Web Editor NEWJT/T808 Gateway,JT808 Gateway, GB808 Gateway(support 2011, 2013, 2019 version) JT/T808网关、JT808网关、GB808网关(支持2011、2013、2019版本)
License: MIT License
JT/T808 Gateway,JT808 Gateway, GB808 Gateway(support 2011, 2013, 2019 version) JT/T808网关、JT808网关、GB808网关(支持2011、2013、2019版本)
License: MIT License
Dears,
Great project,now I can build this project on Ubuntu arm64 platform, but encounter below error when I run the JT808.Gateway.SimpleServer, could you give me some help or hints to fix it, sorry for this naive problem.
bin/Debug/netcoreapp3.1/JT808.Gateway.SimpleServer
dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
Hosting starting
info: JT808TcpServer[0]
JT808 TCP Server start at 0.0.0.0:808.
info: JT808TcpReceiveTimeout[0]
[Check Receive Timeout]
info: JT808TcpReceiveTimeout[0]
[Session Online Count]:0
info: JT808UdpServer[0]
JT808 Udp Server start at 0.0.0.0:808.
info: JT808UdpReceiveTimeout[0]
[Check Receive Timeout]
info: JT808UdpReceiveTimeout[0]
[Session Online Count]:0
fail: JT808TransmitService[0]
初始化配置链接远程服务端all_127.0.0.1:20000,链接异常:System.Net.Sockets.SocketException (111): Connection refused
at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state, Boolean flowContext)
at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.ConnectAsync(EndPoint remoteEP)
at JT808.Gateway.Transmit.JT808TransmitService.InitRemoteServsers()
Unhandled exception. System.IO.IOException: Error loading native library "/root/dotnet/JT808Gateway/simples/JT808.Gateway.SimpleServer/bin/Debug/netcoreapp3.1/runtimes/linux/native/libgrpc_csharp_ext.x64.so".
at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
at Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary()
at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
at Grpc.Core.Internal.NativeExtension..ctor()
at Grpc.Core.Internal.NativeExtension.Get()
at Grpc.Core.Internal.NativeMethods.Get()
at Grpc.Core.GrpcEnvironment.GrpcNativeInit()
at Grpc.Core.GrpcEnvironment..ctor()
at Grpc.Core.GrpcEnvironment.AddRef()
at Grpc.Core.Server..ctor(IEnumerable`1 options)
at Grpc.Core.Server..ctor()
at JT808.Gateway.JT808GrpcServer.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at JT808.Gateway.SimpleServer.Program.Main(String[] args) in /root/dotnet/JT808Gateway/simples/JT808.Gateway.SimpleServer/Program.cs:line 61
at JT808.Gateway.SimpleServer.Program.
1、gps数据通过此网关处理后,怎么通过websocket将接收到的GPS位置数据广播到所有html5页面中,h5中通过websocket获取位置数据后立刻更新位置。
2、此网关服务实例怎么扩展自定义接收到的消息呢?不是标准的808协议
部标2019版本已经发布,请问后续是否有支持2019版本的计划?
JTT 808-2019.PDF
Pipeline DotNetty性能方面有差异吗?
Unhandled exception. System.Net.Sockets.SocketException (13): Permission denied
对于启动已配置好的端口的监听服务, 有单独控制器启动,暂停,结束的功能吗?
比如想集成到windows服务中运行, 在服务启动停止的时候对服务进行控制
JT808.DotNetty.SimpleClient 好像不能用哎
大佬,接收平台方转发数据这里貌似有坑,目前有两种情况:1、连接正常情况下,对方IP端口不变,断开连接后调用item.ReceiveTimeout.Cancel()无效,超过10分钟的会话仍然存在,必须调用SessionManager.RemoveByTerminalPhoneNo方法才能移除该会话,不调用则必须重启服务,否则无法再次上线,重启服务之后也不能立即上线,需要最长10分钟才能上线。
2、对方IP不变端口一直在变,会话中存在多条该终端号记录,其中包含相同的IP端口数据,也有不同的端口。每台设备平均每10秒钟打印一条JT808SessionOnline日志。
JT808SessionManager.TerminalPhoneNoSessions数量为1500,JT808SessionManager.Sessions数量超过10万,不重启服务会话数量会一直增长,内存也随之不断增长。
我尝试在容器中运行时,发现必须使用 root 并且 要使用参数--privileged=true,我查了一些资料问题指向了 Raw socket使用问题,这会给容器带来潜在的安全问题,能否有办法避免?
对于某些GPS设备发送的非808协议数据用该网关怎么处理呢?网关可以改造么,谢谢
Pipeline版本怎么集成LengthFieldBasedFrameDecoder协议,调试代码的时候发现不是正确包的时候,抛出了相关异常,下次再发数据包时就进入了Write了,然后就断开了连接,是为什么呢?
Q:通过WebApi接口UnificationSend向设备发送消息后,返回值只指明了是否发送成功,怎么取回设备返回的消息呢?比如发送0x8801后,设备返回0x0805,客户端怎么能拿到这个0x0805消息呢?
dbug: Microsoft.Extensions.Hosting.Internal.Host[1]
Hosting starting
Unhandled exception. System.Net.Sockets.SocketException (13): Permission denied
at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
at JT808.Gateway.JT808TcpServer.InitServer() in /_/src/JT808.Gateway/JT808TcpServer.cs:line 82
at JT808.Gateway.JT808TcpServer..ctor(IOptionsMonitor1 configurationMonitor, IJT808MsgProducer msgProducer, IJT808MsgReplyLoggingProducer msgReplyLoggingProducer, JT808MessageHandler messageHandler, IJT808Config jT808Config, ILoggerFactory loggerFactory, JT808SessionManager jT808SessionManager, JT808BlacklistManager jT808BlacklistManager) in /_/src/JT808.Gateway/JT808TcpServer.cs:line 75 at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) at System.Collections.Concurrent.ConcurrentDictionary
2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Program.
自定义了 5808 5000 端口都EXPOSE 了
大神,JT808.DotNetty.Transmit 这个不开源吗,我在源码中没找到。
若在接收JT808包中,有一个是非JT808包,会导致异常后,无法继续接收后面正常的JT808包。经查错误代码如下:
JT808TcpServer.cs(207行)
//if (beginMark != JT808Package.BeginFlag) throw new ArgumentException("Not JT808 Packages." + "[" + beginMark.ToString() + "]");
if (beginMark != JT808Package.BeginFlag)
{
totalConsumed = seqReader.Length;
seqReader.Advance(seqReader.Length);
}
另外,若MessageHandler处理出现异常也会出现无法继续接收下个JT808包的情况。目前 ,我是在MessageHandlertry-catch所有异常,不再向上抛。
windows环境下使用kafka队列接入1200多台终端,QueueServerHosting占用内存会越来越大,大概每秒0.1M的速度增长,直至占用内存100%,始终找不到是哪出问题了
作者你好!看了你的项目觉得做得很好,可以联系吗?
编译完毕后,运行 JT808.Gateway.SimpleServer.exe 时出现下面的错误:
fail: JT808.Gateway.Transmit.JT808TransmitService[0]
该终端all已尝试未连接上该服务器127.0.0.1:20000
System.Net.Sockets.SocketException (10061): 由于目标计算机积极拒绝,无法连接。
这个监听20000端口的是哪个程序?怎么启动?
你好作者,我用了你部分代码监听GPS设备(DotNetty TCP协议),一台设备接入的时候正常接收信息,但是当2台以上GPS 设备通讯的时候 就会出现DotNetty 主动断开Channel 的情况,这时候GPS 设备又会重新连接(重新注册、鉴权)。 这种情况会频繁出现。
我通过日志看到是先走了 CloseAsync函数 (您在注释中说是 server端主动断开)。想请您看看我的代码帮我分析一下问题(有偿)。
WX号:15141173250. 希望得到你的帮助。
请问如何使平台主动给设备下发指令? 比如主动下发 终端属性查询指令
你好,808服务端能获取到设备的ip吗?
大神,基于JT808DotNetty做主动安全的协议,里面的附件上传是码流方式,和信令是一个通道。原本想做一个拓展库,发现 AddJT808TcpNettyHost 这个方法里面用到类很多是internal。我想做的是在解码中再插入一个分隔符“0x30 0x31 0x63 0x64”,现在看来只有修改源码了吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.