Arduino uno+GSM+Ethenet show the sms on my website

Hello! I use a Arduino UNO + GSM module + Ethernet module. I try to show sms on my website, but I can’t send the received gsm sms on the arduino to the to ethernet. The Serial show me sms received, but do not transfer these to the ethernet stream. I attach my arduino code. Please help me!

#include <GPRS_Shield_Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#include <SPI.h>
#include <Ethernet.h>

#define PIN_TX 7
#define PIN_RX 8
#define BAUDRATE 9600

#define MESSAGE_LENGTH 160
char message[MESSAGE_LENGTH];
int messageIndex = 0;

char phone[16];
char datetime[24];
char packetBuffer[20];

char datatimp[24];
char telefon[16];
char mesaj[MESSAGE_LENGTH];

GPRS gprs(PIN_TX, PIN_RX, BAUDRATE); //RX,TX,PWR,BaudRate

byte mac ={ 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
char server=“www.mywebsite.com”;
IPAddress ip(192,168,0,177);
EthernetClient client;

void setup() {
Ethernet.init(10);

gprs_connection ();
ethernet_connection ();
}

void gprs_connection ()
{
gprs.checkPowerUp();
Serial.begin(9600);
while (!gprs.init()) {
Serial.print(“init error\r\n”);
delay(1000);
}
delay(3000);
Serial.println(“Init Success, please send SMS message to me!”);
}

void ethernet_connection ()
{
if (Ethernet.begin(mac) == 0) {
Serial.println(“Failed to configure Ethernet”);
Ethernet.begin(mac, ip);
}
delay(1000);
Serial.println(“Init Success configure Ethernet”);
}

void loop() {
Sending_To_phpmyadmindatabase();
messageIndex = gprs.isSMSunread();
if (messageIndex > 0) { //At least, there is one UNREAD SMS
gprs.readSMS(messageIndex, message, MESSAGE_LENGTH, phone, datetime);
//In order not to full SIM Memory, is better to delete it
gprs.deleteSMS(messageIndex);
Serial.print("phone: ");
Serial.println(phone);
Serial.print("datetime: ");
Serial.println(datetime);
Serial.print("message: ");
Serial.println(message);
char message=mesaj;

}

}

void Sending_To_phpmyadmindatabase()

{
if (client.connect(server,80)){
Serial.println(“connected”);
//HTTP request:
//In order not to full SIM Memory, is better to delete it
client.print(“GET /ethernet/view.php”);
Serial.println("phone: ");
client.print(phone);
Serial.println("datatime: ");
client.print(datetime);
Serial.println("message: “);
client.print(message);
client.println(” ");
client.print(“HTTP/1.1”);
client.println(“Host: www.mywebsite.com”);
client.println(“Content-Type: application/x-www-form-urlencoded”);
client.println(“Conntection: close”);
client.println();
Serial.println();
client.stop();

}
else {
Serial.println(“connection field”);
}
delay(500);

artuino+gsm+ethernet.txt (2.61 KB)

You should have made sure that the writing to database works as a standalone.

Seems like it is broke and you don't even bother to fix it.

.

Thank you, ieee488! I'll come back with posts after making changes.