zephyr/samples/net/cloud/tagoio_http_post
Bjarki Arge Andreasen 06c2762124 samples: net: cloud: tagoio: Remove GSM modem overlay
The gsm modem driver is deprecated and will be removed. Remove
the build overlay and dependency on the gsm modem from the
tagoio sample.

The new cellular modem driver and subsystem use the native
networking stack and the pm subsystem, so just like ethernet,
enabling the cellular modem is up to the board configuration.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
..
img samples: net: cloud: Introduce TagoIO IoT cloud http post 2020-11-04 09:06:23 +02:00
src random: Rename random header 2023-10-10 14:23:50 +03:00
CMakeLists.txt cmake: increase minimal required version to 3.20.0 2021-08-20 09:47:34 +02:00
Kconfig samples: net: cloud: Introduce TagoIO IoT cloud http post 2020-11-04 09:06:23 +02:00
overlay-wifi.conf samples: net: cloud: Introduce TagoIO IoT cloud http post 2020-11-04 09:06:23 +02:00
prj.conf samples: net: Change to use CONFIG_POSIX_API 2024-03-27 13:40:13 -05:00
README.rst samples: net: cloud: tagoio: Remove GSM modem overlay 2024-05-29 10:49:08 -07:00
sample.yaml samples: net: cloud: tagoio: Remove GSM modem overlay 2024-05-29 10:49:08 -07:00

.. zephyr:code-sample:: tagoio-http-post
   :name: TagoIO HTTP Post
   :relevant-api: bsd_sockets http_client dns_resolve tls_credentials

   Send random temperature values to TagoIO IoT Cloud Platform using HTTP.

Overview
********

This sample application implements an HTTP client that will do an HTTP post
request to `TagoIO`_ IoT Service Platform. The sample sends random temperature
values to simulate a real device. This can be used to speed-up development
and shows how to send simple JSON data to `TagoIO`_ servers.

The source code for this sample application can be found at:
:zephyr_file:`samples/net/cloud/tagoio_http_post`.

Requirements
************

- A free `TagoIO`_ account
- A board with internet connectivity, see :ref:`networking`
- The example provides three ways to get internet:

  * Ethernet: Using default configuration
  * WiFi: Using default configuration plus wifi overlay

TagoIO Device Configuration
***************************

If you don't have a `TagoIO`_ account, simple create a free account at
`TagoIO`_.  After that, add a device selecting Custom HTTP(S) protocol.  That
is it! Now reveal your device token.  The token will be used to identify your
device when sending data.  You need fill ``CONFIG_TAGOIO_DEVICE_TOKEN`` at
:zephyr_file:`samples/net/cloud/tagoio_http_post/prj.conf` file with that
information.


Building and Running
********************

Ethernet
========

You can use this application on a supported board with ethernet port.  There
are many like :ref:`sam4e_xpro`, :ref:`sam_v71_xplained_ultra`,
:ref:`frdm_k64f`, :ref:`nucleo_f767zi_board` etc.  Pick one and just build
tagoio-http-client sample application with minimal configuration:

.. zephyr-app-commands::
   :zephyr-app: samples/net/cloud/tagoio_http_post
   :board: [sam4e_xpro | sam_v71_xult/samv71q21 | frdm_k64f | nucleo_f767zi]
   :goals: build flash
   :compact:


WIFI
====

To enable WIFI support, you need a board with an embedded WIFI support like
:ref:`disco_l475_iot1_board` or you can add a shield like
:ref:`module_esp_8266` or :ref:`inventek_eswifi_shield`.  Additionally you
need fill ``CONFIG_TAGOIO_HTTP_WIFI_SSID`` with your wifi network SSID and
``CONFIG_TAGOIO_HTTP_WIFI_PSK`` with the correspondent password at
:zephyr_file:`samples/net/cloud/tagoio_http_post/overlay-wifi.conf` file.

.. zephyr-app-commands::
   :zephyr-app: samples/net/cloud/tagoio_http_post
   :board: disco_l475_iot1
   :gen-args: -DEXTRA_CONF_FILE=overlay-wifi.conf
   :goals: build flash
   :compact:

.. zephyr-app-commands::
   :zephyr-app: samples/net/cloud/tagoio_http_post
   :board: [sam_v71_xult/samv71q21 | frdm_k64f | nucleo_f767zi]
   :shield: [esp_8266_arduino | inventek_eswifi_arduino_uart]
   :gen-args: -DEXTRA_CONF_FILE=overlay-wifi.conf
   :goals: build flash
   :compact:

Visualizing TagoIO dashboard
****************************

After you got some logs on console it is time to create a dashboard on the
TagoIO to visualize the data.

* Go to the TagoIO web console
* Create a dashboard as Normal, give it a denomination and move next
* Add a line plot graph. You will see your device, temperature variable will
  be automatically selected for you.
* Just Save and enjoy!

.. image:: img/TagoIO-pc.jpeg
     :width: 640px
     :align: center
     :alt: TagoIO web dashboard

You can experiment the TagoIO mobile application on your cellphone or tablet.
Simple go to your app store and search by TagoIO, install, sign in, enjoy!

.. image:: img/TagoIO-mobile.jpeg
     :width: 480px
     :align: center
     :alt: TagoIO mobile dashboard

More information at `TagoIO`_ and `TagoIO Documentation`_.

References
**********

.. target-notes::

.. _TagoIO:
   https://tago.io/

.. _TagoIO Documentation:
   https://docs.tago.io