Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

GPRS Datalogger help needed

Status
Not open for further replies.
Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
791
Trophy points
1,393
Location
Bangalore, India
Activity points
0
Can I use SIM300 GSM/GPRS modem to send data from my PIC board to server. I need to send .txt or .csv files. Is there any limit for file size for sending over GPRS? My circuit is a GPRM datalogger. It logs data from 6 sensors and when data is requested by sending SMS the SIM300 should send the file to ftp server or in any other way so that I can viwe the data as a webpage. There will be 6 such dataloggers and I also need to store data locally using SD card. When data (history) is requested then particular .txt or .csv file has to be sent so that it can be viewed as a webpage. Data is logged to SD card only if an even occurs. There will be also option to to send SMS and control some digital output ports. I use mikroC PRO PIC compiler.

Also provide AT command sequence for transfering files through SIM300 GPRS. Should I read the responses of modem during each step of the file transfer?
 

@Jayanth,

SIM300 doesnt have inbuilt FTP functionality. And also it is discontinued from SIMCOM for more than 2 years.

Alternate solution will be of using SIM900 or SIM900A which has FTP functionality.

And when you are trying to send the data as a file from PIC board, the PIC should support file system. i.e it would be easy if you RTOS for creating a file...(You can check this).

Because, the file should be ready with an extension of .txt or .csv before sending via FTP...

I am not sure whether you are using inbuilt memory or external memory for storing the datalogs.

You need to consider the memory based on what frequency you are reading the sensors as well as the data size as well..

If you are using normal embedded C language, then Instead of FTP, another alternate suggestion will be using the modem in TCPIP-CLIENT Mode...

Set an alarm or use RTC in such a manner that it will trigger once in every day, and you connect to the SERVER IP and once the TCP-IP pipe is established, send all the datas stored as logs to the server ip.

Create a front end tool to capture those datas and sort those datas and display as you need..
 
Ok. I will take your advice regarding using SIM900. The datalogger logs data to SD card and only if an event occurs like upper or lower limit of temperature is crossed. Data is not continously logged. So when an event occurs I have to send the sensor data and port status to webpage. It will be helpful if the AT command sequence used to establish GPRS communication and to send data is provided.

For front end app what software should I use to design like ASP.net, etc... I have no idea about web programming. I know a little bit about HTML 5.
 
Last edited:

@Jayanth,

Now i got a clear picture of what you are trying to do...

There are many things you have to consider and also the necessary actions to be taken...

1. SMS handling
2. PDP DEACT - In case of IP lose
3. GPRS activation handling --- if it fails then what to do next?
4. TCPIP connect and disconnect...
5. Are you using battery as backup?
6. In case of power failure how to manage and what to do during that time etc...

And first of all, you need to confirm in which way you have to boot your GSM module...

Whether you need to boot the GSM module in TCPIP SERVER OR CLIENT MODE.

1. SERVER MODE: (Consider this mode)
-Assign the listening port.
- After the GPRS attached to the network, you will get a local IP and the modem will be always in SERVER LISTENING.
-Whenever the event(sensor event) has occured, log the type of event and time of event occured in your SD Card.
- Design your own software may in VB6/VB.net(for standalone exe) or web programming.
- This front end software will be the CLIENT and you connect to the SERVER module, and get the datas.
- And close the connection.

Here the data is transferred only when there is connection initiated from the client to the server.

2. CLIENT MODE:
- Assign the local port of the module.
- GPRS attach to network, dial and get the local ip.
- Connect to the serverip as the module is in CLIENT MODE.
- If SERVER is down, you have to try for reconnecting to the SERVER.

So you have to make sure the SERVER is UP for 24x7x365...

The front end software cannot be server. And also rather PUSH always a POLL is much better.

And also you should take care of whether you are using VPN BASED IP OR DYNAMIC IP sim card. VPN will provide very secured transaction of data through TCPIP..Dynamic doesnt and each time the module loses the IP and redials(code has to be written for validating the module output and action to be taken) you will get a new IP.

And one more disadvantage of dynamic ip is that no matter your front end software is SERVER OR CLIENT, it has to know the new ip after redial. So you need to think way for intimating the new IP.

Check the above said things carefully...I will tell you the sequence to boot...for GPRS and TCPIP..
 
As I said earlier there will be 6 boards out of which 5 boards are dataloggers with SIM300 or SIM900. They are placed at different places like one in Bangalore, another in Hyderabad, etc... The boards have backup power during power failure. The data loggers send and logs data like Voltage of three phase system and temperature to webserver and I need to be able to see this data on a web page from the main location (PC is only at one place) Dataloggers (slaves) doesn't have PC connection. The master board which is connected to PC at main location is just for sending SMS. SMS data is sent to master board through USB and the micro and GSM connected to master board sends SMS to slaves (dataloggers). The slaves control some devices like if there is power failure then they will start the generator and on power restore the generator is turned off, etc...
 

@Jayanth,

Fine..Then you have to decide whether you want to PUSH or POLL for the data...

Then you can write the routine flow accordingly..

- - - Updated - - -

Pls follow the below AT Command sequence for TCPIP SERVER & CLIENT MODE....

For TCP IP SERVER MODE:

1. ATE0
2. AT+CMGF=1 //FOR SMS MESSAGE FORMAT
3. AT+CNMI=3,1,2,1,1 //TO INDICATE THE ARRIVAL OF SMS
4. AT+CIPMUX=0
5. AT+CIPMODE=1
6. AT+CIPCCFG=3,2,20,0
7. AT+CIPSHUT
8. AT+CIPSTATUS
9. AT+CSTT="apn","username","password"
10. AT+CIICR
11. AT+CLPORT="TCP","2007" //2007 IS THE LOCAL PORT..YOU CAN KEEP ANY VALUE
12. AT+CIFSR
13. AT+CIPSTATUS
14. AT+CIPSERVER=1,"2007"

After executing the command 14 the modem will be in SERVER LISTENING...

For CLIENT MODE:

1. ATE0
2. AT+CMGF=1 //FOR SMS MESSAGE FORMAT
3. AT+CNMI=3,1,2,1,1 //TO INDICATE THE ARRIVAL OF SMS
4. AT+CIPMUX=0
5. AT+CIPMODE=1
6. AT+CIPCCFG=3,2,20,1
7. AT+CIPSHUT
8. AT+CIPSTATUS
9. AT+CSTT="apn","username","password"
10. AT+CIICR
11. AT+CLPORT="TCP","2007" //2007 IS THE LOCAL PORT..YOU CAN KEEP ANY VALUE
12. AT+CIFSR
13. AT+CIPSTATUS
14. AT+CIPSTART="TCP","SERVERIP","SERVERPORT" //THIS IS THE COMMAND USED TO CONNECT TO THE SERVER IP...
 
These three are for SMS purpose. Right?

1. ATE0
2. AT+CMGF=1 //FOR SMS MESSAGE FORMAT
3. AT+CNMI=3,1,2,1,1 //TO INDICATE THE ARRIVAL OF SMS

3. AT+CNMI=3,1,2,1,1 //TO INDICATE THE ARRIVAL OF SMS

sets SIM900 so that if new message arrived it informs through UART. Does it also set any pin of SIM900 so that it can be used to detect arrival of new SMS like if SIM900's pin which goes high on arrival of new SMS can be connected to INT0 pin of PIC and if INT0 interrupt occurs then I can send AT+CMGR to read the message.


PUSH and POLL applies only to Front End Software? I need to see the data in a web browser like Google Chrome.
 

@Jayanth,

ATEO ---> To make echo mode off...Nothing to do with SMS...

Arrival of SMS can be detected in the UART interrupt itself...

AT+CNMI=3,1,2,1,1 is given, the uart interrupt will receive notification from the module..

Instead of using general UART, use the UART as interrupt..

Detecting the SMS using UART interrupt is better than Hardware interrupt...

PUSH & POLL applies to front end or even web browser...The only thing there is a backend program that will fetch the data from the end application even though the front end can be a software or web browser..

And i m not an expert in the web browser kind of applications...
 
@Jayanth,

There is no free webserver available currently to my knowledge.

You need to purchase the web hosting site by paying Rs 2000(app) per year and then you can use it.

Once the webhost space is purchased, you need to write your own application(based on JAVA,VB.net,PHP etc) to collect the data and display the same.
 

Sorry to interrupt in this thread, but can you please specify how to connect using a VPN sim card? I am confused as to what AT commands can be used to enter the VPN network, username, and password.
 

@Jayanth,

There is no free webserver available currently to my knowledge.

You need to purchase the web hosting site by paying Rs 2000(app) per year and then you can use it.

Once the webhost space is purchased, you need to write your own application(based on JAVA,VB.net,PHP etc) to collect the data and display the same.

Free web server may NOT be available; but free web hosting space is definitely available which can be used (I have used from orgfree.com).

I am using php (along with MySQL) codes to dynamically generate webpages containing data that have been received from GSM modem. The MCU (along with the GSM module) is currently sensing & uploading Ambient Light & Ambient Temperature Data to a free web hosting space (from orgfree.com). The webpage is capable of showing graphical as well as table data.

MCU Firmware Codes written in Assembly (although C can be used).
Server Backend codes written in pHp.
Server Backend data storage used MySQL.
Server Frontend codes written in javascript, html, css.
 

Hi Soumyajit

Can you zip and post below mentioned files?

Server Backend codes written in pHp.
Server Backend data storage used MySQL.
Server Frontend codes written in javascript, html, css.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top