Hot answers tagged

14

The model that IoT Hub connected devices use is that they will never accept incoming connections. IoT Hub devices never act as a 'server', and this is a crucial part of the security model in Azure IoT. The definitive model on this is encapsulated in Clemens Vasters' 'Service Assisted Communication'. Therefore devices are always 'polling' an external service ...


10

A little bit of context Since you're using MQTT with AWS IoT, you're expected to use X.509 certificates for authentication and security. Amazon have a little bit of guidance about how you should secure your certificates, so I'll quote that here: Certificates enable asymmetric keys to be used with devices. This means you can burn private keys into secure ...


9

Ideally you want your overall system to have a design such that dissecting a single unit breaks only that unit, and not the system in general. Especially if you are storing keys in a distinct memory such that they cross a standard electrical interface between chips, then they should only be keys that are already safe to publish, or unique to that particular ...


8

It looks like the aws IoT sdk is using a synchronous publish (as it's using a return code) so it's blocking for each message. There is no reason at the MQTT protocol level that you can't have multiple messages in flight at once so you could look at using the paho asynchronous client so that waiting on the QOS1 response can be done without blocking the ...


8

According to AWS SQS Documentation (as you said the broker is AWS) this should be native: Immediately after the message is received, it remains in the queue. To prevent other consumers from processing the message again, Amazon SQS sets a visibility timeout, a period of time during which Amazon SQS prevents other consuming components from receiving ...


7

More realistically, this delay encompasses the time to register on the wifi network. In order to minimize power consumption (that's an officially irreplaceable battery) the device is normally completely dormant - it cannot afford the energy cost of maintaining a wifi network connection, and instead only starts trying to obtain one after the button has ...


7

You mention “certificates”, but from context, I think you're referring to two different things. Your device has a private key, which is unique to this device and not known outside the device. This key identifies your device. Anybody who can access that key can impersonate the device. That means that they can, in particular: Publish valid, but incorrect ...


7

You might want to look at the concept of dead-letter queues of AWS SQS. From the AWS docs: A dead letter queue is a queue that other (source) queues can target for messages that can't be processed (consumed) successfully. You can set aside and isolate these messages in the dead letter queue to determine why their processing did not succeed. So, if ...


7

You shouldn't need a delay, or at least not one that keeps waking up. If, as you suggest, you have initiated a thread that is triggered by a callback then there is no need for a main loop. Unless that loop is doing something useful every time it runs, it is just using CPU time and electrical power every time it wakes from and reenters delay. I would ...


6

What you linked is far too complicated and in too low level of abstraction that it is for an professional even hard to read and follow it. aws-mqtt-client through npm is the easiest solution I could find. You just have to install npm and make the aws service and client code is quite straight forward: const mqttClient = new AWSMqtt({ accessKeyId: ...


6

There are many factors in choosing whether to process data on-device or in the cloud. Benefits of processing in the cloud If the algorithm uses floating-point or runs on a GPU, it might not be possible to run on the embedded processor in the sensor. Even if it doesn't, if the algorithm was developed in a high-level language, it might be too expensive (in ...


5

Yes. AWS IoT uses MQTT, which follows a topic-based publish-subscribe pattern. This allows multiple subscribers to a topic, and multiple clients can even publish to the same topic (a topic is not specifically designated for one client to publish or subscribe to). To subscribe, a client must send a SUBSCRIBE packet: The SUBSCRIBE Packet is sent from the ...


5

You should try to keep to client key secret (but understand the implication of loosing it(1), as described in the other answers). The server public key, and the AWS public certificate are important to secure at the device end not because you want to keep then secret, but because by replacing the AWS certificate (on a compromised device) an attacker can ...


5

I believe you refer to a mqtt protocol where indeed there are data subscribers and receivers. My short answer is yes, you are on correct track. Longer explanation: MQTT makes it possible to publish on topics and subscribe to any of the topics to get messages according to that topic. That is why the sender would be publisher and the receiver is ...


5

I've got the TP Link HS110 myself. The appropriate connection is established via their app (called Kasa). The process is described here. Without diving into the French Amazon reviews I won't comment on "the critics." However, I've had no issues with these plugs. Having said that it is important to notice that most smart plugs from commercial sellers will be ...


5

Since you're interested in generic ways to connect devices to Alexa, I'll explain the two main methods that devices use when integrating with the Echo platform. Skills Most of the devices that have 'first-class' integration with Alexa have a custom skill. For example, the Belkin Wemo has a skill, and so does the TP-Link device you link to in the question. ...


5

I have created a similar application. Your question covers a lot of ground. You already have AWS and your "thing" working together. The next job (might be) to decide what you want to expose via a web site. There are many web frameworks available to you, I like python django. I would create an interface between your AWS IoT flow to Django, probably ...


5

Many IoT devices are battery-powered, and to conserve battery, enter sleep modes as much as they can. They usually get out of sleep in either of two cases (or both): At fixed intervals, like every 6 hours, or every day for instance When they receive an external signal from a sensor When they wake up, they connect to a server, send their data, may check for ...


4

I believe you don't need to do any coding effort on connecting smart-plugs to Alexa. http://www.belkin.com/us/support-article?articleNum=157351 This link contains all you need to set up the cooperation. You have to have one Alexa device, your first Wemo device and Wemo and Alexa apps (I suppose in your phone). You will have to setup the Wemo device and ...


4

A lot of companies "have the customer enter a serial number in a UI somewhere". When you buy the device, the instructions usually have the customer visit the company website, create an account, and enter the serial number and/or MAC address of the device. The same account you created is what you use with any smart phone apps (usually the company makes a ...


4

You might want to check out Amazon FreeRTOS. Amazon FreeRTOS (a:FreeRTOS) is an operating system for microcontrollers that makes small, low-power edge devices easy to program, deploy, secure, connect, and manage. Amazon FreeRTOS is based on the FreeRTOS kernel, a popular open source operating system for microcontrollers, and extends it with software ...


4

AWS IOT requires that your device understand TCP/IP and encryption. The ATMega328 has 2K bytes of RAM, but Ethernet frames can be up to 1500 bytes long. Even if you could receive a packet, there wouldn't be any room left to process it. The nRF51822 has 16K RAM, which is plenty for Ethernet, but not enough to do TCP/IP and WiFi. (Both of which require ...


4

AWS IoT supports MQTT over Websockets which can be used from with in the client side of a web application. You can follow the instructions here for details of how to do the required authentication.


4

By far the easiest method would be to use a library such as paho-mqtt or the AWS IoT SDK for Python (see the bottom of this post), which are MQTT client libraries for Python. Usage guidance is provided in the linked documentation. Here is an example, for reference, which you may find useful to adapt to your purposes (it's loosely based on the documentation ...


4

Lambda is for running tiny functions, not long-running processes. You should have your web page connect directly to AWS IoT using WebSockets. Then it can get messages directly when they happen and display them, etc. If you don't need to store your state, you don't need Dynamo or S3. (Although you may want to use S3 to host the JavaScript/HTML for your ...


4

I finally figured out what my mistake is. It was in the ARN Resources of policy I wrote a wrong topic in the end of policy resources line. I wrote ldr instead of LDRsensor.


4

I haven't worked with Azure as such but Message Broker for AWS IoT uses MQTT and is like any other MQTT broker (like mosquitto for Linux). MQTT messages basically work on Topics. If the android app is subscribing to a topic then it can receive messages for that topic. Suppose if you have two IoT devices sending data op topics "Topic/Dev1" and "Topic/Dev2" ...


4

The NRF51822 is a Bluetooth low energy device, which is mostly chosen for low power applications. It cannot access the internet using Bluetooth (unless your idea is to access the internet using bluetooth or something of that sort). If your application needs internet access, you should be moving to 802.11a/b/g/n or 2G/3G/4G. So if internet access if what you'...


4

This is a very generic question, the answers mainly depend on your existing skills, and if you desire to progress into developments that might be commercially relevant. Depending how far you want to plan your learning ahead, you might want to start simple, and upgrade the architecture/implementation as you go along. Platform An SBC (Pi or similar) is great ...


3

AWS IoT uses the MQTT protocol (and AWS APIs), not REST. There are two ways to solve your problem: Convert everything to MQTT: Have your web app send a message to AWS IoT (Luckily, they support websockets for just this purpose), and use the AWS mobile SDK to make your mobile app speak MQTT. If you need your components to be RESTful, then you should forget ...


Only top voted, non community-wiki answers of a minimum length are eligible