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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |