Arduino Uno paired with GSM shield SIM900 (last one is "wear" on Arduino). RX/TX jumpers set to SW position. After starting devices, they setting up GPRS connection and send GET request to server. As a reply it's getting text values (1 or 0) and depending on them I need to switch on/off led lamp. Connection process is successful (I see it on web-server's logs). I need procedure for reading console and assigning to "ledcmd" received after AT+HTTPREAD reply. In manual mode after AT+HTTPREAD I see following:
+HTTPREAD:1
1
OK
I need procedure for reading console and assigning to "ledcmd" received after AT+HTTPREAD reply.
First step is to get the GSM modem off of the hardware serial pins. The Arduino is NOT reading the response from the modem. That response is being sent directly to the Serial Monitor application by the modem, because the modem is on the hardware serial pins.
PaulS:
First step is to get the GSM modem off of the hardware serial pins. The Arduino is NOT reading the response from the modem. That response is being sent directly to the Serial Monitor application by the modem, because the modem is on the hardware serial pins.
Thanks a lot for reply. What I need to do for that? Something physically or on code level? Could you please explain?
This tells us nothing, as we have no idea which shield you have. You should be able to set the jumpers to use two pins other than the hardware serial pins, and use an instance of the SoftwareSerial class to send data to, AND get data from, the shield.
PaulS:
Yes. Both.
This tells us nothing, as we have no idea which shield you have. You should be able to set the jumpers to use two pins other than the hardware serial pins, and use an instance of the SoftwareSerial class to send data to, AND get data from, the shield.
Unfortunately there are no more information about GSM shield. Just SIM900 and SimCom, and as I know it just main module's vendor. There are too many shields vendors based on SIM900. I only can share shield's photo. There are pins for select RX and TX mode between hardware and software. They are on SW position (visible on photo). So, I think my shield is "ready" to use other (software selected) pins for send/get data. As I understand, I need do something in my code. Besides this, as I told, communication with modem is established. I can send AT commands. For it I'm using SIM900.h library, which calling GSM.h/GSM.cpp and there is #defineGSM_TXPIN 2 and #defineGSM_RXPIN 3 lines. As I understand, on software level pins assigned to 2 and 3. Am I right?
In serialread() I'm reading my software serial ports.
In clearbuffer() I'm clearing buffer after each AT command except last one.
In loop beside of checking I'm showing mu buffer. It must contain only output for AT+HTTPREAD but in console I see something mixed with previous outputs and no anything from last one: