Arduino Protocol

cuantic7 years ago

I have a SIM808 with arduino with the SSCOM32 command commands AT the SIM I use this protocol .. I want to help me find how to send the data correctly ,,, thanks

AT COMMANDS

AT+CIICR

OK
AT+CIFSR

101.181.85.14
at+cipstart=”TCP”,”181.x.x.x”,”5055″

OK

CONNECT OK
at+cipsend

> http://181.x.x.x:5055/?id=865067023395794&lat=-25.278402&lon=-57.501012&timestamp=20170221144438&hdop=1.4&altitude=124.700&speed=0.74

SEND OK

CLOSED

THE LOG

2017-02-27 15:26:03 DEBUG: [9D8A656A: 5055 < 181.124.147.150] HEX: decoded MESSage (the ip of server)
2017-02-27 15:26:03 WARN: [9D8A656A] error – empty text – IllegalArgumentException (…)
2017-02-27 15:26:03 INFO: [9D8A656A] disconnected
Anton Tananaev7 years ago
cuantic7 years ago

If I understand why it is so

OsmAnd Live Tracking web address format:

http://demo.traccar.org:5055/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5}

But rather asked if someone could already join the SIM808 with the server of traccar? And for tests with AT commands how do I use them?

Anton Tananaev7 years ago

That's a format for URL (address). It is based on HTTP protocol, as I said.

Jairo Congo7 years ago

cuantic...Can you tell me if is possible to use Arduino with traccar server to see in real time the position of a car for example.

guanch7 years ago

Is it possible via Osmand to transfer the values of arbitrary sensors from the device and send arbitrary commands to the device? For example, to manage a smart house?
Maybe there are other similar http protocols that are supported by the Traccar?

Anton Tananaev7 years ago

You can include any arbitrary parameters in OsmAnd protocol.

guanch7 years ago

Thnx! Where to read more about these arbitrary parameters?

Anton Tananaev7 years ago

Probably in HTTP protocol specification. It's not something special unique to Traccar. It's standard HTTP request parameters.

guanch7 years ago

That is, I myself can modify this protocol?
OK I'll try to understand how to do this.

darreno7 years ago

You could do something the code below from the Arduino to the SIM808;

This should give you a start, it's not real code but just the format.

The OSMAND protocol is created by the con.prints below

#include "SIM808.h"

#define APN "connect"
#define con Serial
static const char* url = "http://demo.traccar.org:5055;

CGPRS_SIM808 gprs;

void setup()

{
  con.begin(9600);
  while (!con);

  for (;;) {
    con.print("Resetting...");
    while (!gprs.init());
    con.println("OK");
    
    con.print("Setting up network...");
    byte ret = gprs.setup(APN);
    if (ret == 0)
      break;
    con.print("Error code:");
    con.println(ret);
  }
  con.println("OK");

  for (;;) {
    if (gprs.httpInit()) break;
    con.println(gprs.buffer);
    gprs.httpUninit();
    delay(1000);
  }
}

void loop()
{
  gprs.httpConnect(url);
  while (gprs.httpIsConnected() == 0) {
    // can do something here while waiting
  }
  if (gprs.httpState == HTTP_ERROR) {
    con.println("Connect error");
    return; 
  }
  con.println();
  gprs.httpRead();
  int ret;
  while ((ret = gprs.httpIsRead()) == 0) {
    // can do something here while waiting
  }
  if (gprs.httpState == HTTP_ERROR) {
    con.println("Read error");
    return; 
  }

  // now we have received payload
  con.print("[Payload]");
  con.println(gprs.buffer);

  // Send OSMAND data
  GSM_LOCATION loc;
  if (gprs.getLocation(&loc)) {
    con.print("ID:);
    con.print("LAT:");
    con.print(loc.lat, 6);
    con.print(" LON:");
    con.print(loc.lon, 6);
    con.print(" TIME:");
    con.print(loc.hour);
    con.print(':');
    con.print(loc.minute);
    con.print(':');
    con.println(loc.second);
    con.print(hadop:);
    etc, etc
  }
}
beryindo7 years ago

darreno, whether it can be used for sim800L ?

treblig7 years ago

@beryindo: there is no GPS in the SIM800L so where would you get the location ?

Phil Foulkes7 years ago

Has anyone got some working code for the SIM808?

I am not a programmer or a coder. I have tried and failed so I am sticking to building thing. As anyone got a SIM808 to work in the Traccar server if so how you done it and is the code and diagrams available.

I am a volunteer with the British Red Cross and there are a few of us who are independently testing Traccar to see how useful and reliable it would be operationally. I also volunteer for an couple of other charitable organizations where being able to track assets such as people an vehicles would be an advantage. The big issue is cost. The Red Cross have trackers in their ambulances and other support vehicles but nothing that can the put on the dashboard of a hire vehicle that may be used on a event to move supplies around. Some of our radios have gps tracking but not enough terminals to track them on.

Personally I have been using the ios and Android client during my tests. I have bought two of the tk103 trackers from ebay and one works and one doesn't. Being able to build my own hardware tracker will solve a lot of issues especially around quality and cost.

So I suppose I am begging anyone who is gifted with the ability to code if they would be willing to help? there are a couple of things i would like on the wish list but they are simple things.

Thanks in advance,

Phil

darreno7 years ago

Hi Phil,

I would like to help you and the Red Cross.

I am ex-military combat systems engineer and would love to volunteer towards your cause.

The Red Cross is near and dear to my heart, I thank you and your comrades for your volunteer service.

I currently help charity organizations like the Royal Canadian Legion, Fire and Rescue with GPS tracking.

We have tested and recommended trackers called the Oyster and Remora.

Anton has ported the protocols in Traccar and they work, we have the ability to program the Oyster and Remora to send it's data
to a Traccar server too.

Here is the mapping of Oysters and Remoras using a commercial mapping platform.

https://canada.telematics.guru

Username: traccaruser@traccar.com

Password: traccaruser2017!

I am in Toronto, but we can get a SIM808 and "get it working".

I too have struggled with the SIM808 but as coincidence has it, a member of our Internet of Things - Toronto group has extensive coding experience with the SIM808. We too want to use Traccar for volunteer organizations.

How can we collaborate??

Darren