Sending data to an external webpage

Hello, I'm trying to figure out a way how to send data from the Arduino it's to a external webpage and not have it to go to a database. Everything I found so far is saying it needs to be on a database first. Not sure what to do or how to really phrase it correct. I really need help to figure this out. Please help me? To be honest Not even sure where to start at.

Joseph

you probably did not search well...

There is no really such thing as an 'external web page'. Typically a server generates an HTML compliant document that is downloaded by a client application (usually a web browser) using the HTTP protocol.

In order to access the the server, the client needs to have an IP route from its current network to the server's network. If both are at home and on the same network, it's easy. If the server is hosted somewhere (an ISP) with direct access from internet, it's easy. If you want to access the server hosted in your home, behind your internet provider's box, from anywhere in the world then you'll have to poke some holes into your home network to allow for the incoming connection (and take a few extra steps to be able to find your home).

which Arduino do you have ?
where is the server?
where is the client?

@J-M-L I did search a lot. I wasn't sure what to really search for send I only did it once many years ago and forget what it was called or how to do it. I'm using an arduino uno with ethernet.

I'm trying to just send data from the arduino on my network internet connection to an external web site page that is on my hosting to be displayed it. I'm not logging at all.

No worries, we all started with limited knowledge.

There is no such thing really as an "external web site page".

Do you mean you have access and control for a web server which is hosted somewhere on the internet and you want to reach out to that server to provide some data so that later when you ask this server to generate a page (from a client browser) you can see the data (may be a graph, or historical info or whatever)?

If yes, is there a service on that server that is ready to accept data?

A bit more information or exact context would help.

A long time ago I saw a way to send temperature sensors to an php webpage from the arduino and that webpage send that information to a database and another webpage was able to take that data from the database and display it on another webpage. What I'm tryint to do is skip the logging and go straight to just viewing it That is all.

You don't need to log anything but you need to run a web server (for example on an ESP32) which has access to a temperature sensor.

From the web browser on a PC or smartphone etc., you contact the say ESP32 by giving say its IP address in the search bar and it [the ESP32] dynamically generates a web page which appears in your browser with temperature data all nicely formatted.

Is that what you want to do ?

If you have a specific web page on an external web server where this data should appear, then give its URL here so we can see it.

@6v6gt I can't port fordward anything to get a webpage to go out to the world. That is why I need to send it to a hosting server web site page.

OK. Then you need to have a web page (or some other means) on the external web server which can accept your temperature data. It then stores that temperature data somewhere in the background. When a user wants to see your temperature data then they enter the URL in their browser of (usually) another webpage on the same server which is designed to display that temperature data.

Have you full access to the external web server for loading PHP scripts etc. ?

@6v6gt I don't have none of that. A long time ago I did this same thing. I can't find it or what is it called. I'm trying to search my old arduino forum post but coming up no luck.

You have two options

Option 1: you make your Arduino visible from the internet and it becomes the one serving the web page displaying the temperature sensors. This requires poking holes into your home network and there is no need for the intermediary, internet hosted, web server.

Option 2: you want to go through the intermediary, internet hosted, web server because you don't want to/can't open your home network.

In case of option 1, you develop some code on the arduino so that it builds a web page when accessed from a web client. This code can read the sensors and send the exact timely information out.

in the case of option 2, you'll need two services on the hosted server. One service that will "record" the sensors' values and one service that will generate and send the web page out to the clients. The arduino code reaches out from time to time to the first service and say "here are the current values" and when a client connects to the server, the second service reads back the latest values from "somewhere" and builds a nice web page and sends that out. It often takes the form of two PHP or python scripts running on the server but not always.

If you don't want to archive a log of all the sensors' values in a database, the first script (the one receiving the sensors' values from the Arduino) could generate an HTML document on the server (so a static page) and the clients would always access this page. There would be nothing dynamic in the page, it will just be a "document" that gets updated every time the arduino connects.

Another option is to just save the values in a small file on the server (like a mini database holding only one record in an easy to read format, like JSON) and the second program would read that file and generate the web page dynamically.

makes sense?

this ?

@6v6gt I remember that post. No that wasn't it. That was for controlling things. I don't need to control anything However I just wanted to send temperature sensor data from the arduino itself to the web site page.

@J-M-L @6v6gt I found it. https://forum.arduino.cc/t/settings-up-a-dht22-sending-to-a-mysql-being-displayed-on-a-web-page/559263 It does store to a mysql page. I need to study it.

OK

As I said, if you don't need historical data, there is no need to store this info in a "real" database.

@J-M-L No I don't need to store it. As I'm looking over the old post It does show that it I did send from the arduino itself to a add.php page which in that page send the information to a mysql it looks like and from there another page showed the results. I might be wrong but that is what it looks like as I'm reading it.

I'm not sure how to just send it to the page itself and have it just display in real time.

Hi josephchrzempiec,

please tell us then, what you have exactly. Because none is a bit little ...

How I understand some of you statements:
You want to "post" some data to some webserver, where some web page of yours is showing something - then including some information coming from your arduino.
Did I get it right?

Then there are several possibilities. Partially already discussed here.
Since you already mentioned php, it would be quite easy to create a php script, which is extracting the data from a simple http get request, which is send by the arduino.
This script can store this data in a simple textfile on the webspace. An other php can in any moment read tis data out of this textfile, to render the value(s) in some website intended to show this data.

But if your "none of that" means you don´t have access to the webserver and are not able to create such a php scripts, then I don´t understand, what you want to do.

Sorry but that does not make any sense.

The server does not display anything. The client browser does and it displays whatever it got from the server.

So if you want to connect from your PC to your server, say using Firefox and that without touching anything on the PC, the values of the sensors change dynamically, then the web page needs to be built in the right way and there needs to be a path from the data in the arduino to that Firefox managed window on the PC. The way the page refreshes itself needs also to be coded, there are a few options for that.

You need to decide first if you want to go from the Firefox browser straight into the Arduino (option 1) or if you want to get the web page from the hosted web server.

That will influence how the rest of the code and architecture is designed.

Temperature data is quite dynamic but it would be theoretically possibe to to create a completely static web page with the current temperature together with any desired formatting, at say 5 minute intervals, and use one of the protocols such as FTP, WebDAV etc. to replace the previous web page in its file system on the web server. This is how some Web site publishing systems work.

Whereas this is OK for reasonably static data, it would miserable for dynamic data.
Your second problem would be using an arduino to access a foreign file system. I don't recall seeing any projects which could act as an example here. Again, you'd still need some privileges on the web server to write in its file system.

yes, if FTP is enable on the hosted server, then the arduino could generate a file dynamically every now and then and push it in the right location on the server where it would be served through HTTP.

I feel like a lot of the technology discussion and trying to educate OP could be skipped if they were just pointed to something like Welcome to Adafruit IO that is literally designed for this task (and free).