GPRS sim800

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello.

I use sim800 to send data to webpage but update (data transfer) takes too long, is there faster ways to send data, or faster hardware

instead of sim800, Below is used (pseudo)code and command execution times.

wait_for_sim_ready();

// set connection
send_at("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"\r\n"));
wait_for_response();
send_at("AT+SAPBR=3,1,\"APN\",\"internetd\"\r\n"));
wait_for_response();
send_at("AT+SAPBR=1,1\r\n"));
wait_for_response();

while(1)
{
	read_data_from_sensor();
	send_at("AT+HTTPINIT\r\n"));
	wait_for_response();
	send_at("AT+HTTPPARA=\"URL\",\"www.webpage.com/receive_data.php?data_to_send=<data_from_sensor>\"\r\n")); // data about 160 bytes long
	wait_for_response();		// about 2 sec
	send_at("AT+HTTPACTION=1\r\n"));
	wait_for_response();		// about 5 sec
	send_at("AT+HTTPTERM\r\n"));
	wait_for_response();		// about 1 sec
}

Ana

 

Last Edited: Thu. Feb 9, 2017 - 09:08 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ana57 wrote:
takes too long

That's a pretty meaningless statement!

 

So how long does it take?

 

How long do you want it to take?

 

Have you done the sums to see if your expectation/requirement is reasonable?

 

Have you done comparative measurements with other equipment?

 

Rather that just dump a load of source code, explain what methods you're using to transfer the data - and what performance you expect that to give.

 

is there faster ways

Fater than what, exactly?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
So how long does it take?
Well I read:

send_at("AT+HTTPPARA=\"URL\",\"www.webpage.com/receive_data.php?data_to_send=<data_from_sensor>\"\r\n")); // data about 160 bytes long
	wait_for_response();		// about 2 sec
send_at("AT+HTTPACTION=1\r\n"));
	wait_for_response();		// about 5 sec

etc.

 

But as someone who simply is a user of GPRS (because Vodafone cannot seem to rustle up 3G or 4G in my back garden!) surely this kind of performance is "normal". Trying to read avrfreaks.net using a mobile in my shed is as painful an experience as documented here. The real solution is to trade up to a higher speed data network from GPRS!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like the OP is opening & closing a connection for each 160-byte transmission - which is going to be grossly inefficient.

 

Especially using HTTP!

 

Why not batch them up ... ?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried to send 6 samples at one message, it took about 12 sec instead of 5, so can anyone suggest faster hardware.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

More to the point what radio coverage are you in range of? Does the GSM only offer GPRS or are higher data transports (EDGE, 4G etc) available to you?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ana57 wrote:
I tried to send 6 samples at one message

So what, exactly, did you try?

 

What does your "one message" look like?

 

it took about 12 sec

Again, what, exactly, took 12s ?

 

That doesn't sound at all unreasonable for GPRS setting up a channel, doing some HTTP, and closing the channel.

 

instead of 5

Where does 5 come from?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ana57 wrote:
... send data to webpage but update (data transfer) takes too long, is there faster ways to send data, ...
The handshaking of TCP has some latency plus HTTP itself.

Alternatives :

  • websockets
  • Google protocol buffers on TCP
  • SMS gateway (evaluate pricing)
  • UDP (some thought for dropped packets)

 


websocket.org - Powered by Kaazing

https://www.websocket.org/about.html

...

 

Low Latency

...

HTML5 Rocks

Introducing WebSockets: Bringing Sockets to the Web

by Malte Ubl and Eiji Kitamura

October 20th, 2010

https://www.html5rocks.com/en/tutorials/websockets/basics/

An alternative for the cellular modem is to move it from a MCU to an MPU with the MCU attached to the MPU via USB, UART, etc :

GitHub - chilipeppr/serial-port-json-server

https://github.com/chilipeppr/serial-port-json-server

Serial Port JSON Server is a websocket server for your serial devices. It compiles to a binary for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.

http://www.avrfreaks.net/forum/low-cost-wifi#comment-1324686 (Google protobuf)

Definition from Techopedia

What are GPRS Tunneling Protocols (GTP)?

https://www.techopedia.com/definition/24978/gprs-tunneling-protocols-gtp

...

Version 0 can be used with TCP and UDP, while version 1 can be used with UDP only.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
The handshaking of TCP has some latency plus HTTP itself.

Indeed - especially so over GPRS!

 

surprise

 

That's why I say that sending such small amounts of data at a time is bound to be slow!

 

An alternative for the cellular modem is to move it from a MCU to an MPU

I very much doubt that would help - it is unlikely to be the local processor or comms speed that's the bottleneck.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take the AVR out of the loop and just use a mobile phone. Try surfing on GPRS, EDGE, UMTS, HSPA, LTE and any other 2G, 3G, 4G links you can think of. You will find GPRS is always an abysmal experience.

 

Simcom have other modules above GPRS for faster data links...

 

http://www.simcom.eu/index.php?m...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Web socket looks promising, any idea how to send/receive messages (sim800), if I understood right it is not only TCP/IP socket to port 80.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ana57 wrote:
any idea how to send/receive messages (sim800)
Relative to a SIM800, I do not know.

ana57 wrote:
if I understood right it is not only TCP/IP socket to port 80.
Maybe libwebsockets or noPoll

https://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations

though it's not apparent where to hook into a cellular modem.

 

Python packages are not listed at WebSocket implementations :

homepage

Python Package Index

websockets 3.2

https://pypi.python.org/pypi/websockets

An implementation of the WebSocket Protocol (RFC 6455)

websockets is a library for developing WebSocket servers and clients in Python. It implements RFC 6455 with a focus on correctness and simplicity.

...

More RFC 6455 on Python :

https://pypi.python.org/pypi/asyncws/0.1

https://pypi.python.org/pypi/wspy/0.9.1

https://pypi.python.org/pypi/wswrapper/0.0.0

 

Edit : Python

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Mon. Feb 13, 2017 - 06:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ana57 wrote:
Web socket looks promising, any idea how to send/receive messages (sim800)

That, obviously is a question for the SIM800 documentation - and/or SIMCOM support.

 

The SIM800 documentation (and/or SIMCOM support) will tell you if the unit has any specific support for websockets.

 

If there is no specific support, then you'll just have to treat it as "raw" TCP/IP

 

You will, of course, also require Websocket support on the server ...

 

https://en.wikipedia.org/wiki/We...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An obvious place to start would be: http://www.lmgtfy.com?q=arduino+...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Simcom have other modules above GPRS for faster data links...
Pycom is adding LTE-M to their line-up of ESP32 MicroPython modules :

Pycom

Meet GPy - our latest board

Dec 24, 2016

https://www.pycom.io/meet-the-gpy/

...

... a nano SIM card reader ...

...

... LTE Cat M1 ...

... LTE Cat M2 ...

...

Pycom

Pycom’s view of LTE-M around the World

Nov 29, 2016

https://www.pycom.io/pycom-and-canonical-to-enable-lpwan-communications-via-snaps/

...

"This [LTE-M] allows battery lifetime as long as 10 years or more for a wide range of use cases, ..." - GSMA

"... LTE-M networks will co-exist with 2G, 3G, and 4G mobile networks ..." - GSMA

...

4 LTE categories by data speed least to most : Cat NB1, Cat M1, Cat1, Cat4

...

Here’s what we think we know about LTE-M roll out.

...

Vodafone, Europe, Q1 2017 first are Ireland, Netherlands, Spain

EE/Orange, Central Europe, close 2017

Deutsche Telecom, Central Europe

...


http://www.gsma.com/aboutus/ 

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
LTE-M

But LTE-M is not about high-speed; the speed is comparable to GPRS.

 

As noted earlier, I suspect that the OP's "problem" is not with speed as such, but with the latencies of the network - and a poorly optimised strategy for handling it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pycom LTE-M breadboard and OEM modules are a new (near) arrival at Mouser :

http://www.mouser.com/new/pycom/pycom-boards-shields-oem/

Also new are the 1km (est) Wi-Fi and multi-km LoRa modules.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
 LoRa modules.

and LoRa is slower than a slow thing on a slow day!

 

That's the price you pay for long range at low power.

 

There is no such thing as a free lunch.

 

EDIT

 

remembering that the specific request of the OP is:

is there faster ways to send data, or faster hardware

 

 

Last Edited: Tue. Oct 3, 2017 - 07:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems to come back to:  Good/Cheap/Fast  pick any two, can't have all three.

 

Cheap/Good <not> fast!

Good/Fast <not> cheap!

Cheap/Fast <not> Good!!!

 

Jim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Except here the tradeoff is between power consumption, speed, and range.