What is the ideal network protocol to communicate an App with Arduino?

Asked

Viewed 384 times

1

I realized the creation of an application through Android Studio. I have a Mega Rduino, Shild Ethernet and infrared sensors.

I would like to communicate my website with my application.

Ex: I was traveling, when the infrared sensor triggered, I was alerted in my application.

I saw many tutorials, but only with intranet network.
Just remembering, my internet contemplates the system IPV6.

  • 1

    http... protocol but if it is the most ideal for your project, I cannot say. On Arduino or another device on the local network, you mount a small server. The idea would be to send the data to that local server over the intranet. This server would have an internet connection and on your smartphone you would have an app to maintain constant communication with the server. Search for "message Queue".

  • 1

    I already think it’s better to use "push Notifications". The Android operating system sometimes kills applications that are unused for a while and the push has the advantage of restarting these applications when a new message arrives.

1 answer

1

You can use the mqtt standard, this was developed exactly to be super light and be used in capturing sensors and signals.

Using the service https://datasparkfun.com/ your Arduino does an http post in the style

http://data.sparkfun.com/input/sua-chave&nomeCampo=valor

Sparkfun annotates the results, with date and time, generates graphs and you can program your android app to consult these data available on the site.

This way you will not be communicating directly Uino - cellular, but avoids having the need to open doors on your router to expose on the internet your Uino, local network and also the need to monitor the changes of your public ip (external ip of your router) which is usually not fixed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.