The file just described is combined with an equally important one, “Io_GSM.h”, which contains the declarations for the shield hardware configuration, plus the possibility to enable/disable the various state machines or the additional debug code. Finally, we have defined a series of error codes that may return from the GSM module, namely the CME and CMS error codes.Īt the end of all the directives described, we find the declarations of the variables used and their functions, whether they are public or private. The ASCII character codes and STEP codes of the state machines used to send AT commands during both initialization and full operation are also defined. Under the stored AT commands, there is a series of directives that identify the constants used in the management of the relative AT commands. In fact, if we had used the approach of defining a string for each AT command to send, we would not have had enough SRAM memory to develop the library and its sketches. The AT commands used in the library are always stored in flash so as not to occupy SRAM memory unnecessarily. Looking at the associated file “GenericCmd_GSM.h” (which can be opened with a text editor like Notepad++) we find in the head a series of constants, all stored in FLASH through the “PROGMEM” directive, which identify a series of AT commands used both for initialization of the GSM module and for common use within a sketch. The current Arduino IDE, unfortunately, does not allow EEPROM programming during the project compilation. are stored in the Arduino EEPROM, therefore, considering how an Arduino system is structured, it will take a special sketch to load the data into the EEPROM. Special functions have also been developed to activate the process of GSM module initialization (module power on, and sending AT configuration commands) which is fully automated, including the request for the PIN code (if required) and sending it to the GSM module. Once all files have been copied, the library must be initialized by the user depending on the hardware used and the GSM module selected. To use it you must copy all the files that can be downloaded from the site /open-electronics/GSM_Library_Arduino in the folder “C:\Program Files (x86)\Arduino\libraries/GSM2”. Currently, some common AT commands have been selected and implemented in the library. This is made possible by a series of state machines that take charge of both the sending of the AT command and the management of the response by the module. The library is designed for sending an AT command through a special function and waiting for the response from the GSM module. DTE (Data Terminal Equipment), a term equivalent to the application that runs on an embedded system and is responsible for the GSM module management.The devices that control the GSM modules, by sending appropriate AT commands, can be: To better understand some of the terms used below, you should remember that GSM modules can be defined as: In the future, the management part of the GPS system will also be developed. For all the modules only the SMS and voice call management functions are currently supported, while the GPRS management functions for Internet connection and data sending/receiving are under development. We want to remind you that the SIM928A provides for the management of two serial numbers. The modules currently supported by the library are: With a series of directives, it is possible to activate/deactivate parts of the code as well as select the desired Arduino board and the corresponding GSM module to be associated. The main file is GenericCmd_GSM.cpp and contains the infrastructure code that keeps the functions in the other library files interconnected. The library is composed of the main file plus the secondary files containing the code necessary to manage a series of functions that send AT commands to the GSM module installed in the shield. In the previous episode, we introduced the shield hardware and exposed the technical features and possible applications, as well as mentioned the library for Arduino, here we complete the previous speech explaining in detail its operation, which supports the boards Arduino Uno, Arduino Mega 2560, Fishino Uno and Fishino Mega 2560. Let’s discover a useful library to manage various low-cost GSM/GPRS modules, in order to provide cellular connectivity to our Arduino projects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |