Currency :
Login Register

Login to your account

Username
Password *
Remember Me

Create an account

Fields marked with an asterisk (*) are required.
Name
Username
Password *
Verify password *
Email *
Verify email *
Captcha *
Real time web analytics, Heat map tracking

Search

Your Cart

Your Cart is Empty

new customer 200p

EduBanner20160216

Preorder Logo

Free Shipping 200x200

Promotion

Our Products

HomeForumFeedback/SupportThaiEasyElec Product (Code: ETEE)การโพสข้อความจาก 3G module
Welcome, Guest
Username: Password:    Remember me  

TOPIC: การโพสข้อความจาก 3G module

การโพสข้อความจาก 3G module     4 months 2 weeks ago #1

ผมลองใช้ library HTTP_POST เพื่อโพสข้อความบนเว็บแต่ทีนี้ไม่มีอะไรเกิดขอคำแนะนำด้วยครับ
#include "TEE_UC20.h"
#include "SoftwareSerial.h"
#include <AltSoftSerial.h>
#include "call.h"
#include "sms.h"
#include "internet.h"
#include "File.h"
#include "http.h"

INTERNET net;
UC_FILE file;
HTTP http;

//SIM TRUE  internet
#define APN "www.dtac.co.th"
#define USER ""
#define PASS ""

//SoftwareSerial mySerial(2, 3); // RX, TX
AltSoftSerial mySerial;

void debug(String data)
{
  Serial.println(data);
}
void data_out(char data)
{
  Serial.write(data);
}
void setup() 
{
  Serial.begin(9600);
  gsm.begin(&mySerial,9600);
  gsm.Event_debug = debug;
  Serial.println(F("UC20"));
  gsm.PowerOn(); 
  while(gsm.WaitReady()){}
 
  Serial.print(F("GetOperator --> "));
  Serial.println(gsm.GetOperator());
  Serial.print(F("SignalQuality --> "));
  Serial.println(gsm.SignalQuality());
 
  Serial.println(F("Disconnect net"));
  net.DisConnect();
  Serial.println(F("Set APN and Password"));
  net.Configure(APN,USER,PASS);
  Serial.println(F("Connect net"));
  net.Connect();
  Serial.println(F("Show My IP"));
  Serial.println(net.GetIP());
  Serial.println(F("Start HTTP"));
  http.begin(1);
  Serial.println(F("Send HTTP POST"));
  http.url("http://dweet.io/dweet/for/test4test?hello");
  Serial.println(http.post());
  Serial.println(F("Clear data in RAM"));
  file.Delete(RAM,"*");
  Serial.println(F("Save HTTP Response To RAM"));
  http.SaveResponseToMemory(RAM,"http://dweet.io/dweet/for/test499test?hahaha");
  Serial.println(F("Read data in RAM"));
  read_file(RAM,"http://dweet.io/dweet/for/test499test?hahaha");
  Serial.println(F("Disconnect net"));
  net.DisConnect();
  
}
void read_file(String pattern,String file_name)
{
  file.DataOutput =  data_out;
  file.ReadFile(pattern,file_name);
}
void loop() 
{
  if (gsm.available())
  {
    Serial.write(gsm.read());
  } 
  if (Serial.available())
  {
    char c = Serial.read();
    gsm.write(c);
    
  } 
}
The administrator has disabled public write access.

การโพสข้อความจาก 3G module     1 month 1 day ago #2

ต่อวงจรตามนี้

#include "TEE_UC20.h"
#include "SoftwareSerial.h"
#include "call.h"
#include "sms.h"
#include "internet.h"
#include "File.h"
#include "http.h"

INTERNET net;
UC_FILE file;
HTTP http;

//SIM TRUE internet
#define APN "www.dtac.co.th"
#define USER ""
#define PASS ""



void debug(String data)
{
Serial.println(data);
}
void data_out(char data)
{
Serial.write(data);
}
void setup()
{
Serial.begin(9600);
gsm.begin(&Serial1, 9600);
gsm.Event_debug = debug;
Serial.println(F("UC20"));
gsm.PowerOn();
while(gsm.WaitReady()){}

Serial.print(F("GetOperator --> "));
Serial.println(gsm.GetOperator());
Serial.print(F("SignalQuality --> "));
Serial.println(gsm.SignalQuality());

Serial.println(F("Disconnect net"));
net.DisConnect();
Serial.println(F("Set APN and Password"));
net.Configure(APN,USER,PASS);
Serial.println(F("Connect net"));
net.Connect();
Serial.println(F("Show My IP"));
Serial.println(net.GetIP());
Serial.println(F("Start HTTP"));
http.begin(1);
Serial.println(F("Send HTTP POST"));
http.url("dweet.io/dweet/for/testing2?hello=world&foo=bar");
Serial.println(http.post());
Serial.println(F("Clear data in RAM"));
file.Delete(RAM,"*");
Serial.println(F("Save HTTP Response To RAM"));
http.SaveResponseToMemory(RAM,"dweet.io/dweet/for/testing2?hello=world&foo=bar");
Serial.println(F("Read data in RAM"));
read_file(RAM,"dweet.io/dweet/for/testing2?hello=world&foo=bar");
Serial.println(F("Disconnect net"));
net.DisConnect();

}
void read_file(String pattern,String file_name)
{
file.DataOutput = data_out;
file.ReadFile(pattern,file_name);
}
void loop()
{
if (gsm.available())
{
Serial1.write(gsm.read());
}

if (Serial.available())
{
char c = Serial1.read();
gsm.write(c);

}
}
Attachments:
The administrator has disabled public write access.

Newsletter

Follow Us