GPRS V2.0 seeed sim900 shield
sim900
OK so brought a sim900 from seeedstudio(http://www.seeedstudio.com/depot/gprs-shield-v20-p-1379.html?cPath=132_134) now to get it to work. Downloaded the leonardo code(searched for it first in wiki, it here and it wasn't that clear, http://www.seeedstudio.com/wiki/Talk:GPRS_Shield_V2.0) and changed the default pin settings on board to use pin0 and 1 which was a bit counter intuitive, i.e. stunts here around the other way than I initially thought.
Here is the code for leonardo code(I've added a bit from the initial to wait until serial is connected:
OK so brought a sim900 from seeedstudio(http://www.seeedstudio.com/depot/gprs-shield-v20-p-1379.html?cPath=132_134) now to get it to work. Downloaded the leonardo code(searched for it first in wiki, it here and it wasn't that clear, http://www.seeedstudio.com/wiki/Talk:GPRS_Shield_V2.0) and changed the default pin settings on board to use pin0 and 1 which was a bit counter intuitive, i.e. stunts here around the other way than I initially thought.
Here is the code for leonardo code(I've added a bit from the initial to wait until serial is connected:
gsmv2seeedtest20131230v01.ino | |
File Size: | 1 kb |
File Type: | ino |
Now connecting to a UNO
use pins 7, 8 to softserial connect.
Sim to Use in New Zealand
- Telecom sim didn't work with default settings
- 2degree did. No issue with default setting there :)
- vodafone - will try this shortly
Background Information
wiki page - http://www.seeedstudio.com/wiki/GPRS_Shield_V2.0
forum - http://www.seeedstudio.com/forum/
http://garden.seeedstudio.com/images/a/a8/SIM900_AT_Command_Manual_V1.03.pdf
sim900 - clock
I want the sculpture to know the time.
AT+CLTS gives the network time but only if its available and its not here in New Zealand and on vodafone nextwork :(
This document , http://www.terraelectronica.ru/pdf/SIMCOM/SIM900.pdf, 2.1.5 RTC backup design, says there is a RTC (real time clock) in the sim900 and it looks like the shield has a battery cr1220, and this document states that "The RTC current consumption is about 2uA when the VBAT is removed." so I'll need to check the schema but it look and check. Battery cr1220 is rated at about 40mAh, so when there is not external supply the battery will last for 2 1/3 years. So need to check but without power we have a long time to wait. AP - check schema.
So to update the time I used :
AT+CCLK= “YY/MM/DD,HH:MM:SS+12
AT+CCLK?
Conclusion
time set, shouldn't have to think about this for a while.
Potential issue, daylight savings. Darn network time would be much better. I'd like it to be fully independant.
AP - check schema.
AP - still want to figure out if I have daylight savings or not. Does RTC do this? not a big deal really but...
idea - I think a text message should have a time stamp on it. This could give me accurate enough time, but at 90 cents a text I don't want to do this each day. But if I had unlimited txt messages then it wouldn't be an issue. Or if BAL in vodafone is free then I could just use this each day, that would work and be cheap :). It might only be able to tell if we jump forward or backwards 1 hours but that is good enough, don't think that I can rely on the response being really quick although its not going to make much difference. Need to give this some more thought.
2Degrees- whats my balance
Another thing that I need to consider is the balance of the phone, best to get this via text then I can figure out if its an issue or not.
ok so there are a few ways of doing it, I'd like to get a txt response but it looks like the closest is dialing "*100#1#" which gives a serive reply. Now to find out how to see this in the sim900.
I tried sending "*100#1#" as sms but this didn't work. Normal phone was saying that it was "requesting"
tried ATD "*100#1#"; - note the semi colon ATH - hangs up. Still didn't work.
note vodafone has txt service to tell the time "FreeTXT BAL to 777". Might be easier than 2Degrees.
sim900- How to check txt messages
AT+CMGL="ALL",1 - shows all the text messages
then you can read them
sim900 At Commands and Arduino
why reinvent the wheel, or is it easier to do.
sim900 and ftp
ok so the initial manuals from seeed didn't relate to this but looks like it can be done. http://www.cooking-hacks.com/documentation/tutorials/arduino-gprs-gsm-quadband-sim900, and putting in AT+FTPCID? doesn't give an error. Very cool. And it has example with up and downloading. Another day I'll look into this. Don't need it at the moment.
sim900 - Library
A little bit of research and I found this very cool shield GPRSBee which uses the sim900, it looks pretty cool and connects to a very cool shield, http://www.sodaq.net/ . But the other great thing is that is has a library which I should be able to use :) https://github.com/SodaqMoja/GPRSbee. OK this library looks pretty good haven't got my head around it but don't need this complicated, all I'm needing is txt message communicationat this stage (other stuff looks real interesting but another day).
another library - http://code.google.com/p/gsm-shield-arduino/, which is for the sim900 and sim908
BETA_GSM_GPRS_GPS_IDE100_v305 looks to be better, just testing it out now. ok didn't work looked promising. Need to write the simple version code this stuff is way to complicated. All i want to do is switch it on, send and receive sms and find the time an
Sim900 - Storing Numbers
storing and retreiving information would be good.
1) First select the store medium that you want to look at, AT+CPBS=?, give the list of supported storage,
2) select the sim storage, AT+CPBS="SM"
3) read current phonebook entries AT+CPBR=1, 100, interesting 2Degrees has some numbers there already 1 to 7 is used.
4) write a number AT+CPBW=8, "+642102942421", 145, "paul"
5) find entry AT+CPBF="paul"
notes
1) max length of number is 40 max length of text for number is 20, numbers 1-250, refer AT+CPBR=?
Sleep Mode
AT+CSCLK is where you see details on sleep mode.
default is that will not enter sleep mode, value 0
2 will automatically go to sleep and wake up.
Q - I wonder what the disadvantage of this is? slow to repond?
hardware spec is interesting but not sure about version
http://mt-system.ru/sites/default/files/documents/sim900-ds_hardware_design_v1.00.pdf
Buffer size 64!
the serial read buffer size is 64 char, this creates some problems when reading the response to from sim900.
One solution to this is http://www.hobbytronics.co.uk/arduino-serial-buffer-size,
other sim900 notes
Tutorial – Arduino and SIM900 GSM Modules - http://tronixstuff.com/2013/09/18/tutorial-arduino-sim900-gsm-modules/
tutorial on sim900 and someone shield - http://www.cooking-hacks.com/documentation/tutorials/arduino-gprs-gsm-quadband-sim900
Looks like a nice tutorial with ftp and tcp stuff and gprs also.
http://www.cooking-hacks.com/forum/viewtopic.php?f=20&t=3596
ok this link looks interesting but not really what I need at the moment.
ok so just replaced with 2degree sim and all worked fine.
http://www.2degreesmobile.co.nz/star100hash - to find the
tutorials
http://tronixstuff.com/2014/01/08/tutorial-arduino-and-sim900-gsm-modules/
http://www.gsmlib.org/
http://stackoverflow.com/questions/19464729/does-anyone-know-how-to-triangulate-location-using-arduino-and-sim900
http://stackoverflow.com/questions/19937415/using-softwareserial-as-a-private-member-variable
Action Points
1) write simple library to send and receive txt messages. Some thing like, sendTxt (number, string), isThereAReceivedTxtMessage:Boolean, deleteNextTxtMessage(), readNextTxtMessageStr(), readNextTxtMessageNumber(), readNextTxtMessageTime(), countTxtMessages(), setup(). Library called something like sim900TxtSimple. Advanced options would be, storeNumber(number, name), getNumberByStr(name):String, getCountOfNumbersWithStr(name), getNumberWithStrBySearchIndex(name, index) - used if there are multiple search results. deleteNumber(name), getTime(), getDate()
2) how do I make it go into sleep mode. add to library sleepMode(onOff:boolean)
3) check schema about batter and if it is used for anything else.