2

I've seen examples of IoT devices pushing data onto the tangle, such as open source Ruuvi tag, but how do IoT devices listen for events and MAM subscriptions on the tangle. Would the IoT device have to continuously make findTransaction calls to the API host, in intervals decided by the programmer (e.g. every 10 seconds)?

closed as primarily opinion-based by Helmar, Zauz, aboose, Phil-ZXX, Tobi MZ Dec 30 '17 at 11:13

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    IMO, this question isn't really iota specific. Basically it can be reduced to "what kind of strategy can be used to achieve almost real-time remote control on a low-resource-iot-device with poor/unpredictable network connection?" (see also iot.stackexchange.com) – ben75 Dec 17 '17 at 10:51
  • The range of IoT devices is huge. Unless you specify the target group of devices a lot this is just guesswork. – Helmar Dec 17 '17 at 13:33
  • IoT devices that don't have the resources to host a Node/API – GusGorman402 Dec 17 '17 at 20:08
  • In Ethereum, devices listen for Events with NodeJS. The alternative to NodeJS is for the IoT devices to make a call to the API every 15 seconds,checking for state changes, because that's how often the blocks update. But since IOTA is continuously updating... The only other solution I can think of it programming the full node to listen to all transactions, filter out transactions I'm interested, and the node will contact out to the IoT device if the transaction regards that device – GusGorman402 Dec 17 '17 at 20:14
0

The Development Roadmap mentions IoT-Devices in the following manner:

C++

This client is our highest priority at the moment, as we are currently porting IRI over to C++ and plan to continue core development in this language. Unlike Java it does not require a Virtual Machine installed on the devices in order to to run code and it compiles to machine code in real time, making it a lot more suitable for these resource restrained IoT devices. It’s also one of the most supported and typed languages in the world.

The GitHub-Repository does not contain a C++ client, which would be that "highest priority client".

ATM you'll have to use a Gateway (Message Broker). See this article (Storing MQTT messages on the Tangle ) on learn.iota.org which refers to this Message Broker

Using such a Message Broker is an acceptable solution, since it's much more troubling to update the firmware when changes need to be done (new seed, change addresses and so on) than the code on the broker. So, for a beginning, this would be the way to go.

It's up to you to see if the JS client can run on a device like a Particle Photon. If you test it and know the result, it would be great if you share it here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.