Sending text message from web page to Arduino

Hi all.. :slight_smile:

I need some suggestions for my project. This is my first time building an Arduino project, although I have done some searching on the internet, still, hope that can know is there other better/smart ways to solve the problem as you guys have more experiences. :slight_smile:

So, what I am doing currently is to send a text message from web page to Arduino for display, but I am kinda confusing with the flow of the data.

From what I understand is,
if(want to display current message)
Arduino(current message) -> display
else if (want to display new message)
Web page(fill in new message) -> data pass through API to Arduino -> Arduino(new message become current message -> display

So, my question is
1. What is the smart approach to doing this? (Arduino Yun seems like a good choice, but is there any other cheaper board to choose? I have UNO, mega and wifi shield.)
2. Is my understanding of the flow correct? Do I miss something in the flow?

Thanks for reading such a long para. Can see that I am kinda lost. :cold_sweat: Thanks in advance for those who answer!

Wemos Mini?
s-l225 (5).jpg

s-l225 (5).jpg

Hi Paul,

Thanks for the suggestion! It is really a good option!

Meanwhile, do you mind explain how the flow of sending message to the board from a webpage if I am using WiFi shield with UNO? kinda confuse with the API stuff :cold_sweat:

Is my understanding of the flow correct?

Learn more about ESP8266. It can run an http server without Uno or Mega. A display can also be connected to an ESP8266.

https://tttapa.github.io/ESP8266/Chap01%20-%20ESP8266.html

So, what I am doing currently is to send a text message from web page to Arduino for display, but I am kinda confusing with the flow of the data.

I am kind of confused about what you are trying to do.

It sounds like you want to have a webpage that sends SMS messages, is that right?
Does the webpage already exist, what is it running on, and can it send SMS messages to a mobile phone?
Does your Arduino have a GSM module that can receive SMS messages?

Surely all that happens is;
Your webpage send an SMS.
The Arduino receives the SMS.
The Arduino displays the SMS.

Or am I completely misunderstanding

I'm not sure the OP meant SMS text messages. Just a web page where a line of characters can be keyed in and then displayed by the Arduino/WiFi shield/Wemos on a display of some kind.

The easiest way I can think of to achieve this is for the Arduino/WiFi shield/Wemos to act as a web server. It would create the web page and accept the user's text by receiving an http GET or POST request.

PaulRB:
I'm not sure the OP meant SMS text messages. Just a web page where a line of characters can be keyed in and then displayed by the Arduino/WiFi shield/Wemos on a display of some kind.

The easiest way I can think of to achieve this is for the Arduino/WiFi shield/Wemos to act as a web server. It would create the web page and accept the user's text by receiving an http GET or POST request.

I think you are right. It threw me when he wrote "send a text message", and also the comment about an API. It is interesting the Yun has been mentioned, that is twice in the last week or so but before that I had never seen it crop up in posts at all.

ardly:
I am kind of confused about what you are trying to do.

It sounds like you want to have a webpage that sends SMS messages, is that right?
Does the webpage already exist, what is it running on, and can it send SMS messages to a mobile phone?
Does your Arduino have a GSM module that can receive SMS messages?

Surely all that happens is;
Your webpage send an SMS.
The Arduino receives the SMS.
The Arduino displays the SMS.

Or am I completely misunderstanding

Hi, I am sorry for making you confused. What I meant is a "string".

The webpage sends a string. The Arduino receives a string. The Arduino display a string. :slight_smile:

Base on what gdsports suggested, I am learning the ESP8266 now.

pehshuwei:
Base on what gdsports suggested, I am learning the ESP8266 now.

I don't know the ESP8266 so cannot comment on it. The Arduino itself can host simple websites here is a tutorial;

If all you want is some simple user input to the Arduino via a webpage I would not over complicate things.

I think the 'issue' you need to address is, how will the Arduino know there is a new message?

You have a 'webpage'
You have an Arduino.. (lets say with an ESP8266-01 module)

Where is the connection?

Lets start with getting some background on this 'web page'?

Is this text on the page? Submitted via form? Saved in a database/table?

The problem is....
1.) The Arduino will not know there is a new message to be displayed
2.) There is no default protocol to let the Arudino know something has changed.

This leads to:

1.) The Arduino/ESP will have to constant 'poll' this 'webpage, php script, database..etc' to know if there was a change (huge waste of time and resources when there is NO CHANGE to display)

There are several solutions for this... but which one is right for you I cant say. We need more info.

You sign up an IoT type of service?
You could set up your own MQTT broker using a Raspberry PI
You could host the 'webpage' on the ESP module.. (and since its hosting the page and connected to the Arduino, it can get instant notification about a message change)..

So (again) lets start with the webpage stuff..

What does it consist of?
How does a user change this 'display message'?

The quick & dirty (but not efficient) way would be to:

Have an HTML form, with an input (textarea) field..
User adds new message and submits form.
Form saves this message to a database/table

The Arduino/ESP calls a PHP script
PHP script checks if new message and if yes, returns the string to be parsed by the Arduino/ESP
** The 'killer' here is that the Arduino/ESP will have consistently check for this..

Better approach is to set up some sort of Raspberry PI as a MQTT broker (as well as configured as a LAMP server)..
Now when this change happens to the message...
You can 'publish' this change to all 'subscribed' Arduino/ESP's (as they just sit and wait for it, instead of constantly checking)

1 Like

The problems raised by @xl97 go away if the Arduino hosts the webpage, as I said avoid complicating things.

gdsports:
Learn more about ESP8266. It can run an http server without Uno or Mega. A display can also be connected to an ESP8266.

A Beginner's Guide to the ESP8266

PaulRB:
I'm not sure the OP meant SMS text messages. Just a web page where a line of characters can be keyed in and then displayed by the Arduino/WiFi shield/Wemos on a display of some kind.

The easiest way I can think of to achieve this is for the Arduino/WiFi shield/Wemos to act as a web server. It would create the web page and accept the user's text by receiving an http GET or POST request.

ardly:
The problems raised by @xl97 go away if the Arduino hosts the webpage, as I said avoid complicating things.

Hi guys, just some updates here.
Like what some of you suggested, I am using Espresso Lite V2 that come with ESP8266 based module as a web server.
Thanks for your help!