How to register and identify single device on Android Things Console or How do we get a device onto a channel - android-things

I am new to IoT. I am going through the Android Things Console docs where it was written:
You must flash the device with an image from the Android Things Console in order for the device to receive updates.
Here, I am not able to understand how devices get registered/enrolled on Android Things console and how we can identify a single device. How do you get a device onto a channel .

When you create an image in the console, the system image is linked to that product that you've created. This hidden identifier is used for future OTA updates.
It does not allow you to identify single devices. If you want that, you may want to use your own solution, which may involve a number of IoT solutions like Google Cloud IoT Core.
To get devices onto a channel, you can take a look at the UpdateManager.

Related

iOS/Swift: Quick & dirty way to send a notification to another device?

I'm trying to write a super-simple iOS app, just for personal use (i.e. it doesn't need to conform to any App Store stuff). I want it to do the following. Assume it's installed on two devices, both of which I own/control.
On device 1, it has a button that, when pressed, will immediately cause a notification to pop up on device 2.
I'm fine with hardcoding specific apple IDs, device IDs, whatever; it's also fine if this only works when the two devices are on the same LAN/Wifi. all I want is for the above to work, in the easiest way possible, and preferably without needing anything to run on a server anywhere.
How simply can this be implemented? I've set up a whole push-notification system once before, but that required some server-side stuff. Hoping to be able to do this without any of that.
====
Update: realized I wasn't clear in the original post that I need the notification on Device 2 to pop up whether or not the app is currently open/running on that device.
I think that what you are searching for is multipeer connectivity framework.
The Multipeer Connectivity framework supports the discovery of
services provided by nearby devices and supports communicating with
those services through message-based data, streaming data, and
resources (such as files). In iOS, the framework uses infrastructure
Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area
networks for the underlying transport. In macOS and tvOS, it uses
infrastructure Wi-Fi, peer-to-peer Wi-Fi, and Ethernet.
source: https://developer.apple.com/documentation/multipeerconnectivity.
You can also check those tutorials:
https://www.ralfebert.com/ios-app-development/multipeer-connectivity/
https://www.hackingwithswift.com/example-code/networking/how-to-create-a-peer-to-peer-network-using-the-multipeer-connectivity-framework
Send sms to port is a way (the protocol will become SMS): https://developer.apple.com/documentation/foundation/nsportmessage
and Maybe Firebase Remote Config can help you: you can get your data in FCM remote config (key-value) from the app :
https://www.raywenderlich.com/17323848-firebase-remote-config-tutorial-for-ios
https://firebase.google.com/docs/remote-config/get-started?platform=ios
, and you can modify your data whenever you want, and the app can fetch it.
I have similar requirements, and it seems like APNS (Apple Push Notification Service) is required for this because it's one of the only ways to 'activate' an application that is in the background.
As a result, then the question is how to make APNS as painless as possible? It seems like combining Firebase Cloud Messaging (or FCM) (to manage APNS / sending messages), and Firebase Functions (to help manage FCM server-side requirements) is one decent option.

How to send direct command from Google Home to custom smart device without app name?

I try to build my custom IoT device that will be controlled via Google Home device, and serve people with disabilities.
The device itself is Tiva C Launchpad, that I program from scratch, meaning I will have a full control on it.
In my vision, the user wil say something like: "Ok Google, press play button", and as a result, the Google Home device will send a direct command of press_play_button to the IoT device, preferably via the local network.
I found the Google Action SDK, alongside with the Local SDK extention, but if I understood correctly, I have to be in the app mode first ("OK Google, play {app_name}") before pronouncing the action I want, which is inconvenient.
Is there any way to achieve my requirement?
If not, I may give up on the local network control, and use sort of a webhook to send HTTP request to my smart device, and in that case I wonder if MQTT will be more suitable.
Thanks.
The Local SDK is an extension to the Smart Home API. If your device matches up with the device types and traits that the Smart Home API supports then you can use that to control your device.
It has support for media players so things like play/stop should be possible.
I have build generic Smart Home control using MQTT to reach the device, but you have to provide a HTTP endpoint for the Google System to interface with. This take a little thought as you have to map MQTT asynchronous approach to HTTP's synchronous nature.

MQTT Communication Design between Multiple IoT Devices

I have this current setup:
Android app(ON/OFF button) <--> MQTT broker(mosquito) <--> NodMCU
MQTT TOPICS:
cmd/light/power - where my nodMCU receives ON/OFF command.
status/light/power - where my nodMCU returns the status of the load. This is where also the button status of the app is dependent.
The above setup works just fine and every time I add another IoT device I needed to change the mqtt topics inside the firmware before flashing to every iot device so i can control them individually and there where the problem comes in..
Maybe someone can guide me how to re-design my system that I can easily add new device to my android app and control them individually without changing the firmware of each IoT device? I'm trying to replicate the app eWeLink where it can easily add sonoff devices easily..
EDIT:
My thoughts:
design the device firmware to generate unique ID for each iot device then the id should be included in the MQTT topic. then add the device to Android app using it's ID..
topic should look like this cmd/<unique device id>/power & status/<unique device id>/power
Design the device firmware to generate unique ID for each iot device then the id should be included in the MQTT topic. then add the device to Android app using it's ID..
topic should look like this cmd/<unique device id>/power & status/<unique device id>/power

Can an iOS app control a phone call?

My Mom's deaf. I typically talk to her using a TTY service and she has a TTY phone at her house. I've looked in to iOS TTY and all it ever says is about connecting a cable to the iPhone to use a physical TTY. TTY uses 50bit per second baud-dot code for communications it should be trival to write a program that generates it on the iPhone. Just a sequence of tones, at a relatively low baud rate. BUT I need to be able to control the phone functionality from an app... Then I could type messages like "txting" and have it send baud dot code to my mom's phone. (I've tried giving her a computer, but she's 86... Old dog... new tricks...)
Any ideas?
No, it not possible. The official iPhone SDK does not allow this kind of interaction with the phone.
You can't do this on the phone, but you could try to make a webservice that does it instead. Then have the app connect to the service to deliver the message.
TAPIComm on this page looks like a sample to work from
http://www.tapi.info/default.aspx/TAPI/PSDKSamples.html
You'd need to run it on a Windows machine with a modem.
I know you were looking for an iOS solution, but it another option might be to switch her to an android phone, since android gives you MUCH more access to basic, deep-down elements of the OS, including access to the voice data stream.

Can an iPhone application running in the background transfer data via USB interface?

There are 2 iPhone applications. One application running in the foreground and the other running in the background. Is there any way to get the background application to send data over USB without coming into foreground? Ideally we want to keep the foreground app in the foreground, while the background app process some data. Once the data is processed it will inform the foreground app that the data has been processed.
No it cannot. It cannot even do this without the use of private frameworks, unless you're in the Made for iPhone program. If you are, then your organization will know, based on the documentation made available to you, what you can and cannot access, when and how.
Should you be in the Made for iPhone program, and are unclear as to what you have access to and when, contact the person in your organization who is the technical contact with Apple for this program, they will be able to give you the details.
If the task is started while the app is in the foreground and you call the appropriate beginBackgroundTask/endBackgroundTask methods, you should be able to have it continue running after the app is backgrounded.
Note that access to USB is restricted (see jer's answer) and that there's no officially sanctioned way to communicate between different apps on the same device. Also, you can only buy/download one app at a time in the App Store and I can't see Apple approving an app that required you to download a second app for it to work. So you may have bigger problems to solve first.
It would help significantly if you told us what you actually wanted to achieve. For example, "I want MyApp on the user's phone to communicate with MyApp on the user's computer".
The absolute easiest way is to send data between the phone and a computer is to require that they're both on the same Wi-Fi network. Several iPhone apps incorporate a web server (this was the easiest way of "file sharing" before OS 3.2), and many more iPhone apps connect to a computer running server software.
Your other options, more or less:
Reverse-engineer the Bluetooth side of GameKit and reimplement it on the computer-side. I'm not aware of anyone who's done this. Loosely, I think it's IP over Bluetooth PAN plus some sort of Bluetooth service discovery.
Audio input/output, e.g. the headphone jack or certain pins on the dock connector. I'm not entirely sure how the mic side works (the resistance was a bit high for a carbon mic when I checked), but you might get lucky and find a way to turn it into "line in" or find "line in" pins on the dock connector.
A webcam pointing at the iDevice screen (and the iDevice camera pointing at the computer screen). Ewwwww.
Join the MFi program.

Resources