USB sync of local database to WP7 - windows-phone-7

I have a requirement where data on SQL server needs to be synced to WP7 devices through USB.
I initially thought of writing a WCF Lib., but it'll go online & sync even if device is connected to USB in local network (Where it's easy & cheaper to get data over local network rather than go to internet & get it).
I have coded isolated storage to save the data synced, but i need an efficient way of getting data from local network, while it's connected to local network.
My questions are:
Is there a way to request data from local network when connected to local network in WCF?
Does someone have a C# code i can use to write synchronization routines to usb over local network? (I would love to have the code, if anyone has this)
Is there a better way of achieving what I'm trying to do?
I'm hoping for some quick answers for this problem, any help is greatly appreciated.
Thanks.

My recommendation would be for your WCF API to have an DNS name pointing to an internal IP address, which is not available outside of the local network and in the routing it will get resolved through USB and another DNS name pointing to an external IP Address which is only available outside of the local network. Your application would try to connect using the local IP address first, which should go through the local network and if it fails it should retry the with external option.

You can use NetworkInterface.NetworkInterfaceType to detect a connection of type Ethernet.
Implementing a full sync protocol is complicated and not something I would recommend attempting unless you really have to.
If you do go down this route I'd recommend using item based message queues and then syncing the queues (and replaying as necessary) rather than trying to sync database tables. It'll depend on the requirements of your application and nature of the data though.

Further to both Murven and Matt's answers, I'd recommend looking into the Microsoft Sync Framework, which supports WP7 as a client, commonly uses WCF on the server, and has great support for a wide range of edge cases.
You can then, as per Matt's answer, watch for connectivity changes and, on USB connection, start a sync to a local IP.
When it comes to targeting mango, you can implement it as a ResourceIntensiveTask and it will run when USB is connected, even if the app isn't running.

Related

IoT management page with P2P connection

I'm really looking for advice and a starting point more than anything. So I'll try my best to explain my end goals and the challenge. I want to set up a local WiFi connection (P2P) between a Rpi3 (or any embedded system really, running linux) and a laptop. The Pi should be the server and laptop the client. The raspberry PI is going to be reading samples over USB from an SDR. I want the laptop to be able to connect to the network the pi throws up, and be able open a browser and view the results. I'm guessing what i need to read up on is ports/sockets and web programming in general. The cheepy IoT sensors and light bulbs seem to be able to do this (opening network and forwarding data) relatively easily but i cannot find any information online to aid in my quest. All the Best and thanks in advance.
Since the embedded system will be running Linux, you can do something along the following lines:
setup the wifi as an Access Point (example). Also setup DHCP Server (example), so the wifi will assign an IP address to connecting laptop.
Install a webserver (e.g. Apache).
Create the webpage/ web application you need to "serve" the data. Install this into Apache.
Ask follow-up questions if you like.

Is there another possible way to display a webpage(selfwritten) not on localhost but on any mobile browser other then paying for a webserver?

I am starting to write my thesis and I will work using Blender and Three.js for the project. As it will have a gps functionality it would be better to run it on mobilephones' browsers. I would like to know if there is any other way to do that then through a paid webserver, or without simulation or there isn't.
One option is to use a computer on your local network instead:
Set up a web server on your computer. Popular choices are nginx
or Apache.
Copy your files to the directory used by your web server.
Find out the IP address of that computer.
Enter that IP address in your mobile browser.
Of course those steps are very general, the concrete details depend on your operating system.

Will windows know if network path is local or not

Let's say I have a shared folder on my machine, for example : \MyMachine\foo.
If I try to access it on the "MyMachine" computer, will it be smart enough to know that it is on the same machine and won't try to use the network adapter and be super slow? I tested it by disabling my network adapter and it was still working, but it might have been because I disabled it that it checked locally instead of using the network adapter.
My concern for not wanting to use the network adapter is speed. Large amount of data needs to be acceded sometime by network path if used outside, but if it is getting acceded locally it has to be quickly.
Every UNC is resolved down to it's core protocol address. Assuming a standard network of TCP/IP, your UNC will be resolved to local machine and the IP will be the same as your loopback IP. The network adapter won't be needed in this case so nothing will be sent over the network. In short, communication will be via the loopback address which does not require network.
Extracted from:
https://serverfault.com/questions/411389/does-traffic-from-accessing-locally-shared-file-via-unc-path-still-go-through-th
It wont, because the changes are taking place in your computer.
However if someone else is trying to access that directory then your computer must send the directory's information to the other computer, thus using the network.

Record IoT device activity to secure domain for debugging

I have an IoT device (standalone) that I need to debug Wifi connectivity (if we're sending up the right requests, or if they're coming down proper). I have 5 secure domains that I need to log all traffic to and from. I can get any new hardware/software needed, but I need to basically store all activity and then use a service to upload remotely for comparison on the server side.
Any great suggestions on best approaches for this? I can't install a proxy on the device, so Charles/Wireshark (my regular go-tos) are out. I can buy a router and setup DD-WRT or something, or just root a laptop with a special brew of linux.
Please advise. I need to get the setup put together as quickly as possible. Trying to debug a serious problem.

Need to Automate PPTP connectivity from Linux to Windows

I'm in need of setting up cron-based VPN connectivity from Ubuntu "Jaunty" to a Windows-based VPN over PPTP for incremental DB synchronization. Using the default Network Manager and PPTP module everything seems to work fine. However, I have 2 issues:
1) Despite checking "Use this only for resources", I still lose my local internet connection and am routed through their servers.
2) As a result of 1 I have need to automate connecting to and disconnecting from the VPN in order to perform various tasks as the machine is at the office and I am not.
Much of the information I'm finding on PPTPing from Linux to Windows involves the use of GUI Network Manager, etc. However, I need to perform these steps from the command line for the sake of automation. Can anyone point me to a quality bit of documentation for this specific case?
Best.
http://pptpclient.sourceforge.net/
I think this site has everything that you need :)

Resources