MQTT Communication Design between Multiple IoT Devices - mqtt

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

Related

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

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.

About Jasper IoT Platform

I am just bit curious. I am new in IoT and currently started working on it using ESP8266 device. I know that it needs some firmware to write and install, like smart.js.
But I have read, Jasper (http://www.jasper.com/) can connect any device and manager, monitor etc. So I am bit curious how it works internally. I am not sure whether it installs firmware created by Jasper or in other way. I was reading this article: http://www2.cumulocity.com/guides/users-guide/jasper/#link-sims
Anyone knows about this? I mean how Jasper works to connect to any devices?
Cisco bought Jasper, which is useful for IoT business. However it might be better way for you to check Interactor(www.interactor.com) which is great for IoT development. Interactor works to conntect to any device with any protocol.
Cisco Jasper should not be confused with device management libraries (whether they be server based, or device based or both).
Jasper is a telecom based service that allows you to see and manage the connection state of sim inserted in the device. Regardless of the state of a device, the modem and sim (provided they are powered) will connect to the telco and provide basic information about the connection.
Think of it as a network tool (server originated) for the gateway on the device, not the device itself. It allows you to force disconnect devices from the network, ban sims from the account so a stolen or runaway sim can eat through data, basic connectivity tests (is the modem powered, does the sim have permission to transmit data over the network, etc).
The main value of jasper is that it allows you to manage you data costs by applying the appropriate rate plan to each device, and disconnect devices that are using too much (for whatever reason).
Jasper does not cost anything to use, however telcos will apply a rev commit (min monthly spend) usually $500/month to gain access. the sims are the same as PCS (phone) sims, but they are on their own network internally, and are specific to that telcos jasper. i.e. you can't take 500 devices using PCS sims, and import those sims into jasper. you'd need to do a physical swap of the sims.

Can you communicate with nearby devices using a website?

Can a website help a user communicate with nearby devices via bluetooth/WLAN without downloading software?
User requests that something be done on their device (which could be, for example a wirelessly connected printer or a bluetooth keyboard).
The site, which contains a repository of relevant actions, sends specific instructions for that device to the user's own machine.
Those instructions are then relayed to the correct device (with the user's permission) via the user's device's WLAN or existing bluetooth connection.
Part 3 is what I'm not sure of - is there a mechanism by which a website can contribute to a wireless/bluetooth connection held locally?
It is not possible. User browser can't interact with hardware for wireless networking.
You should force user to install some custom software to do this.
You would have to submit the "commands" first, then have the device make requests to the website server, i.e., check for any pending "commands" for the device, and then process them locally. A website is not "thing" that can directly interface with a hardware device.

How to make existing device IOT only?

For iOS application, IOT(Internet of thing) is a new things.and we can connect our device with other hardwares.
My question is , is there any way by which i can connect our existing devices like (Air Conditioner,Other ele. component) IOT only?
Here is one of the best example for connecting and controlling such devices like A.C., TV, etc with your iOS device.
It's Open Source so you can explore more.
IRKit:
http://getirkit.com/en/
(opensource infrared remote controller).
IRKit is a WiFi enabled Open Source Infrared Remote Controller device.
Home electronics with an infrared remote, like air conditioners, TVs, lights can be controlled using iPhone and iPad via IRKit.
IRKit works with IRKit's official app and you can easily create iOS apps to send IR signals to control home electronics using IRKit iOS-SDK .
You can create apps for example that does:
Use location, turns on air conditioner when you arrive near your home.
Press one button to turn off all your home electronics when you leave home.
Connect with Facebook, and automatically change your TV's channel to which your friend is watching.
Hope It will help.
If your component have any types of connectivity which is suitable for iOS devices the you can do this, like:
If your Air Conditioner has bluetooth connectivity and it can handle command like turn on/off or controlling temperature, then you can do it with any kind of device that can communicate with the electrical components.
I used to turn off my computer via internet. There was a process running in my computer that hits an URL, receive JSON data and if it gets shutdown flag yes, it turn itself off. I can set that flag from my mobile. The lacking was I could not turn on.
Edit:
Yes you can, but you have to do a lot of hardware related work. like: Bluetooth Relay Controller. Here is a video.

Communication through Messaging in iOS

I'm Developing an application. It is the Communication Between iPhone Application and a Hardware Device. in that Hardware Device We are Having SIM Card and also that Hardware Device had Some Settings. Now my task is i have to Modify that Settings By using our Mobile Application through Messaging.
I am able to send that settings in Some Message format to that Hardware Device.after settings have been changed the Hardware Device sends a response message. Now my Problem is I am Unable to Read that Message From My Application.
I Google it in Some Sources they Said:
1.There is No possibility of Reading SMS By using our Application.
2.It is Possible Only if the Phone is Jail Breaked.
is there any alternative solution for this i.e Communication Between iPhone Application and a Hardware Device through only messaging.
Why the hell are you using SMS for this? why not run a server socket on the device that listens for connection, implement some way of connecting remotely (intermediate server, static ip, UPNP etc) and connect and send data via TCP.
As you have stated in you question iOS doesn't allow you access to SMS, you will not be able to achieve this, unless the iPhone is jailbroken, there might be some level of access then but I have no experience with jailbreaking.

Resources