Update Online Database using GSM/GPRS Shield

User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by Neo » Sun Aug 31, 2014 2:50 pm

Any one know about how to get the GSM BTS location using AT Commands....(like cell info display in mobile phones)
I'm using SIM900 Efcom GSM/GPRS Shield..
Use following commands to read the broadcast messages coming in channel 50. Let us know your response.

Code: Select all

AT+CMGF=1
AT+CNMI=2,0,2,0,0
AT+CSCB=0,"50","0-9"
lakindu93
Sergeant
Sergeant
Posts: 21
Joined: Wed Jun 26, 2013 12:45 pm
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by lakindu93 » Sun Aug 31, 2014 8:18 pm

Here is the output.. it gives an error :(

AT+CMGF=1

OK
AT+CNMI=2,0,2,0,0

OK
AT+CSCB=0,"50","0-9"

ERROR
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by Neo » Sun Aug 31, 2014 10:41 pm

Get the AT command reference manual for the exact version you use and see whether it has CSCB command. It is found that some versions don't have this function.
lakindu93
Sergeant
Sergeant
Posts: 21
Joined: Wed Jun 26, 2013 12:45 pm
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by lakindu93 » Mon Sep 01, 2014 12:54 am

Neo wrote:Get the AT command reference manual for the exact version you use and see whether it has CSCB command. It is found that some versions don't have this function.
AT command reference manual has that command
AT+CSCB?
+CSCB: <mode>,<mids>,<dcss>

what is this <mids> and <dcss> ?
lakindu93
Sergeant
Sergeant
Posts: 21
Joined: Wed Jun 26, 2013 12:45 pm
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by lakindu93 » Thu Sep 11, 2014 12:19 pm

Help me to get BTS location using AT Commands... :(
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by Neo » Mon Sep 15, 2014 3:09 am

If the above commands doesn't work at all, then it seems your chip either doesn't have the feature or you are using a duplicate chip. It is good to contact the customer service of the chip manufacturer with details so they would assist you from there.
lakindu93
Sergeant
Sergeant
Posts: 21
Joined: Wed Jun 26, 2013 12:45 pm
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by lakindu93 » Mon Sep 15, 2014 8:25 am

hmm ok thanks aiya...
lakindu93
Sergeant
Sergeant
Posts: 21
Joined: Wed Jun 26, 2013 12:45 pm
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by lakindu93 » Wed Sep 17, 2014 7:19 pm

?? PC ???? ????? host ???? ????? mysql database server (local database ????), EFcom GPRS/GSM shield ?? ???????? ???? access ????? ??????? ?? ??????? ??? ?????? ?????? ???? idea ???? ????????...
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Update Online Database using GSM/GPRS Shield

Post by SemiconductorCat » Wed Sep 17, 2014 11:12 pm

lakindu93 wrote:?? PC ???? ????? host ???? ????? mysql database server (local database ????), EFcom GPRS/GSM shield ?? ???????? ???? access ????? ??????? ?? ??????? ??? ?????? ?????? ???? idea ???? ????????...

Directly.
First you need to shift your database server into your DMZ zone and then enable it for the world.
Then you need to forward the mysql port in your router. Probably your router would support this option with a nice web based router GUI.

Then your ardino directly connect to that server using that connection.

Code: Select all

/**
* Example: Hello, MySQL!
*
* This code module demonstrates how to create a simple 
* database-enabled sketch.
*/
#include "SPI.h"
#include "Ethernet.h"
#include "sha1.h"
#include "mysql.h"

/* Setup for Ethernet Library */
byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress server_addr(10, 0, 1, 23);

/* Setup for the Connector/Arduino */
Connector my_conn; // The Connector/Arduino reference

char user[] = "root";
char password[] = "secret";
char INSERT_SQL[] = 
 "INSERT INTO test_arduino.hello VALUES ('Hello, MySQL!', NULL)";

void setup() {
  Ethernet.begin(mac_addr);
  Serial.begin(115200);
  delay(1000);
  Serial.println("Connecting...");
  if (my_conn.mysql_connect(server_addr, 3306, user, password))
  {
    delay(500);
     /* Write Hello, World to MySQL table test_arduino.hello */
     my_conn.cmd_query(INSERT_SQL);
     Serial.println("Query Success!");
  }
  else
    Serial.println("Connection failed.");
}

void loop() {
}
There is another way to do this using a web service or HTTP front end. In that way they
are using "onewire" library.In that way you don't need to do port forwarding or risk your database zone in
a DMZ zone.

src: http://drcharlesbell.blogspot.com/2013/ ... ino_6.html

If this is a short range application like solar plant monitoring , then why didn't you use ethernet or wifi
instead.Wi fi is long term beneficial. And remind you something, sometimes you may need to save your readings
in a SD card like thing in a case where connection is loss or server down. My friend who implemented a solar based
monitoring client have done that, don't know how. But don't assume you have fancy things like sqlite things in
ardino because even sqlite is very large to be implemented on AVR microcontroller. If android or RPI then you could
definitely use MYSQLite.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Update Online Database using GSM/GPRS Shield

Post by Neo » Wed Sep 17, 2014 11:52 pm

While Semi has given lot of information on that, I would like to ask 'why not use a shared/Virtual or dedicated server for this?'. Server space had become cheaper over the years and you can buy a cheap shared hosting server for about Rs. 500 per month. If you get a domain registered and assigned to your server, then everything become easier to access.
Post Reply

Return to “Arduino”