Kickstart for BLE CC2541 programming [closed] - bluetooth-lowenergy

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am new to firmware programming and I need to program BLE CC2541. Where should I start as a beginner to understand the codes and alter it that I already have.

While this question is likely to get closed as "Too Broad", I think I would make an attempt to get you started.
I hope you plan to go through documentation provided by TI guys. (CC2541 is Texas Instruments product)
While that document will explain how CC2541 works, you still need to know how BLE works and how it is implemented.
Its different than classic Bluetooth that BLE (generally) is preferred to communicate by means of service/s (with characterstic/s bundled up into them), be them Standard or Custom. Depending upon your area of application you can select one of the standard services implementation.
For more info on services, check Bluetooth Developer Portal
I guess, if you really want to have a good start at it, then understand these terms and their fundamentals:
Master device in BLE (Assuming that you know this already)
Slave device in BLE (Assuming that you know this already)
GATT Profile
GATT Database
GATT Client
GATT Server
Just to get you started:
GATT Profile:
BLE allows you to send data over to the other device after establishing the BLE communication link, only via a defined way, called GATT Profile. Many a people refer the same as GATT Protocol. The data is transferred through characteristics which are bundled into services. There can be multiple services defined within the device and a service can be either the standard one or the custom service defined by a GATT developer.
GATT Database
The structure of definitions of these services is known as the GATT Database. Where does this reside? Is the structure known to the Master as well as Slave?
GATT Server
The BLE device which holds this GATT structure is a GATT Server, in your case the hardware having that CC2541 chip. The way GATT is to be developed and the chip is programmed with it, is entirely manufacturer dependent.
GATT Client
Usually a BLE-enabled smartphone or Gateway device is the GATT client.
The GATT structure, more technically, the UUIDs of the services and the characteristics are shared between GATT Server and GATT Client. That is how BLE works, that is how a smartphone application reads a particular service from the BLE device.
Apart from this you need to know about GAP Service which handles the connection related things.
Welcome to StackOverflow! Coding is easy only if you know the concept well.
May be you would want to see this question: Getting no response whatsoever for similar reason.

Related

How to make a bluetooth connection secure? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have kind of confusion about BLE secure connection.
I am working on an IoT project. I am using ESP32 development board. At one point of my project I have to send some data like Email and Password from android phone to ESP32 connected over BLE.
My question is it how to make it most secure? since i have to transfer user password over it.
Is there any difference between paired connection vs unpaired connection?
which encryption method I should use?
If you are sending sensitive data over BLE, then you have to consider multi-level encryption that includes hardware, software, and then the communication link (BLE). For BLE, the way to achieve encryption is through the pairing mechanism, i.e. you have to initiate pairing from the Android device before sending the data over.
Please have a look at the following StackOverflow questions that detail this:-
How to encrypt data using BLE connection using Bluez5.50
Should one create a bond with a Bluetooth LE device
Finally, I would recommend sending such non-programming questions on other sites (e.g. InformationSecurity) as your question will have more traction there and you're more likely to find a suitable answer.
I hope this helps.
The best way to secure data transmission is to use end-to-end encryption. When you encrypt end-to-end you're no longer dependent on the underlying transport layer's security.
In this case since you control the code on both the Android phone and the ESP32, you can pre-share a key between them and encrypt the sensitive information before you pass it to Bluetooth.
It's still good to take advantage of whatever underlying security Bluetooth or other transports provides, but having your application encrypt the data will help improve your application's security over just depending on the transport layer.

Why is BLE beacon technology used instead of Wi-Fi infrastructure which is already installed? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
The Beacon radiates signal. A nearby Bluetooth enabled device receives this signal. When a particular application recognizes its signal, it connects it to an action or content track stored in the cloud and allows the user to view it. By editing the application on your phone, you can set how it reacts to signals.
For example:
Beacon systems are installed in the shops within a mall. All Beacons have their own fixed ones. When the signal of Beacon, which broadcasts with its own private ID, reaches your phone, the application of the shopping center (which should be pre-installed) will process this signal and give you outputs such as the store discount coupon, navigation proposal varying according to the application's program.
When I set out from this example, I have the following question in my mind. Why is BLE beacon technology used instead of Wi-Fi infrastructure (already installed in phone and mall)? When we periodically scan Wi-Fi signals, we can access SSID, MAC and RSSI information. When we use this information as a query tool by using an application, the approximation recognition with the beacon is completed. In this way, we do not have to invest in BLE beacon infrastructure. What is the keypoint of BLE beacon technology? Why do people need to use this technology?
The simplest answer is in the fact that BLE devices are extremely power conscious (therefore the name, Bluetooth Low Energy). A BLE beacon can run on a coin cell battery for a year or even more without any issue. This is a huge advantage over WiFi which is relatively considered power hungry. It is also an advantage over other low energy wireless technologies (e.g. ZigBee, ANT, etc) in that phones and tablets have Bluetooth built in and therefore do not require any extra hardware. There may be other minor reasons such as indoor performance and interference, but the Low Energy aspect is the main differentiator.
There are many articles that discuss this in length, I recommend the following:-
Comparing Low Power Wireless Technologies
BLE vs WiFi: Which is Better for IoT Product Development
The Pros and Cons of Bluetooth Low Energy
Finally, I recommend posting a similar question in the future to other StackExchange networks (e.g. ElectricalEngineering) as StackOverflow is mainly for programming related questions and you'd probably get more traction and better answers in other sites.
I hope this helps.

How can I check sensor values with Arduino through a web page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am looking for a way to check sensor values (e.g. temperature sensor) with Arduino through a web page.
Checking the sensor values on a web page is more convenient especially when user is at a remote site.
But Arduino doesn't have a network function.
How can I check the sensor values through a web page?
A good solution if you're looking for an end user compatible product, is as follows:
Arduino Serial -> PC Software reading Serial port -> Web API to receive data from the PC into a web database-> Web site to display the received data.
This represents a 'loosely coupled' architecture. Allowing each part in the system to focus on one job and do it well.
Here's a picture:
You could theoretically install an Ethernet shield directly onto the Arduino, and open it up to the public internet.. but this opens a world of security concerns you really don't want to have to try and solve.
Your IoT Device (Arduino) is on its own soilo and you'd need to have a Network Adaptor/Device on it to communicate with the Internet. You can use a Eathernet Shield or a WiFi Sheield for this purpose.
If you have a Public IP then we can come with a more direct solution, but most of the end users would NOT be having that so you'll need a common connection point on the Internet to share data.
If you just want to read values from the internet you can quickly setup a Twitter account and implement some code to send the sensor values to Twitter channel periodically, where you can read the values from Twitter from anywhere.
See a more detailed description on How to Tweet from Ardunio http://www.instructables.com/id/How-to-tweet-from-an-Arduino-using-the-wifi-sheild/
You have to use arduino ethernet/Wifi shield, and need to make a webserver.
I know a shield that already has web application embedded in the shield(Web Serial Monitor), called PHPoC Shield for Arduino.
PHPoC Shield provides the same function of Serial Monitor via web.
I was able to check sensor values at anytime without connecting Arduino to the PC because of its web-based function.
Here is the link about Web Serial Monitor of PHPoC Arduino shield
http://www.phpoc.com/support/manual/p4s-348_user_manual/contents.php?id=first_use

IBeacon receivers / transmitters [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am trying to determine whether IBeacon technology would be useful in tracking equipment in an office building.
Everything I've read required a beacon, a smart phone (i phone, i pad, etc), and the app that is running. If I understand correctly, a person would walk around with a smart phone "searching" for beacon signal. When in range of a signal, it would then register on the phone. This involves walking around and searching for the signal.
What I am wanting to do is have stationary receivers located around the building. Each receiver would a specific ID number. A beacon would attached to the piece of equipment. As the equipment moves around, it's signal would be picked up by the individual receivers. The equipment's location could then tied to a specific receiver.
Some of the problems would be:
1) I would like to use bluetooth technology so that I do not have to be tied into an existing wireless network. This eliminates network and configuration problems.
2) When a signal is identified by a receiver it needs to be "relayed" between multiple receivers until the data is received by the computer that runs the tracking database software. The original beacon ID and location needs to be transmitted.
3) The receivers/transmitter signals must go through floors and walls.
4) All this needs to be done a a relatively low cost per beacon and per receiver.
I think that this can be done with I Beacon technology,it's just finding the right setup.
Any thoughts would be extremely help.
You can do this with iBeacon technology (I have built similar systems) but there are some difficulties:
The stationary receivers must be constantly powered, so they must be near outlets. If sonebody unplugs them (think the cleaning crew to use a vacuum) they go offline until you detect the system isn't functioning and plug them back in. You need tools to monitor this.
The stationary receivers won't be super cheap. You can make them out of a raspberry pi and a bluetooth dongle (~$40 including power supply) an Android mini computer (similar cost) or an iPod touch ($200). Whatever your choice, it is a fair amount of software to write. These detectors need monitoring software to make sure they stay up 24-7.
The Bluetooth info relay to the database adds the biggest level of complexity. You are building your own mesh network, which is possible, but nontrivial. Using WiFi to a web service would be much easier.
This is all possible, but it is a big job. Don't underestimate it.

Using a PC for communication via GSM - not possible? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
While wondering what phone to buy after my current one died I came across the idea to use my PC and some kind of "GSM Dongle" to make phone calls and use sms. With my rather limited knowledge of computer systems and the GSM network I thought this should be a realistic possibility. A freely available GSM chipset, a valid sim card, a usb interface and some drivers should be sufficient.
But googling the topic yielded next to no results: Some obscure alibaba sites offer no name gsm dongles, and no one in any forum, blog etc even seems to consider making phone calls via PC.
Since I can't imagine me being the first one to have such an idea, I figured that what I want to achieve is simply not possible. But again, I fail to understand why that would be the case.
Anyone cares to enlighten me on this topic?
A GSM dongle is designed for making a data connection (internet connection) to a gateway in the operator's network. The exact technology used won't actually be GSM by the way, it will be GPRS, UMTS or LTE.
SIMs supplied with GSM dongles are typically on data tarifs only, i.e. don't support voice calls. As you pointed out however, GSM does support voice calls. To make a voice call, you would need a SIM with a voice call tarif. Then you need to send commands (e.g. AT commands) to the dongle to dial a voice call, and also have some software to connect the input/output of the voice call to your computer's headphones/speakers.
Probably a simpler way to make calls, is to make a standard internet connection with the dongle, and then use a service like Skype as you would over any IP connection.
You can send SMSes from any GSM dongle with a typical data SIM. You just need to be on a mobile network, and SMSes are usually included in data tarifs. You can send SMSes via entering AT commands (write a small program to send them to a COM port, or use some application like Hyperterminal that lets you enter the commands), or programmatically using the Windows Mobile Broadband API (if the dongle appears as a network adapter on your computer). Some standard Mobile Broadband dashboards from the operators have a GUI for sending SMS.

Resources