zigbee module talks to humidity / temperature sensor - zigbee

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.

Related

Can a single BLE module be connected to a mesh and have a point-to-point connection?

I want to know if it's possible to use a BLE module for both mesh networking and point-to-point connections at the same time.
Rationale:
The embedded linux (EL) product that I am designing needs to be able to connect to BLE peripherals like a heart rate monitor (sports grade, not medical) and the product needs to communicate with others of its kind.
I also need a very low power way of sending data from all EL devices to the internet. Ideally with only one of the products supplying a connection to the internet.
I am open to other solutions or reasons why this might not be a good approach even if it's possible.
Here is a rough block diagram of what I'm trying to achieve:
The block diagram does not show a HR connected to every EL device, however this would be a possibility as well.
Green = Embedded Linux Devices
Red = Heart Rate Monitors
Blue = An internet connection to the cloud
Yellow = connections between Embedded Devices
Option 1 - WiFi
The first option I considered was a wifi connection between the EL devices, however this will consume much more power than BLE.
Option 2 - BLE mesh
Using a BLE mesh seems like the best solution, if and only if, it's possible to do point-to-point connection at the same time.
Yes, this behaviour is specified in the BLE Mesh Profile specification in chapter 2.3.11. What you are looking for is a Proxy Node:
Proxy feature – the ability to receive and retransmit mesh messages between GATT and
advertising bearers.
Also take a look at the Ultimate Mesh Tutorial where they also describe the proxy node:
To allow communication with a mesh network from a non-mesh-supported BLE device, a special type of node called a proxy node can be utilized. A proxy node acts as an intermediary and utilizes GATT operations to allow other nodes outside of the mesh network to interface and interact with the network.
The protocol used in this case is called the proxy protocol, which is intended to be used with a connection-enabled device (using GATT).
This is of course hardware and software dependent. Not every hardware or software stack supports BLE mesh functionality.
The wikipedia article for Bluetooth mesh networking has a list of currently availible software stack supporting BLE mesh.

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).

Which GATT Profile and Services are used by OBD BLE Adapters like LELink, Automatic, Carista?

I am exploring building apps (Android & iOS) for Car OBD2 Adapters that support BLE (Bluetooth Low Energy). In order for the app to be able to work with such adapters from different vendors, I presume there would be a standard set of GATT profile i.e. Services and Characteristics that these adapters would be using for standard features like engine RPM, Fuel level etc. Is this info available somewhere that I can refer while building the mobile app?
OBD2 BLE adapters don't use any fixed GATT profiles. The way most (if not all) BLE OBD2 adapters work, is that they offer one service with one or two characteristics:
A write characteristic. This one is where the mobile device can write its AT commands (in the case of, e.g., an ELM327) and PIDs to.
A notify characteristic. This is the one where the results from the car (ECUs) are returned.
Once you have access to these characteristics, you can implement the OBD2 serial protocol (e.g. using a command queue that writes and waits for the response, before transmitting the finished command to the application layer).
Some BLE adapters merge these two into one characteristic. If you want to support arbitrary adapters, you will have to add a 'select your adapter' screen where you probe the found adapters, remember the characteristics, and then communicate.
That way it's possible to write apps that work with all kinds of BLE OBD2 adapters, and not only support a selected handful of vendors, e.g., such as OBD2 Expert (Disclaimer: I'm the author of that software).
Hope that helps!

beginner in GSM: develop GSM locator

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!

microcontroller based sensor project: ZIGBEE vs GSM

My application will be having many microcontrollers with sensors monitoring a large area. The application requires all these microcontrollers to send the data to the master microcontroller. From the master microcontroller the data must go to desktop PC via serial connection and to a mobile application. Which one (Zigbee/GSM) will be suitable?
This completely depends on what you mean by "Wide Area." A few hundred square meters? A few hundred square kilometers? Zigbee is more cost effective and simpler to implement if you're within range. You could even mesh your nodes together to extend the collective reach of your network. Otherwise, well, you have no choice but to use something like GSM.
RF Line-of-sight range on readily available XBee Modules can be up to 2 miles. Higher power models can be had with 40 mile LOS range.
If you are within range, I would recommend ZigBee as that saves you the cost from having a sim-card in each device.
Buy zigbee modules that have SDK and HW ability for mesh networking. That will give you ability to talk to far nodes via routing nodes. Unfortunately zigbee can not do adhoc mesh networking so you need to know in advance what your routers will be, or to program your nodes routing your self. Another 802.15.4 module (by Synapse) can solve all this since it supports ad hoc mesh networking for you via SNAP protocol. It is not zigbee compatible, but Synapse modules are already adopted by big players like Garmin so this should not bother you. They also run much longer on batteries then zigbee modules. They can also give onboard analog and digital IO accessible without need for additional MCU (although you can connect it and give control to it if you wish). There is also USB stick that will enable your PC to talk to these modules.

Resources