Reprogramming Pet GPS tracker to send data to my own server - gps

sorry if this is the wrong "stack". I could not find a better suited.
I bought a GPS tracker for my dog, which came with a subscription, a SIM card and a poorly developed app.
I have cancelled my subscription and want to use the device to send location info to my own server.
The device has a micro USB input and a SIM card slot. There is not much more I know, but if you have questions which may help find the answer, I can try to take it apart a little more.
So basically, is there some way I can reprogram this device to use my own SIM-card and app?
Plugging the device into my computer does nothing(as expected) however it does register in devmgmt.
Do not worry about the actual reprogramming, I can handle that myself.
Thanks in advance
Edit:
Thank you for feedback.
Image provided.
It does not, as I first thaught, register in the device manager.
I do have an IMEI number for it, but I cannot see a manufacturer anywhere on it. It might be on the underside, but the battery is glued on there.

Based on the Model Number LK120 After some Googling I found a documentation with the following SMS commands. Link to documentation LK209
Note send the commands without Square Brackets
// I guess you've already done 1 and 2.
1 - Set Admin Number - admin123456 [YOUR_PHONE_NUMBER]
2 - Set APN - apn123456 [APN_DETAILS]
//123456 seems to be the password - If the company you got the tracker from provided a different password - try that.
3 - SET the IP and Port Number - adminip123456 [IP_ADDRESS] [PORT_NUMBER]
As this Tracker is either TCP or UDP based - Can't really tell without the actual protocols and User Manual - you will have to setup a TCP and UDP Server and see which Protocol the Tracking Device connects via.
There are a few free software that can setup a TCP/UDP Server on your local machine for testing. [https://packetsender.com/]
Note that the IP address you set on the Tracker must be your Public IP Address, not Local LAN IP Address. You can get the Public IP from here - https://www.whatismyip.com/
Also you will need to open the port of your choosing on your Router and forward the Port to your PC make sure the port is not in use by another application e.g. 9999. This is possible for most Routers. You should be able to access your router admin panel using a browser, details should be on your router.
Also open the port on your PC firewall.
You can always check if it is possible to connect to your Server by going to CMD and running the following command (or use the Packet Sender software to test)
telnet [PUBLIC_IP_ADDRESS] [PORT]
If you can connect via the above command then the tracker should also be able connect.
Note Let us know if the SMS commands work, you should get a response if they work.

Related

Automate shadowsocks proxy server setup

I am going to a highly Internet censorship country which blocked Youtube or Gmail or twitter. So I decide to setup a shadowsocks proxy server, on a Raspberry PI and give it to my friend who live in a low censorship area. I use her internet to visit my Gmail. Unfortunately my friend is totally computer illiterate, and she often move house. That means I need to automatic every network config of the pi.
That means the Raspi should automatically recognize new network and initialize the server. So here is my plan:
Every time power up the Raspi, auto recognize IP and auto send to my safe email.
The Raspi is probably under a local area network. NaT(Network Address Translation) or frp ( fast reverse proxy) should expose Raspi to public internet. Then I can find my Raspi.
Setup shadowshocks server on my Raspi, and it can change the server configuration automatically.
Then Raspi would automate deploy to the new network. I only visit my safe email and change my shadowsocks client config.
1. Is this a feasible plan?
2. I fininshed step 1, and blocked at step 2. I need help to solve step 2,3. Please give me some course or plan
Thank you for your time and any comment will be welcome.
A problem I see in your plan is in step 2:
Normally it requires setting up NAT on the wifi router to make the Shadowsocks user port open to the WLAN side. And this could be difficult to be automated on the raspberry pi, especially the wifi routers may be unpredictable various.
About step 3, it shouldn't be a problem, the service should listen on a private IP address which has nothing to do with your client setting, and the port could be fixed, all you want to do is to supervise your service to make sure it stays strong.
I would recommend setting up VPN services in a cloud environment if the costs are not a big problem. AWS has a one-year free tier plan that may be useful. Take a look at this project, aws-cfn-vpn, it should provide you a solution and keep your hands clean as much as possible.

What connection settings needs to be used in order to connect chat client to server?

So I am playing around in Visual Basic and I'm making a chat client and server. I already did both and tested it on local machine and works. Server listens to connection and records all activities. This is reflected in chat client.
Here's the line of code that I use in order to connect to the "chat server" on same computer.
Dim clientSocket As New System.Net.Sockets.TcpClient()
clientSocket.Connect("127.0.0.1", 8888)
Anyone know what kind of settings I would need in order to connect remotely to another computer that has the chat server running?
The short answer is that you need to change the IP. But the real question is how do you get the IP?
Now if this is just for fun or something, you could just PING the computer if you know the name or walk over to that computer and run something like IPCONFIG on it.
But, in the real world, with a real chat, when a client launches, you would then grab the IP programmatically and post it along with some other info, like the User Name, to a database or web service (which you also created) so other clients would know it is online. You would also need to remove that record or update it with an offline flag or something as well as handle cases where the client looses network connectivity or ends unexpectedly. You can see where I am going with this...
The point is, this needs to be the IP of the client you want to talk to. 127.0.0.1 always refers to the local computer or device.

PeerConnection: make a call in local network

I'm playing around with WebRTC, and what I'd like to achive is:
User1 opens the browser at 192.168.x.x
User2 opens the browser at 192.168.x.x
The same page
User 1 clicks call, user2 displays the stream on his screen.
I've created a signaling server with node and socket.io and I'm able to exchange messages betweeen users using socket.io rooms.
The steps I'm following are:
Get User Media
Create peerconnection1 - no ice servers
add the stream on peerconnection
create the offer
send offer via sockets
Receive the offer and create peerconnection2 - no ice servers
sending the answer
I've also put some logging in "onicecandidate" and "onaddstream" to see when they are called, and on "onaddstream" I create the videoelement.
When I press the call button I see on the other computer that the video element becomes black but I dont see any video neither audio.
For sure I'm missing some vital steps,
Could someone tell me the steps I have to do to make a correct call and exchange all the necessary data to display the stream on the other side?
Thank you very much
A STUN server is used to get an external network address.
TURN servers are used to relay traffic if direct (peer to peer) connection fails.
see this image describes how peerconnection works
webRTC Basics
You should still have at least a stun server referenced for one of your ICE servers. I would use 'stun:stun.l.google.com:19302' || 'stun:23.21.150.121', even though you do not technically need one.
But if you do not have ICE servers, you do not need to worry about gathering candidates. A couple of things that could be happening.
Make sure you Add your streams to each connection BEFORE creating your offer and creating your answer, it says you get the user media but not that you add it to your peerconnection
You are not setting your local and remote descriptions
Offering computer should set their local description when creating it
Answering computer should set their remote description with the offering description and set their local description with the one they create
Make sure you send the answer sdp to the initial offering computer and that that offering computer sets it as their remote description.
Streams WILL NOT send to each other unless you add the needed streams, create your descriptions, and then set their local and remote descriptions accordingly.
If that does not work, you should probably post your code for the page.

PeerConnection based on local IP's

What I want is, basically, to create a connection between two different computers on same local network. But i want to do this by computers' local IP's. (like 192.168.2.23 etc)
This must be a totally local connection. no TURN or STUN Servers. I am not sure if this is possible. Because there are not much documentation/example/information about WebRTC.
So, how can I create a connection from my computer to another one just passing its local IP as parameter?
Update: To be more clear; imagine there is an html page contains some code that activates my camera and audio services. and another -almost same- page is open in other computer. Waiting a connection request... And there is a textbox in my page to type an IP belongs to other computer on my local network. type 192.168.2.xx and bingo! i have connection between me and other computer.
I want this process as IP based, because there may be more than 2 devices on the network. And all of them are possible devices to create connection. So i need to reach them by their IP's.
Any example code or explanation would be great! even if it tells that this is not possible.
Thanks
Peer discovery is a vital part in any WebRTC application. It's an expensive term for saying: "Hi, I'm computer 4 and I want to talk to you!".
See it as calling a friend over the phone. You need to dial his number first.
This part is not defined in the WebRTC standards. You need to implement this logic in your application. Once you know who you want to call, you need a way of exchanging vital information. This is called signaling, like flo850 put in his answer.
Signaling is needed before any peer-to-peer connection can be set up.
To come up with an idea for your use case of 7 devices in a LAN.
If you have these devices connected to for example a WebSockets server and are in the same channel.
The WebSockets server can be written to route messages to specific receivers.
Devices connected to the channel often are identified with some kind of ID, imagine you use the device's IP.
When you want to talk to computer 4 with IP 192.168.0.4 you send the exchange messages (signaling) on the channel to the receiver with ID, the IP of the device you want to connect with.
How to send the signaling (offer, answer) is described here with example code.
Hope this helps
Users usually sit behind NATs; that's why ICE concept implemented in WebRTC.
If both users are sitting behind same NAT; you can skip ICE servers by passing "NULL" parameter value over "RTCPeerConnection" constructor:
var peer = new [webkit|moz]RTCPeerConnection ( null );
Now, browser will use "host" candidates, also known as "local" candidates.
you still need a signaling server. During the ICE candidate search, your clients will exchange their local ip through this signaling server

GameKit/Peer-to-peer over internet

For an iOS app I am developing, I want multiple phone to connect to each other and be able to voice chat between those devices.
I have it working when both devices are on the same network. This was quite simple and most of the stuff I want to do, is possible.
But now I am adding internet support, which is quite a hassle. I'll first try to explain how I want to match the devices, using a small webservice I set up.
Server
Start a new GameKit session, with session-mode GKSessionModePeer
Find the "Peer ID" of the server on the session I just created
Create a new CFSocketRef on an free port and keep it ready to accept connections
Send Peer ID and Port number to my webservice, running on an external server.
WebService
Webservice receives the information and stores it together with an ID and the IP address of the client in a database.
Send ID back to Server, which displays the ID
Client
When the user chooses to use the "Online" feature of GameKit to search for games, I ask the user for an ID (where the user should input the ID the server receives).
Client connects to the webservice supplying the ID. The webservice returns the information about the session (IP, PORT, Peer ID) of the server.
The user tries to connect to the IP address, with the port information and set up an input and output stream with the server.
This does not work ofcourse, because my network does not allow incoming connections and a random port (from an external network).
But now the question is, how do I solve this? I want to be able to set up a peer to peer connection between 2 devices, those devices could be on the same network, but also on separate networks.
Is there a framework, example or anything showing how to do this? I want to be able to send data from device to device, without sending it to a server first.
I'm not aware of any frameworks that do this. I do however have a lot of experience with p2p networking across multiple networks.
One important rule I learned: when communicating between networks, don't create a direct connection unless necessary. There are just too many factors that can (will?) cause issues, such as firewalls, NATs, etc.
Sure, you can let the connection try first. You can try to connect to the given IP addresses*, but in most cases it will fail. Even when using UPnP and NAT-PMP, you'll find that in a lot of cases (more than half?) you won't be able to accept incoming connections at all.
So make sure to have a backup plan. Make a network layer abstraction that doesn't only listen(), but also connects to a server. That way, when you can't connect to the IPs* of the client, you simply setup a connection via the server and the network abstraction takes care of it all.
Let me reiterate the above: don't rely on incoming connections only, always have a backup plan.
* I write IPs because clients can have multiple local/remote IPs. Always iterate over all these IPs when connecting. Example: my phone has 2 local IPv4 addresses (10.0.0.172 and 10.8.0.2), and an IPv6 address ([2001:x:x::6]). Of these three addresses, only the IPv6 address is publicly reachable, and the two IPv4 addresses are on different subnets so whether you can connect to them depends on the subnet that the other client is on. Always try to connect to both, and fall back to a server-proxied connection when it fails.
** I mentioned IPv6, yes. Let's not forget that IPv6 is not limited by NATs, unlike IPv4, and this means that you're far more likely to get a good connection via IPv6 than IPv4, if supported.