How to send sensor data from Arduino to a self-hosted server?

Hello everyone,

I am working on an Arduino project where I want to send sensor data
(temperature and humidity) to my own server for logging and analysis.

My setup:
– Arduino Uno
– ESP8266 WiFi module
– Basic HTTP requests

My questions:

  1. Is it better to use HTTP or MQTT for this use case?
  2. Any common mistakes to avoid when sending data to a custom server?
  3. How often should data be sent to avoid connection issues?

I am looking for general guidance before implementing this.

Thanks for your help.

Only speaking for myself.
I would use MQTT.
Common mistakes are probably too much data for the communications method. We see someone trying to use I2C to send data 10's of metres once a month. I2C is designed to be intra-board, in other words cms with a 'normal' max of 1 M.
Not sure how the frequency of sends affects connection issues, but an average of 80% untilization of whatever coms media is used sounds about right.
Be sure to let us know how it goes.

Welcome to the forum

As your topic does not relate directly to the installation or operation of the IDE it has been moved to the General Guidance category of the forum

What is your self-hosted server and what is it running or going to run ?
Is it say a Linux box with apache, mySql and php or is it an ESP32 or raspberry pi or what? Is it in your own network at home ?

There are many examples around of using an ESP as an http client posting data to an http server so that may be an easy way to go.