Getting multiple cell ids for triangulation - c# windows mobile - c#

I've been trying to get CellIDs for multiple cellular towers to triangulate the position of a windows mobile phone in a C# application.
I am able to get the lat/long of the currently connected cell tower using David Tiger's WMLocationInfo dll from http://forum.xda-developers.com/showthread.php?t=934948, but this is not accurate enough because it uses only the current cell tower. I need an accuracy of ~100M or so without using GPS. So if I can get the CellIDs and signal strengths of at least three towers, I'll should be able to improve the accuracy to a reasonable extent.
I found a discussion at Get Multiple Cell IDs for location using Cellular Towers C# Windows Mobile where johansebasb was addressing the same requirement.
Can someone point me towards a sample project or code that I can use for this?
Thanks in advance.

There are two probs with that:
The RIL does not expose that function
You may send AT^moni command to GSM modem but this may disturb or corrupt the RIL. The RIL is sending and parsing all commands to control the modem. Think of the RIL being the wrapper around all modem communication.
You need a comm port to send (inject) AT commands to the modem. That may be implemented or not by the RIL driver.
If the modem does not support AT^moni you are lost. The Siemens MC75 supports cell monitoring via:
AT^SMONC Cell Monitoring
The AT^SMONC execute command delivers cell information containing 9 values from a maximum of 7 base stations. The first base station is the serving cell.
AFAIK Sierra Modems do support AT^moni too. Qualcomm? Don't know.

Related

Communication through USB to an STM32F4 microcontroller delay

I am working on a C# development project which aims at controlling a flying robot thanks to a set of Optitrack cameras (infrared Motion capture system). The concept works really well, you get a position from the camera system, our application can access to these data and we can control the robot.
The problem comes, I believe, from the communication chain. We have a USB cable linking our PC to an STM32F4 based board, which acts as a bridge and simply sends everything received on USB to radio thanks to an embedded NRF module (nRF24L01+ chip). This mechanic goes both way (NRF -> USB -> PC). The board is running under C using FreeRTOS. The PC runs Windows 10.
On the PC side we use the official STM32 VCP driver 1.4 from ST. On the board firmware, we have this user-made library for VCP on STM32F4: https://stm32f4-discovery.net/2014/08/library-24-virtual-com-port-vcp-stm32f4xx/
There are no queues on the bridge board except the ones from the radio module itself and potentially the STM32 VCP driver itself. I checked, there is a circular buffer in this driver used for in and out messages. Using JSCOPE I can visualize in real time how this circular buffer behaves and I've never seen an overflow happening.
My problem comes from the fact that a delay suddenly appears.
The system works perfectly for tens of minutes (between 10 to 20 minutes) and then a delay is clearly perceptible, which makes the controller oscillate. This happens when I do a second flight.
The following have been tried:
- Restart the C# application
- Run the C# application in debug mode and stand alone mode
- Change USB cable (shorter)
- Change USB port
- Change of computer
- Reinstall the ST VCP drivers
- Lower drastically the communication frequency (the control loop)
When the problem appears, the above solutions didn't work, the delay remains completely and none of the above proved to make it more reliable.
On the C# application, I reset all communication Lists before each flight. The SerialPort port object (from System.IO) has its buffers reset as well (DiscardOutBuffer, DiscardInBuffer, BaseStream.Flush methods)
I found a "hack" to make it work, but it is not what we want as a final solution. The "hack" is to simply physically disconnect / reconnect the USB connecting the board acting as a bridge. After this manipulation, the delay disappears.
So my questions are:
What could possibly bring this delay, knowing it doesn't look to be application dependant, nor frequency related (bandwidth).
What could explain why this disappear when unplugging/plugging the bridge board ?
I know this question is about a big project and could be hard to understand from outside. Feel free to ask me for more details if needed.
Cheers,
Marc

Arduino mega 2560 with Raspberry pie 2 project

I am currently working on a project where I need to control 16 pumps 1 stepper motor and 2 Distance sensors - 21 digital pins and 2 analog pins. I need to make a UI and have this use UI send information to the Arduino which will control my system. I would only need to receive 1 or 0 from each button press from the UI in order to determine which pump to needs to be turned on. I'm using an Arduino mega 2560 and coding the UI in Visual Studio C#.
I have done various research on serial communication for the Arduino, including using the serialevent() function and the firmata library. However I am having trouble understanding how all this ties together and if what I am wanting to do is even possible! Here are my questions:
Is this possible?
Is this possible by using Serialevent1()........... serialevent21()? or using Serial.availble() and Serial.read()
Instead of reading one button click on the UI at a time. Can the inputs on the UI be collected and sent to the arduino as a group. Then have the UI restart and clear out the values.
Any information and/or advice will help! I just need to be pointed in the correct direction!
Thanks
DG
Have you considered the following article?
It uses a Arduino mega 2560 and the article provides both the c# code and the Arduino code.
It communicates over the serial port and sends data in both directions.
Yes it is
The article above uses the Serial.print and readSerialInputCommand which is similar to Serial.read. You can use Serial.Read instead if you wish as it performs the same task and returns a different datatype.
You can compile the values into a group. If you want to be super optimized you can use bit-wise operators and compile the first 21 pin values into a byte array and send it.
However since its only 21 digital pins I recommend just using a string with the each character in the string linked to a pin. Eg: "10110" could set pin0, pin2, pin3 HIGH and set pin1, pin5 LOW.
I would recommend not restarting your UI as it will need to reconnect to serial port. Rather just clear all the values with your code.

how to make call from pc using local landline phone services

I have a desktop application of address diary, developed in C# .Net.
I want to make call from software throw land line phone service,
in my office we have 8 phone lines, so i want to select line before call,
i want to use headphone and mic in place of phone instrument.
how to connect phone lines to pc. i have more then 8 phone lines
is it possible ? if yes then how and which hardware i need for this.
Have you thought of the Skype API: http://developer.skype.com/public/skypekit
or
http://www.twilio.com
Get rid of the landlines and use a service. Much easier in my opinion. Then it would be far more scalable as well.
If you want to go down the telephony services path check out this library: https://github.com/markjulmar/atapi.net/
Hardware for landlines would just include 8 modems and selecting which one to use, before making a call.
I would assume that the atapi library contains functions to select the audio input and output. If not there are plenty of c# libraries for recording audio, in which you could pass the stream through to the library.
I wasn't going to point you down this direction but as per #Saif Khan comment you can use Asterix.
Using Asterix
Step 1 - Get a server install Asterix on it. http://www.asterisk.org. It's open source.
Step 2 - Get supported hardware e.g. http://www.asterisk.org/hardware
Step 3 - Communicate to it with http://sourceforge.net/projects/asterisk-dotnet/ (open source c# to asterisk library.
This maybe overkill for you, I don't know. I suppose I shouldn't assume :)
Since Google Voice is still free in United States and Canada. You can use this Google Voice API in C#.
http://sourceforge.net/projects/gvoicedotnet/
Doesn't want to sound like a noob, but did you try out Windows Dialer? You will need x number of 56k dialup voice modem depending on the no. of connections you have and you want to use.
It should work just fine. Test it out, and if it works well, you can get your app synced with your existing software to export the number to the dialer upon calling. (There is no such functions on the dialer app yet.)

Audio capturing in C#

I have a MAYA 44 USB sound card and would like to interface it with C#. I want to record from the provided microphones and produce a data array.
I have found examples when using the internal sound card from my laptop but when it comes to external it does not quite work.
Has anyone every connected the above sound card with C# please?
Have you had a look at the DirectSound API (Windows only though, I think). Might provide what you're after.
On how to record audio with C# in general there are already multiple threads on SO, so I won't talk about that.
I see two possible causes for your program which have different solutions:
You need to change which audio sources are muted in the windows volume control ("sndvol32.exe /R")
When opening the audio device there are multiple devices. And you're simply opening device 0 instead of enumerating them and perhaps choosing another one. The external sound-card might appear as a second device.

GSM Cell Towers Location & Triangulation Algorithm (Similar to OpenCellID / Skyhook / Google's MyLocation)

assuming I have a Fingerprint DB of Cell towers.
The data (including Long. & Lat. CellID, signal strength, etc) is achieved by 'wardriving', similar to OpenCellID.org.
I would like to be able to get the location of the client mobile phone without GPS (similar to OpenCellID / Skyhook Wireless/ Google's 'MyLocation'), which sends me info on the Cell towers it "sees" at the moment: the Cell tower connected to, and another 6 neighboring cell towers (assuming GSM).
I have read and Googled it for a long time and came across several effective theories, such as using SQL 2008 Spatial capabilities, or using an euclidean algorithm, or Markov Model.
However, I am lacking a practical solution, preferably in C# or using SQL 2008 :)
The location calculation will be done on the server and not on the client mobile phone. the phone's single job is to send via HTTP/GPRS, the tower it's connected to and other neighboring cell towers.
Any input is appreciated, I have read so much and so far haven't really advanced much.
Thanx
Why don't you do a plain triangulation calculation, based on cell position and signal strength?
You can't do triangulation as the phone scans just the signals from two base stations and not three. Furthermore I don't know whether it is possible to somehow access the data of both stations because you would have to deal with low-level GSM/3G protocols.
By using AT commands or functions of newer phones SDKs (Java, Android, iPhone, Symbian...) you can retrieve the informations about the cell id, lac, mnc, mcc, signal strength and timing advance.
By examining timing advance you can determine how much you are away from the base station as the signal travels with the speed of light but you can't determine the exact position, just the "circle of possible positions" as you calculate the approximate radius (approximate because it is not in general true that the signal travels directly - the signal can reflect from nearby objects).
If yo are working with .NET here is an example for retrieving base station location from cellID and other data that are accessible on your phone. Hope it helps.

Categories

Resources