Host · Internet of Things

It’s alive!

Introduction

In my last post (https://myiot97.wordpress.com/2017/06/21/the-host-side-why/) I explained that my intention was to create a host that my IOT creations can communicate via. The advantage of this is that the devices can be accessed from remote sites without having to mess around with ISP incoming connection settings, dynamic DNS or any of that stuff (if you don’t know what I’m talking about, it doesn’t matter because that’s what the MyIOT host is for).

The good news is that the MyIOT host site is alive.

The better news is I am happy for others to use it for legal,  non-commercial, non-life critical, user accepts all responsibility for losses/damages purposes, so I’m going to describe how to register with and use the site in this post. The reason for the condition is that the site is a development environment, and will evolve, though what I document will mostly stay the same.

Site operation

The site is designed with efficient device programming in mind, so the user interface while clunky to a human should be easy for a device to interface with.

The device issues commands to the site using http get operations, on a web browser, this would look like the following:

MyIOT/index.php?cmd=get&id=12

In this case,  it gets the setting for device ID 12, and the result looks like:

GetResult

Result of get operation

In most cases, the device will just have to parse the data line by line looking for the value= line and using that value.

There is a corresponding command, set that sets the value, which looks like:

MyIOT/index.php?cmd=set&id=12&value=23

Before you can use the site, you need to create a loginid, and before creating and using device ids you need to login, to learn how to do that, read on…

Before that though, the site will evolve, keep an eye on this blog for information as that happens. One of the first changes on the way will be an easier way to see device status  in a web browser, anyway, back to the basics.

Creating a loginid

A login ID is associated with a valid email address. A quick privacy note – the email address is stored for security only, It won’t be used for spam purposes or provided to third-parties

To create a loginid, modify the following URL to include your email address replacing <email> and open it in a browser:

http://rowanfamily.org/MyIOT?cmd=register&email=<email&gt;

The response will be:

RegisterResult

The email will include a randomly generated loginid, and a link you need to click on to activate the loginid. The loginid may then be used by devices to access the site.

ActivationEmail

Click on the link to activate your account.

Logging in

In order to access your device information, you must first login using the connect command, which has the format:

http://rowanfamily.org/MyIOT?cmd=connect&loginid=<id&gt;

replacing  <id> with the loginid provided in the email. The response will be:

ConnectResult

You can now create and access devices

Creating a device

Devices have numeric ids that you chose from -2147483648 to 2147483647, I don’t recommend using 0 though.

In order to create a device id, you need to be logged in. The device id only needs to be created once.

The command to create a device id is:

http://rowanfamily.org/MyIOT?cmd=create&id=<n&gt;

Replacing <n> with the device id that you choose.

Setting a value for a device

Before this will work, you need created the device id. This command can be used if you are logged in, or you can use it without being logged in by specifying the loginid=<n> parameter.

The command format is

http://rowanfamily.org/MyIOT?cmd=set&id=<n>%value=<value>%5B&loginid=<l>%5D

Replacing <n> with the device id that you choose, and <value> with a number from -2147483648 to 2147483647.

Getting the value of a device

Before this will work, you need created the device id. This command can be used if you are logged in, or you can use it without being logged in by specifying the loginid=<n> parameter.

The command format is

http://rowanfamily.org/MyIOT?cmd=get&id=<n>%5B&loginid=<l>%5D

Replacing <n> with the device id that you choose.

Incrementing a value for a device

This option is intended for devices that have only one event to report, like a movement sensor, it is known as a woof, referring to an alarm event.

Before this will work, you need created the device id. This command can be used if you are logged in, or you can use it without being logged in by specifying the loginid=<n> parameter.

The command format is:

http://rowanfamily.org/MyIOT?cmd=woof&id=<n>%5B&loginid=<l>%5D

 

If you lose your loginid

If you lose the loginid, just attempt to re-register the same email address, and you will get the response:

Resend

Click on the link, and the activation email will be re-sent with the details. You do not need to  re-activate if you previously activated your account.

Leave a comment