beginner in GSM: develop GSM locator - gsm

i'm a beginner, and i trying build a GSM embedded device that could send SMS to a mobile phone, so that the phone can locate the location of the device.
I have searched this website for similar topic, what come to me is triangulation calculation.
My question is how do i know which tower the GSM device is near to, and how to connect to these three tower to calculate the location?

In order to do cell triangulation, you need to know the geographic position of the cell towers.
Either you undertake a huge effort to build a cell tower inventory or you are the network operator. In practice, only the network operators render this service, some allowing to query locations via an interface. However, this is not standardized.

you have to purchase GSM module. connect it with microcontroller
read at commands provided by manufacturer first.
there is a AT command for your application
try searching following in datasheet:
AT+CREG.
first configure module using this command.(refer your datasheet of gsm module).
then turn on engineering mode using command:
AT+QENG=2,1. (refer datasheet)
now it will give you automatically ncell,bcch,dbm,bsic,c1,c2,mcc,mnc,lac & cellid
it will give you this periodically or by query according to your command.
there are many websites that can triangulate device feeding them this info
i.e. opencellid.org/
i hope this helps!

Related

Advertising and connection establishment using nRF52 DK with nrf52832 chip on Segger Embedded studio

I want to know how to send out an advertisement with some specific user number and data such that a connection can be established using the the sdk 15.3.0.
could anyone suggest me what changes i need to make in the ble app beacon code given in the sdk examples.
Thanks
One idea would be to start with the ble_peripheral example of the Nordic SDK.
You can find the following two guides on their forum : https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-services-a-beginners-tutorial and https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial
This explains how to build a custom service with a custom characteristic to handle read / write and notification of values from the embedded device to a BLE central device (e.g: smartphone).

How do I program this BLE location tag?

I bought one of these:
https://www.aliexpress.com/item/Smart-finder-Key-finder-Wireless-Bluetooth-Tracker-Anti-lost-alarm-Smart-Tag-Child-Bag-Pet-GPS/32806261079.html
As far as I can tell it is a BLE (Bluetooth Low Energy) location tag.
I downloaded the app for it onto my iphone, and the app instantly recognised it and connected to it. The iPhone app seems to know how far away the tag is - it has a little map of the local area and says how many feet away. I was able to set the device name via the app, but I'm not sure if that set it locally or on the tag itself. The iPhone app also has a "find" button - when you press it, the tag beeps.
So I want to know how I can program this thing myself. I want to be able to identify it when it is nearby, connect to it and make it beep. I've searched for quite a while but not come up with much.
I'm assuming (wrongly/rightly?) that there is some general standard or approach for talking to these BLE location devices and carrying out the basic functions with them - but what is that standard - where is the documentation?
Does anyone have any idea how to program these BLE location tag devices?
BLE devices typically communicate using GATT, either using standard GATT services, or custom ones. The command to make it beep is probably implemented using a custom GATT service.
For finding out the distance to the beacon, typically the RSSI is used. This is a measure of the received power. It needs to be compared to the output power at the emitter. Usually beacons will put their output power in advertisement data, so it can be used without connecting to them. Here since the app is also able to send commands to the beacon, chances are it keeps a connection to it and has a custom GATT protocol to retrieve the output power.
Here is what I would suggest:
Read up on BLE, especially advertising and GATT. For instance read this for advertising and this for GATT. The full BLE spec is available here but should be used for reference and not introduction
Sniff the communication between your device and your phone. You can see this other answer of mine to get started
Replicate the communication protocol in you own app. For that you'll need to use your target platform's BLE libraries. For instance for iOS it is CoreBluetooth

Doing BLE pairing and communication remotely

I tried looking everywhere to understand how BLE pairing works but unable to find answers. Lets say I have a small device, like a raspberry pi with a BLE dongle. What I'd like to do is to allow BLE pairing and then subsequent communication with a BLE peripheral (such as a BLE temperature sensor) using software only.
My aim is to try and see if I can control the pairing and then getting the temperature, without touching the sensor at all, so that in future, I can just remotely log into the raspberry pi, turn on bluetooth, obtain the temperature reading and then afterwards turn it off again. And in future if I need to obtain the reading again, I'll repeat the process.
So:
Can this "simple" scenario be achieved using some software based control?
If not, then which parts require manual input and then which don't?
The BLE sensor should not be in advertisement mode or broadcasting the information. It should only send the data to paired devices.
Any and all answers appreciated! :-)
Most Bluetooth low energy devices do not require pairing at all so check first that your sensors do have this requirement. If they do then you need to determine which specific pairing procedure is required. Bluetooth defines various ways to authenticate during pairing and these generally relate to the I/O capabilities of the two devices and are called Association Models. In some cases, pairing "just works" (the name of the simplest association model) and no user interaction is required. In others, say if one device has a keyboard but the other has a display and no keyboard, the second device will display a random 6 digit number and the user must key that number into the first device. All of this is defined in the Bluetooth Core specification.
In your case the pairing procedure will be defined for your sesnors in the manufacturer documentation so check there first. Not that you should only have to do this once per device, not every time you want to read the sensor.
Accessing sensor data remotely needs a gateway which I guess is what your Pi will do. The Bluetooth SIG defined a set of RESTFul HTTP APIs for exactly this purpose. See https://www.bluetooth.com/develop-with-bluetooth/white-papers
The SIG also provides a gateway developer resource for Raspberry Pi which you can download including source code which is written in node.js. See https://www.bluetooth.com/develop-with-bluetooth/developer-resources-tools
Good luck

zigbee module talks to humidity / temperature sensor

I just bought a gateway equipped with the zigbee module (zigbee pro stack ). Also, I bought a zigbee humidity / temperature sensor as well.
It's HA profile and humidity / temperature cluster Id.
There is an operating system (WindRiver) running on this gateway.
To write an application to read the value sent from zigbee sensor, where should I get to start?
Is there any document available? like defining the data structure for the temperature / humidity ?
Thanks
Start with the Gateway documentation. The company selling it should provide enough information to you that you can discover devices (like the sensor) that have joined the network, and then discover the endpoints, clusters and attributes on those devices.
The ZigBee Alliance has documentation for various layers of their network stack that you'll want to understand if you're going to work with the ZigBee Home Automation profile.
The ZigBee Cluster Library (ZCL) defines attributes and general functions for discovery, reading, writing and reporting on them. You should have a basic understanding of ZCL as a foundation for working with ZigBee.
For the Home Automation Profile, you may need to join the ZigBee Alliance to gain access to the specification. I wasn't able to find it with some quick Google Searches. It will list all of the attributes, their data types, and what values they represent. From that, you can create ZCL Read Attribute Requests to read the values and process the responses.
Sorry, but without knowing the gateway that you are using it is impossible to know the API and what the functions are for joining, discovering and controlling devices. There is no "Standard ZigBee Gateway API", each gateway will implement its own. Some may offer a high level interface with API's for controlling devices, others will send "raw" messages where you will need to form the ZCL command your self. The ZigBee Gateway here:
Free SW SDK (Z-STACK-LINUX-GATEWAY): http://www.ti.com/tool/z-stack
HW Reference Design: http://www.ti.com/tool/CC2531EM-IOT-HOME-GATEWAY-RD
Has a well documented API with features like:
- Open Network
- Close network
- Device discovery
- Turn Light On/Off
- Read Temperature
- Read Humidity
It has an open source node.js example application which offer a local web interface and connects to a cloud service (this also includes connecting to and configuring reports for humidity and temperature sensors, as well as connecting to and controlling Philips Hue Lights):
https://git.ti.com/zigbee-iot-agent/zigbee-iot-agent
An example JAVA application is also available:
https://git.ti.com/zigbee-iot-agent/ti-zstack-linux-gateway-java-cmdline-example
Regards,
TC.

How to program an XBee ZigBee module?

I have a project which the information from the microcontroller (drop rate changes of dextrose like sending notification "nearly empty" or "Sudden change of drop rate. Drop rate of 15 automatically return to 14") would display in an application in a computer. I am thinking of using ZigBee and it would be responsible for transferring the information but I am new with the technology.
Does anyone could help me how to program the ZigBee module? I have seen some articles saying that it could be programmed in eclipse CDT. I am bit confused how to get start.
Any help would be appreciated. Thanks!
Use USB Explorer device (or similar) to enter a serial terminal session on the receiving XBee.
Type ATMY to get the receiving XBee's address. Write it down.
Put the sender in the USB Explorer and type ATDL plus the receiver's address, like "ATDL798A728"
Type ATWR to save this setting.
Attach sender XBee's UART (TX and RX pins) to microcontroller.
Plug receiving XBee into USB Explorer attached to computer.
Run Processing sketch or similar to read from the serial port.
The two XBees will run by default in 'transparent mode,' which pipes data coming into one UART out of the other UART, exactly like a wire. So when your microcontroller writes data into the sender XBee, it will come out of the receiving XBee and be read (and displayed or whatever you need) by your software.
It really depends on how much configuration your installation can handle. Is this a one off installation, or a "system" of products you want to make that have to be able to work together in whatever configuration they're bought?
As already explained, xbee modules that have the whole radio + stack already setup and working for serial data are simple to use for the trivial case of you sending out a few pre-paired setups form the lab, or even site installation by an expert.
If your embedded devices have to find each other automatically, then you'd need a way to get the embedded microcontroller to get the modules discover each other, make a connection, and then have the application code in the embedded microcontrollers talk to each other and identify what they need to do with each other.
In this case, you probably would be better off with the (upfront much more complex and likely expensive) design where the zigbee stack is inside the embedded controller, so your application code can use it properly to control connectivity.
The TI zigbee pro evaluation kit is very comprehensive, and seems great to me so far. It sounds like you're at the point where you need to spend some money and get some experience with real modules, just to get a feel for the technology. Though be warned, you may need IAR embedded workbench to work with these long term, and that's pretty expensive software!
Alternatively, Atmel have a pretty interesting looking zigbee implementation with their "bitcloud" software platform (free zigbee pro stack!! woo! and they have a free ARM toolchain!) but I've found the getting started info around the bitcloud stuff is really lacking, and while I can get the code setup and compiling, I'm not confident to buy enough of their evaluation gear for a zigbee pro mesh network to test it in real life yet.
PS: if you're getting started with short range wireless, i can't recommend this book highly enough. http://www.amazon.com/Essentials-Short-Range-Wireless-Cambridge-Series/dp/0521760690/ref=sr_1_2?ie=UTF8&qid=1336091059&sr=8-2
It contains very good introduction to the different technologies available, and the strengths and weaknesses of all of them (and wireless in general) Plus it will leave you in a good position to start understanding the features you really need for the system you're designing.
some of the zigbee/xbee modules simply behave as wireless serial, no programming required just turn them on. Others require programming. It depends on what your needs really are. the ones that behave like wireless serial have an AT command set if I remember right so you can adjust some things, like for example if you want more than two (more than one wireless point to point connection) you can specify which two talk to each other...

Resources