Find the coordinates returned by the server after send commands GPS Tracker (TK303 etc)
I sent commands to the server according to the following links and data was returned that I do not know how to find the coordinates.
Link 1: GPS103 Tracker Listening Application in C#
Link 2: sending commands to tk103 gps tracker
Returned data: imei:XXXXXXXXXXXXXXX,tracker,220506170600,,F,230600.00,A,3541.45559,N,05122.93316,E,,;
I also did not find the exact source for sending the commands to the server. Example I found: How to send commands via GPRS to GPS Tracker (TK103, GT02, GT06, TK102 etc)
do you know?
how many words do you know
See also questions close to this topic
-
C# - Adding condition to func results in stack overflow exception
I have a func as part of specification class which sorts the given iqueryable
Func<IQueryable<T>, IOrderedQueryable<T>>? Sort { get; set; }
When i add more than one condition to the func like below , it results in stack overflow exception.
spec.OrderBy(sc => sc.Case.EndTime).OrderBy(sc => sc.Case.StartTime);
The OrderBy method is implemented like this
public ISpecification<T> OrderBy<TProperty>(Expression<Func<T, TProperty>> property) { _ = Sort == null ? Sort = items => items.OrderBy(property) : Sort = items => Sort(items).ThenBy(property); return this; }
Chaining or using separate lines doesn't make a difference.
This problem gets resolved if I assign a new instance of the specification and set it's func, but i don't want to be assigning to a new instance everytime. Please suggest what am i missing here and how to reuse the same instance (if possible).
-
How to projection fields for a dictionary (C#, MongdoDB)
I am trying my luck here, I have a model which is like the following
public class RowData : BaseBsonDefinition { . [BsonExtraElements] [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfDocuments)] public Dictionary<string, object> Rows { get; set; } = new(StringComparer.OrdinalIgnoreCase); . }
In result, the schema in the MongoDB looks like
{ "_id": { "$binary": { "base64": "HiuI1sgyT0OZmcgGUit2dw==", "subType": "03" } }, "c1": "AAA", "c8": "Fully Vac", "c10": "", }
Those c1, c8 and c10 fields are keys from the dictionary, my question is how to dynamic project those fields?
I tried
Builders<RowData>.Projection.Exclude(p => "c1")
It seems the MongoDB driver can not handle a value directly.
Anyone could point me in the correct direction?
Thanks,
-
How do I add new DataSource to an already Databinded CheckBoxList
i'm building a web form that show Database's item(Tables, Rows, FK,...)
I have a CheckBoxList of Tables (
chkListTable
) which will show a new CheckBoxList of Rows (chkListRow
) everytime I SelectedIndexChanged fromchkListTable
. The problem is i can show the items fromchkListTable
with 1 selected item. But i don't know how to showchkListRow
if multiple item fromchkListTable
are selected.Here are my codes:
aspx
:<div> <asp:Label ID="Label2" runat="server" Text="Table: "></asp:Label> <asp:CheckBoxList ID="chkListTable" runat="server" DataTextField="name" DataValueFeild="name" AutoPostBack="true" OnSelectedIndexChanged="chkListTable_SelectedIndexChanged"> </asp:CheckBoxList> </div> <div> <asp:CheckBoxList ID="chkListRow" runat="server" DataTextField="COLUMN_NAME" DataValueField="COLUMN_NAME" RepeatDirection="Horizontal"> </asp:CheckBoxList> </div>
aspx.cs
:protected void chkListTable_SelectedIndexChanged(object sender, EventArgs e) { tableName.Clear(); foreach (ListItem item in chkListTable.Items) { if(item.Selected) { tableName.Add(item.Text.Trim()); } } for(int i = 0; i < tableName.Count; i++) { String query = "USE " + dbname + " SELECT * FROM information_schema.columns" + " WHERE table_name = '" + tableName[i] + "'" + " AND COLUMN_NAME != 'rowguid'"; chkListRow.DataSource = Program.ExecSqlDataReader(query); chkListRow.DataBind(); Program.conn.Close(); } }
Program.cs
:public static bool Connect() { if (Program.conn != null && Program.conn.State == ConnectionState.Open) Program.conn.Close(); try { Program.conn.ConnectionString = Program.constr; Program.conn.Open(); return true; } catch (Exception e) { return false; } } public static SqlDataReader ExecSqlDataReader(String query) { SqlDataReader myreader; SqlCommand sqlcmd = new SqlCommand(query, Program.conn); sqlcmd.CommandType = CommandType.Text; if (Program.conn.State == ConnectionState.Closed) Program.conn.Open(); try { myreader = sqlcmd.ExecuteReader(); return myreader; myreader.Close(); } catch (SqlException ex) { Program.conn.Close(); return null; } }
I want my display to be like this:
[x]Table1 [x]Table2 [ ]Table3 [ ]Row1(Table1) [ ]Row2(Table1) [ ]Row3(Table1) [ ]Row1(Table2) [ ]Row2(Table2)
-
Socket.IO cannot establish a connection
I use socket.io-client for Javascript server on JAVA and when I enter address 'ws://10.201.223.67:9902/' the request is not by 'ws' but by 'http'.
Although I understand it should just come back 0
It keeps trying to connect.To connect using my own written hook
export function useSocketIO(url: string) { const ioRef = useRef<Socket>(); const [connected, setConnected] = useState(false); useEffect(() => { ioRef.current = io(url, { transportOptions: { polling: { extraHeaders: { Authorization: `Bearer ${APIAuth.accessToken}`, }, }, }, }); ioRef.current.on('connect', () => { console.log('WS Connected to', url); setConnected(() => true); }); ioRef.current.on('disconnect', () => { console.log('WS disconnected'); setConnected(() => false); }); return () => { console.log('WS destroyed'); ioRef.current?.close(); }; }, [url]); return { io: ioRef.current, connected, }; }
-
Steps involved in making a TCP connection
I am 18 and about to go to college for CS, I know nothing about socket programming in C.
I read the man pages on sockets, can you tell me if I got the steps right?
Server Steps:
create a socket with
socket()
create an address with a struct [presumably using some kind of
sockaddr
struct variant]bind the socket to the address with
bind()
listen for a connection with
listen()
accept the connection, and move the connection to another socket using
accept()
to free up the original "listening" socketuse
read()
andwrite()
to communicate over the new socket
Client Steps:
create a socket with
socket()
specify the address of the server we want to connect to [presumably using some
sockaddr
struct variant]connect the socket to the address using
connect()
use
read()
andwrite()
to communicate over the socket
-
Websocket with special characters
I am using websocket with client nodejs and server golang (net library) via tcp. I am read data sent from client but many special chars. Some one can help me about that?
Data received:
\u0016\u0003\u0001\u0002\u0000\u0001\u0000\u0001\ufffd\u0003\u0003x\ufffd_\ufffdj\ufffd\ufffd\ufffd\ufffdȬ{\ufffd \ufffdI\u003c9\u000bC1YŲ\ufffdVp\u0017\ufffd\u000e`\ufffd \ufffd\ufffd\ufffd\u0017\ufffd\ufffd=\\u0002\ufffd~,\u0011\ufffdn\ufffd\ufffdY\u0010\ufffd\u001c\ufffdw\u000f\ufffd\ufffd(hfK\ufffd\ufffd\u0000 \u001a\u001a\u0013\u0001\u0013\u0002\u0013\u0003\ufffd+\ufffd/\ufffd,\ufffd0̨̩\ufffd\u0013\ufffd\u0014\u0000\ufffd\u0000\ufffd\u0000/\u00005\u0001\u0000\u0001\ufffd\ufffd\ufffd\u0000\u0000\u0000\u0000\u0000\u0014\u0000\u0012\u0000\u0000\u000fvenus.localhost\u0000\u0017\u0000\u0000\ufffd\u0001\u0000\u0001\u0000\u0000"
This func use to accept tcp
func (s *WebsocketServer) Serve() { if s.running { return } s.running = true for _, lsn := range s.lsnList { for i := 0; i < s.accepts; i++ { go func(lsn2 *net.TCPListener) { var ( conn *net.TCPConn err error ) for { if conn, err = AcceptTCP(lsn2); err != nil { // if listener close then return log.Error("listener.Accept(\"%s\") error(%v)", lsn2.Addr().String(), err) return } if err = conn.SetKeepAlive(s.c.Keepalive); err != nil { log.Error("conn.SetKeepAlive() error(%v)", err) return } if err = conn.SetReadBuffer(s.c.ReceiveBuf); err != nil { log.Error("conn.SetReadBuffer() error(%v)", err) return } if err = conn.SetWriteBuffer(s.c.SendBuf); err != nil { log.Error("conn.SetWriteBuffer() error(%v)", err) return } go s.establishWebsocketConnection(conn) } }(lsn) } } } func (s *WebsocketServer) establishWebsocketConnection(conn net.Conn) { var ( // conn2 = NewBufferedConnSize(conn, 66560) req *websocket.Request websocketConn *websocket.Conn err error ) rr := bufio.NewReader(conn) if req, err = websocket.ReadRequest(rr); err != nil || req.RequestURI != "/apiws" { conn.Close() if err != io.EOF { log.Errorf("websocket.ReadRequest(rr) error(%v)", err) } return } else { wr := bufio.NewWriter(conn) websocketConn, err = websocket.Upgrade(conn, rr, wr, req) if err != nil { log.Errorf("websocket.Upgrade(rr) error(%v)", err) conn.Close() return } } codec, err := NewCodecByName(s.c.ProtoName, websocketConn) tcpConn := NewTcpConnection2(s.c.ServerName, websocketConn, s.c.SendChanSize, codec, true, s) // log.Info("establishTcpConnection...") defer func() { if err := recover(); err != nil { log.Error("tcp_server handle panic: %v\n%s", err, debug.Stack()) tcpConn.Close() } }() s.onNewConnection(tcpConn) for { tcpConn.conn.SetReadDeadline(time.Now().Add(time.Minute * 6)) msg, err := tcpConn.Receive() if err != nil { log.Error("conn: %s recv error: %v", tcpConn, err) return } if msg == nil { log.Error("recv a nil msg by conn: %s", tcpConn) continue } if s.callback != nil { // log.Info("onConnectionDataArrived - conn: %s", conn) if err := s.callback.OnConnectionDataArrived(tcpConn, msg); err != nil { } } } }
Function from websocket file, I print data here like above
func ReadRequest(r *bufio.Reader) (req *Request, err error) { var ( b []byte ok bool ) req = &Request{reader: r} if b, err = req.readLine(); err != nil { return } log.Errorf("websocket.ReadRequest: %s", string(b)) if req.Method, req.RequestURI, req.Proto, ok = parseRequestLine(string(b)); !ok { return nil, fmt.Errorf("malformed HTTP request %s", b) } if req.Header, err = req.readMIMEHeader(); err != nil { return } req.Host = req.Header.Get("Host") return req, nil } func (r *Request) readLine() ([]byte, error) { var line []byte for { l, more, err := r.reader.ReadLine() if err != nil { return nil, err } // Avoid the copy if the first call produced a full line. if line == nil && !more { return l, nil } line = append(line, l...) if !more { break } } return line, nil }
Please help me
-
Find GPS coordinates of new location with respect to another GPS location at a range, azimuth and elevation & roll, pitch and yaw
I have GPS coordinates of my quadcopter A - LatA, LongA and HeightA.
My quadcopter attitude is not straight and level, it has current Roll angle - RollA, current Pitch angle - PitchA and Current Heading HdgA with respect to North.
My quadcopter focusses/throws a light at a range R meters, elevation E degrees (with respect to horizontal plane of quadcopter), Azimuth A (with respect to nose/longitudinal axes of quadcopter).
I need to find the GPS coordinates of location where my quadcopter focusses its light.
-
Is there still a way to use RTKLIB with a Novatel OEM3 card?
I have a Novatel OEM3 card which can't handle the GPS week rollover, it gives 2002 as the current year.
As the OEM3 protocol is supported by RTKLIB, is there a workaround or patch for RTKLIB? So that I can still use this card?
-
GNSS-SDR on Windows?
I know the answer might be negative, but is there any way to run Gnss-Sdr on Windows Instead of Linux/Mac OS? I Use it on Linux Already But I have just wondered if it can be done. only related answers please.