Bluetooth HM-10 PIN to connect, Authentication / Security - ios

I am using a HM10 Bluetooth - UART module in my embedded Device. I connect to it via the UUID with an iPhone App, but I would like to activate a PIN to connect for the first time, so that not everybody with an iPhone and a App like LightBlue or something like that, can send data to my device.
Is this somehow possible with the HM10? In the manual is written, that it is possible to use a PIN to pair, but even if I activate this, I didn't need to enter this.
Thank you

I am also using the same adapter (HM-10) or basically CC41-A module, because I have just found out that my module is a clone. I do not know that it could cause authentication issue or not, but I would recommend first identify your module. Do you have also on your board a missing crystal in the position what is shown on this picture:
http://nerdclub-uk.blogspot.com/2016/02/working-with-cheap-bluetooth-btle4.html
If it is missing it is a clone module.
EDITED:
I have just found on that blog in the comments that clone is not supporting authentication.
https://blog.yavilevich.com/2017/03/mlt-bt05-ble-module-a-clone-of-a-clone/

You're trying to change the password of the HM-10 Bluetooth Chip. To do this, you can issue an AT Command.
Assuming you're using an Arduino environment to interface with your embedded device, you'll want to go to the Serial Monitor found in Tools Serial Monitor and type in the following in the textfield:
AT + PASS [YOURPASSWORD]
Press enter or send and you should see the following:
OK + Set: [para1]
You can find more AT Commands for the HM-10 chip at http://fab.cba.mit.edu/classes/863.15/doc/tutorials/programming/bluetooth.html

Use AT command for set password:
AT+PASS?
AT+PASS[parameter]
Bond mode (0: not need PIN Code, 1: Auth not need PIN, 2: Auth with PIN, 3: Auth and bond):
AT+TYPE?
AT+TYPE[parameter]
Important: if your module version is less than V515, please don't use this command.
AT+VERR?

Related

Create Google voice command without IFTTT

I'm trying to create my own application that uses the Google Assistant device and is able to control my home devices like turn on/off light, lock door, feed cat etc.
I read a lot about Google smart home and this is kind of what I'm looking for but it is problematic to add additional commands and than needs to use Google Home application to configure it again.
IFTTT has a workflow I'm interested to but has limitations in a number of applets and it is another service that is needed to use to execute commands which I would like to avoid..
I want to do something similar to IFTTT but programmatically on my own.
Connect to Google account using specific credentials
Add commands like "Turn on light", "Feed cat".
Then I would like to say to Google: "Hey Google, Feed cat". After saying this command I would like to get a REST API request in my application which I can process and do what I want (like webhook in IFTTT)
Expected application flow
Is it possible to do that without using IFTTT?
I yes how because I can not find any tutorial or Google documentation related to this approach.
Assuming the question is about how to implement the suggested examples using Google Smart Home platform.
The fulfillment flow is actually very similar to what's described in the question:
And commands close to the question examples could be implemented using:
"Fill the cat water bowl": the PETFEEDER device type with the Dispense device trait.
"Turn on the light": the LIGHT device type with the OnOff device trait.

Provide a pre-saved wifi SSID and password when building AOSP

I there a way in android to provide some SSID name and passwords, so the device will connect automatically when building AOSP?
So this way we can put aside a tedious job as entering wifi pass wach time I burn the ROM into device!
I haven't seen a way to do this, but I can think of a workaround.
You can call the code to save SSID from the Provision app, which is run only once during first boot.
Or add that code in the WifiService, somewhere in this method: http://androidxref.com/9.0.0_r3/xref/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiServiceImpl.java#505

How to remote desktop to an iOS device, a.k.a. how do Mobile Device Farms work?

I have been trying to understand how Mobile Device Farms like DeviceConnect, AWS Device Farm, SauceLabs, etc. get to remote control iOS devices, but I can't find anything on the subject. They get to do it without jailbreaking, which baffles me even more.
I love these kind of projects, because at the moment it seems undoable, but I know that it is possible ('they' are doing it).
With remote control I mean: seeing the screen of the iOS device on your computer screen and able to touch and swipe with your mouse.
Can someone please point me in the right direction as to how these technically work?
If you're using an iPad (in particular) or an iPhone (if you think you'll be able to make our any detail on the smaller screen) then using remote access to view and control what's on your friend's Mac is a good option. And the best way to remote-access a Mac from an iPad is to use Google's free Chrome Remote Access service, which lets you remotely use Mac programs from an iOS device.
It's quite an involved process to set it up the first time, but easy if you want to do it again in future. You'll need the Google Chrome web browser for Mac, and a Google account.
Here is link for Chrome Remote access
https://chrome.google.com/webstore/detail/chrome-remote-desktop/gbchcmhmhahfdphkhkmpfmihenigjmpp?hl=en
Open Chrome and go to Chrome Remote Desktop on the Chrome Webstore. Click Add to Chrome, then Add App. Click Allow, then Continue.
I will give you one approach and small explanation .
You will need to create application with all possible permissions at first also implementation handlers functions .
For example :
Works with files
Real native Socket connections (not http protocol) + need to have some main server signalling (domain or static ip).
Handle remote touch trigger (main problem for real remote/iOS)
Background part experience
Your app need to be non-Market app (more likely).
You can make Application with all possible options that apple give us.
What can you do remote with your app : -control camera/ Mic read geo data , work with galleries , delete or create files . Socket will be communication line .
Also app must initially started and make (on user request) always allow all permissions .
Use camera :
Send with socket some command example ( openCamera ) . AFTER receive this string perform action for opening camera .
If you can fix programability triggering touch events you can make remoteIOS.
More data links :
Q/A send remote events
Q about touch events
Q/A about Permisions
Sorry for the first quick answer,
All of these: DeviceConnect, AWS Device Farm, SauceLabs use Appium in order to control devices.
The component that execute the command is the WebDriver.
Appium have different WebDriver implementation in order to execute operations to different device.
The iOS WebDriver can be found here: https://github.com/appium/appium-ios-driver.
The protocol in use is the JsonWireProtocol.
more details can be found here:
http://appium.io/,
http://www.seleniumhq.org/
Regards

NEHotspotHelper NetworkExtension

I am trying to use the new framework but I can not understand very well the scope.
Is it possible to connect a Wi Fi automatically?
For example, when iOS call the background service in my App I can set the password and the confidence of a particular network.
[network setConfidence:kNEHotspotHelperConfidenceHigh];
[network setPassword:#"QWERTY"];
and I can see a message under the SSID but the user has to touch the Wi Fi to connect.
My question is, is It possible to do this without the user touch it? For example, When you have a known Wi Fi the iOS is connected to this automatically.
is There a way to emulate this behavior with this framework?
Thanks.
This framework only allows you to connect selecting the network (touching it).
You can´t emulate this behavior because you can´t get into settings app, it´s the extension that get into your app and do the work
If the user has already previously connected to an SSID that you are managing through NEHotspotHelper, you can automatically connect them. If the user has never connected to the SSID in the past, or has chosen to "Forget the Network", then know you can't automatically connect them without the user manually selecting the network from the settings app.
Like Fernando Garcia Corrochano said there is no way to emulate this behavior.

How to fetch the list of near by wifi networks and able to connect to them from our App in ios (Using private API for enterprise App)?

I want to fetch the list of near by wifi networks and able to connect to them from our App in ios, and my Application is Enterprise App so even private api's is also fine. Stuck this issue since 2 weeks, please provide me some references..
What you require will only work on JailBroken devices, the blog(blog.guvenergokce.com/iphone-wireless-scanner-ios5/170) which #Ckouta referred also has one comment from the Blog Admin,
I’m assuming that your device is already jailbroken (otherwise not possible)
You shall create release build of sample app and upload release build in to /Applications folder.
(you can use open ssh for that )
Public API allows you to have only information about the current wifi used by your device using CNCopyCurrentNetworkInfo
In order to fetch all the wifi available in your area, take a look at: Stumbler which is using MobileApple80211. I think, it handles what you are looking for. Moreover, you can also use it to connect your device to a specific wifi. You can find a good example of what you need here (answer #9)
Just keep in mind, if you are using private API, your app will be rejected by Apple.
Although it's late but have a look at this link. You can do what you want with the use of MobileWifi.framework and thanks to Cykey there are some reversed headers to use. I have done what you want myself using the link above:)

Resources