Go Down

Topic: SIM900-GPRS-GSM-Development-Board to mega 2560 (Read 939 times) previous topic - next topic

fredguthrie


I'm confused I have looked and seen many conflicting items on how to hook this up to the mega 2560
I have a link to what SIM900-GPRS-GSM I got off e-bay so you can see


Code: [Select]
https://www.ebay.com/itm/SIM900-850-900-1800-1900-MHz-GPRS-GSM-Development-Board-Module-Kit-For-Arduino/382219534631?hash=item58fe0f4127:g:OcQAAOSwFdJZrpl9

1)can I just drop it onto the top of the mega, some say yes others say no due to pins 10 and 11,
2) can you give me a good resource so i can configure my 2 devises correctly then start testing and coding?

srnet

Its clearly marked as a shield for a UNO.

Anything that needs hardware SPI is not going to work.

What did the vendor say when you asked them ?
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

fredguthrie

when I started this project 3 months ago and I paid for all the parts I needed I was using a UNO.
it ran out of resources once I added the other sensors to it so i was forced to move to the mega and work with what I have.
i have everything hooked up and running this is the last module.

now back to your comment. (and thank you for your help)
Are you saying this will not work with the mega as a standalone module, or that it will not work using it as a shield?

if it will not work can you point me to a GPRS that will?

I need cell phone SMS and e-mail/ file transfer capabilities.
this will send and receive SMS instructions

srnet

I did say;

"Anything that needs hardware SPI is not going to work"

So does anything your using need hardware SPI ?

You have not revealed the code you were using, what these 'other sensors' were or what the 'everything' you had working was.

Might be an idea to give a description of the project, what you have connected, the code etc, all the normal useful information.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Nick_Pyner

#4
Jun 27, 2018, 06:37 pm Last Edit: Jun 27, 2018, 06:42 pm by Nick_Pyner
others say no due to pins 10 and 11,
It sounds rather like some nonsense about conflict with software serial. Why would you use software serial on a Mega anyway?  You might look at removing the serial select jumpers and running new jumper wires from the centre pins to pins 18,19 on Mega thereby using GPRS on serial1. If you are using a Mega proto shield, you can probably use that to access the serial1 pins. If you have any shields using SPI, all you need do is plug them into Mega first, as there is no SPI passthrough on the GPRS shield.

fredguthrie

#5
Jun 28, 2018, 12:09 am Last Edit: Jun 28, 2018, 12:15 am by fredguthrie
Quote
You have not revealed the code you were using, what these 'other sensors' were or what the 'everything' you had working was.

Might be an idea to give a description of the project, what you have connected, the code etc, all the normal useful information
I did not include all that stuff trying not to muddy the waters on a question with a large amount of data, so we don't go down a bunch of rabbit trails.
the original question was on finding a knowledge resource on how to connect my Sim900 to the Arduino Mega and the conflicting data I found.  I didn't want to take up a large part of anyone's time



Nick_Pyner

#6
Jun 28, 2018, 02:01 am Last Edit: Jun 28, 2018, 04:18 am by Nick_Pyner
If you properly described the project, there would be fewer rabbit trails and you would likely to have gotten it all in reply#1. In the long run, you are less likely to encounter problems using that shield on a Mega than you would with a Uno. As things are, there are two things that are still unclear:
1. Is the problem solved
2. was there a problem in the first place

fredguthrie

#7
Jun 28, 2018, 04:35 am Last Edit: Jun 28, 2018, 06:08 am by fredguthrie
Quote
1. Is the problem solved?
2. was there a problem in the first place?
answers
1) I have not worked on hooking the 2 devices up yet as I'm doing this in my free time and did not have time yet.
2) yes their was/is an issue. I did not post just to waste time.

you asked for it here it comes.
I am working on a project to measure the distance and calculate the value inside a container then map it out using Lidar.
the unit will give the status of the container and other data the user asked for,(GPS, temp, altitude).
it will then write the data to SD card.
the device needs to communicate using SMS so the user can send it a query and get responses.

sensors
Adafruit_BMP085
Adafruit_GPS
Lidarlite v3

other items
SD card holder
2 servos

cards
Arduino Mega 2560
SIM900-GPRS-GSM-Development-Board

everything is talking at this time short of the SIM900-GPRS-GSM-Development-Board
I am still working on it. it is the last item before I code the last part.

the code is at this time just making sure the items are running and communicating.
please, don't read anything functionality into the code as I have not fleshed everything out.
 I just wanted everything to hook up and talk with the mega.

Here is the code that is working at this time without the code for the SIM900-GPRS-GSM-Development-Board

OK, I'll post the code in the next post. I ran into the 9k limit for the post

fredguthrie

still getting the 9k limit. will try to attach the code

Nick_Pyner

without the code for the SIM900
Since the problem is likely to be with the code for the SIM900, I'm not sure why you bothered posting this stuff but, since you have, I would note that trying to print to monitor before you open the serial port is probably not such a good idea.

fredguthrie




Code: [Select]
If you properly described the project, there would be fewer rabbit trails and you would likely to have gotten it all in reply#1. In the long run, you are less likely to encounter problems using that shield on a Mega than you would with an Uno. As things are, there are two things that are still unclear:
1. Is the problem solved
2. was there a problem in the first place

 and so you got all the information you asked for.
at this time I am trying to get a response from the Sim900 bard.
here was the test code that I was told to use.
once more it was only to test that the sim900 was communicating.
Code: [Select]
///./////////Arduino 1.0 code//////////////////

#include <SoftwareSerial.h>     //please put less than and greater than sign respectively in place of  =

SoftwareSerial SIM900(10, 11); // (RX, TX). please zoom image above to see exactly what is going where.

void setup()
{
  SIM900.begin(19200);               // the SIM900 baud rate   
  Serial.begin(19200); 
}

void loop()
{
  if (SIM900.available())              // if date is comming from softwareserial port ==> data is comming from gprs shield
  Serial.write(SIM900.read());
  if (Serial.available())                // if data is available on hardwareserial port ==> data is comming from PC or notebook
  SIM900.write(Serial.read());
}


 this is why I am confused as I cant find a resource that walks me through the setup of the board to mega. and why I asked for clarification and a good resource I can read to help me understand. this is my 1st time using Arduino. I didn't even know Arduino existed until I started to research how to accomplish this prototype

this code uses software controls and I know you told me to use hardware. but I have not worked on this yet short of I did move the jumpers on the board to hardware.


Nick_Pyner

#11
Jun 28, 2018, 10:00 am Last Edit: Jun 28, 2018, 05:30 pm by Nick_Pyner
Well then

fredguthrie

1) I never insisted on any place in this post we use software or hardware control. your the one that keeps coming back to it, I clearly stated we would use hardware as you suggested.
2) nothing wrong with the use of hardware.
3) the only reason software in the post is that the resources I did fine on how to hook this up were to UNO. and is one of the reasons why I started this post
Code: [Select]

I'm confused I have looked and seen many conflicting items on how to hook this up to the mega 2560
I have a link to what SIM900-GPRS-GSM I got off e-bay so you can see

Code: [Select]
1)can I just drop it onto the top of the mega, some say yes others say no due to pins 10 and 11,
2) can you give me a good resource so i can configure my 2 devises correctly then start testing and coding?


at this time I'm not sure why you post at all short of running up your number of posts.
so please, if you are not going to suggest a resource for me to read, or an item to move the post forward. I'm sure you have better posts to write in other places.

fredguthrie

HI I got it working
I took the sim900 set the jumpers to hardware as shown in my post.
the top 2 pins that are by the jumpers are the TX and RX if you flip the board over they are marked.
I setup serial 1 on the mega //Serial1 on pins 19 (RX) and 18 (TX),
the mega
pin 19 to pin 0 on the sim900
pin 18 to pin 1 on the sim900
I am using the power plug to power the sim900 but you can power it from the mega if you want.
when you power the sim900 on two LEDs will stay lit and one LED will blink every sec until you establish a connection with your phone service. once the connection is made it will slow to blinking every 3 sec.

I then ran my code and it made a phone call to the number I set up in the variable PHONE_NUMBER

 my test code is posted below
Code: [Select]
/*
GPRS Call Up

This sketch is used to test seeeduino GPRS_Shield's callUp function.
to make it work, you should insert SIM card to Seeeduino GPRS
and replace the phoneNumber,enjoy it!

create on 2015/05/14, version: 1.0
by lawliet.zou(lawliet.zou@gmail.com)
*/
#include <GPRS_Shield_Arduino.h>
//#include <SoftwareSerial.h>
#include <Wire.h>

#define BAUDRATE  9600
#define PHONE_NUMBER  "9999999999"
//Serial1 on pins 19 (RX) and 18 (TX),
GPRS gprs(&Serial1,BAUDRATE); //Create the GPS Object

void setup() {
  gprs.checkPowerUp();
  Serial.begin(9600);
  while(!gprs.init()) {
      delay(1000);
      Serial.println("Initialization failed!");
  } 

  while(!gprs.isNetworkRegistered())
  {
    delay(1000);
    Serial.println("Network has not registered yet!");
  }

  Serial.println("gprs initialize done");
  Serial.println("start to call ...");
  gprs.callUp(PHONE_NUMBER);
}

void loop() {
  //nothing to do
}


the output is shown below
Code: [Select]
11111
22222
33333
44444
gprs initialize done
start to call ...

Go Up