Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Data transfer over internet via http or another protocol.

Hi Guys,

I am currently working on my own IoT project. In my device there are some inputs and outputs. I want to control my device remote over internet. I have more than one device to control and that devices have static ip, so ip adress is changing all the time. It means ssh connection to control the devices is bad idea because ip is changing few times in every hour.

The connection algorithm is something like this.

Ä°f one of the device input changes=>send request to server and tell the parameter has changed. If server took any changes in a parameter=>send request the user client to tell the parameter has changed.(or users sends request for every 5 seconds to ask is there an any change in the device)

If user client changed a device output=>send data to server to tell an output data of device has changed

If server took any changes in device output parameter=>send request to device to tell the output parameter has changed(or device sends request for every 5 seconds to understand if it should change any output value)

I need to create a server side. The devices should connect the server and users too will connect to server. So I have some clients and one server.

My first question is if my devices connects to server as a client. And sends request for every 5 seconds. It means my device will response my changes in a 5 seconds delay. And I dont want delay. In the same time if there are no changes in the server, my device will send nonsense request to server and make server busy. So is it possible to send request to client from server?

Same problem for user to see if there is an any updates in the server. I need to send request to client from server because I dont want delay.

My second question is can I change a data in a file with php? I am talking about editing a file like txt file... Or is there an any alternative way to do this projects' server side?

What do you suggest?

Thanks in advance and I am sorry because of my bad english...

3 Answers

It is really hard to advise you without know more details of you IoT project.

There are a whole variety of wireless technologies (including Zigbee, Z-wave, 6LoWPAN, WiMax, etc) --mostly concentrated on putting together "mesh" networks that support extremely low power device of very short distances.

However, it sounds like your device is using data transfer to an Internet server over a wired connection.

Besides HTTP, though, they are protocols like MQTT (MQ Telemetry Transport) and CoAP (not very secure but good for power constrained devices).

Many MQTT implementations use something called "data streams":


There is even talk of "data stream networks" evolving in various forms:


But overall the IoT thing is happening very much from the "ground up".

That means that no big commercial consortium is "pushing" the technology,

(although many are trying to adapt to support it somewhat),

thus the protocols (including data communications) ,

and any worldwide "community", are still very much

in the "nascent" (still-under-development) stage.

Here's one article related to this:


That article talks about going down the 7 layer OSI model:


..moving from FTP to level 4 protocols like TCP and UDP (but

I don't know if you want to go that low).

One forum I've found for IoT questions that's not totally hostile to "noob" question is this one:


...and I'm sure there are others if you google around a little.

Bottom line:

Finding specific answers for specific IoT projects/devices is going to take some more specifics (like Raspberry Pi versus Arduino, drivers used, which O/S (probably Linux variant) used, etc.

Good luck with your project, though...sound interesting.

And if you know better community to ask questions like this please let me know :)

Hi James,

Thank you very much for your answer. It was very informative with so nice keywords for google :) I am currently reading the community forum you have shared. And reading about MQTT, XMPP etc. I will write here and update you when I found something if you interested about my project.

Thank you very much again, keep follow this discussion. I am sorry about my bad english, have a nice day.