How to setup a hotspot region which automatically connects to mobile in the region and i can send message to all connected devices - creation

I wish to create a hot-spot with whatever device that suits and I need this hot-spot to connect to mobiles within its region automatically and send messages to the devises simultaneously ..Is this possible some how?

Related

Send Battery Level notifications to nRF Connect app when battery level reaches certain level

I am new to BLE and I need help with Battery Service notifications. I am using nrf52840dk, nrf sdk 17.1.0 and I am using ble_app_proximity example which already uses Battery Service.
I need to send a pop up notification from device to nRF Connect mobile app when battery level reaches 40%. Whenever battery level reaches 40%, a notification should pop up in nRF Connect app telling us that battery level has reached 40% and please charge.
Can anyone please help me with this?
I have tested the ble_app_proximity code and it is showing battery level only when I Read it, but I need it to display a pop up notification on nRF Connect app when battery level reaches 40%.
Thanks,
Kanthi Deep.
There are two steps required in order to achieve what you want:-
Enable the notifications from the nRF Connect app (GATT client).
Send the notification from the nRF52840dk (GATT server).
Let's go through each one in details:-
Enable notifications from the nRF Connect app
Given that your phone is the GATT client, it needs to subscribe to the battery characteristic notifications. This way, when the nRF52840dk sends out a new battery notification, the nRF Connect app will receive it. In order to do this, connect to the devkit using the nRF Connect app, browse through the services and click on the Battery Service to reveal the characteristics. When you do that, you will see the battery level characteristic with a downward (read), upward (I'm not sure if this exists but maybe it doesn't) and multiple downward (enable notification) arrows. The downward arrow is for reading the battery value, the upward arrow (if it exists) is for writing to the battery value, and the multiple downward arrows are for subscribing to notifications. In your case, you want to click on the multiple downward arrows. I have attached a picture below of what the arrows should look like:-
Please note that in your case, this should be the battery value characteristic and not an unknown characteristic.
Send the notification from the nRF52840dk (GATT server)
In your code, you should be continuously monitoring the value of your battery to check if it has reached 40%. If you're using the SDK's libraries, you can have a look at this function that specifically does what you need in that it sends the battery value as a notification when you call it. There are a few posts on Nordic DevZone on how to read the battery voltage, and these are a few examples (link1 and link2).

Need help for a deeper understanding of BLE

I have to write a BLE application on an embedded device and there are some features where I'm not sure if BLE supports that or whether I've to create some wrapper around everything or if it's maybe not possible at all. The gerenal descriptions of Bluetooth and BLE I found around the internet usually only cover the overall functionality but don't go in too much detail. If this post gets too complex I'll split it up into different smaller ones.
I use the STM32 BlueNRG-MS chip
1. Discoverability (resolved)
The user has to be able to disable the BLE function in case there are several devices in reach. I see that there are functions aci_gap_set_discoverable() or aci_gap_set_non_discoverable() but altough I set it to not discoverable I can still see it in the LightBlue App on my mobile. How would I correctly disable the BLE functionality of a device to make sure no one can see it or connect to it?
Update: Okay that has been a mistake from my end, if I call the aci_gap_set_non_discoverable() function it is actually undiscoverable. So that's fine.
2. Only accept connections of paired devices
I'd like to achieve a behavior such that, if you have an unpaired phone you have to set the BLE device into a pairing mode in order to connect. If the phone has already been paired, the BLE device shall accept the connection request regardless of whether it's currently in pairing mode or not. Is this what the whitelist should be there for or do I have to do this manually by saving the address of the device after successful pairing? If whitelist is the right approach, I read that newer phones cause issues with whitelisting because they change their address on a regular basis, how can I handle this? That's actually where I thought I'm gonna work with the "discoverability".
3. Automatically reconnect
I'm not sure if this topic has to be handled on the BLE device or on the mobile phone. E.g. my phone is paired with my car's radio, so whenever the phone is in the car it automatically connects - how is this done? It's still the phone that acts as central device I assume?

Implement notification in BLE

How do I implement notification in BLE?
I have a smartphone, and every hour it will send notification to all nearby BLE devices (smartwatch, RFduino, etc) for time synchronization purpose.
Other devices are server now (since it provides data), and smartphone is the client that collect the data.
Could I piggyback into the advertisement packages? For example, the smartphone always broadcast an advertisement packet to annoucement its presence (that's how other devices can find it). Can I modify that packet to be a time sync?
In order to send notifications or advertisements, your smartphone has to act as a server, which also means that in order to be able to receive notifications or scan for advertisements, your peripheral devices must act as clients.
This can be a bit tricky, because if two devices act as client and server, they may not simultaneously fulfil the other role. You need to switch roles whenever needed, which is an open field for all kinds of problems.
Also, I am not convinced that it is really the optimal choice to let the smartphone regularly notify all devices in the vicinity. Each of the devices that wants to receive the notification has to be connected with the device in order to receive the notification, and this connection has to be already active when the notification is sent in order to really get the correct time. So all these devices need to connect in advance to the expected notification time, and hold up the connection until the notification has come.
It might be better to just advertise the current time, but remember that you can't connect to the smartphone as a server while it is advertising, because the link layer may not be in scanning and advertising mode at the same time, and you may also not be connected when advertising for a similar reason.
If you want to do it that way, you can include the time information in the advertising data. See the Supplement to the Bluetooth Core Specification v6, Part A for further information on the structure of the advertising data. You could put it in the manufacturer specific data.
However, another option would be to write the time directly to the device using a write request. You can define your own service and characteristics. You can include a "time synch necessary" information in the advertisement data of the servers, and when the smartphone evaluates the advertisement, it can connect to the corresponding device and send the time directly.
The advantage of this procedure is that time is only updated if you really need it on the device, and that you do not have to switch client/server roles, because the device in server role may advertise as normal, and the smartphone can always stay in client role.

Is it possible to monitor multiple bands from a single app?

Is it possible to have one app on the android or ios phone monitor 2 or more bands, Place tiles and respond to button/ accelerometer events? I did not see that in the docs.
Thanks
Yes, this is possible. It is a more advanced configuration so you must pair the Band's in the phone's BlueTooth Settings. Then when you query the SDK APIs for devices you iterate over the devices and create one connection per device. This should allow you to then communicate with each device from within one app.

Push Notification Over Wifi

I've got a problem that we are hoping there is a simple solution for.
We have a need to allow a push notification to appear on a device when it enters into a certain space. The space is only going to be about 1500 sq ft. So my thought is to set up a wifi network in this area... I'm curious if anyone is aware if it is possible to notify anyone with our app installed on their device when they enter into this wifi space if they want to take a certain action... for instance to open the app?
Create an Android service that is launched when the intent WIFI connected is triggered.
The service will check if the bssid of the wifi connection is the same of the wifi area you want to monitor and then it could either launch the app/show popup/show notification.

Resources