March 28, 2024, 11:12:32 AM

PIC-GSM

Started by ambo, December 21, 2012, 05:35:53 PM

Previous topic - Next topic

ambo

I just got the PIC GSM.  What do I need to modify so that when I first connect to the server, I would go to a login page for authentication before I get directed to the main page?

eagleeye

Hi
In CustomHttpApp.c

  ***************************************************************************/
#if defined(HTTP_USE_AUTHENTICATION)
BYTE HTTPNeedsAuth(BYTE* cFile)
{

// Just Add another line to this routine.
// then the default username and password applies
// Take care to note the "9" thats the number of characters to match


   if(memcmppgm2ram(cFile, (ROM void*)"index.htm", 9) == 0)
      return 0x00;      /

ambo

Hi,

Thank you so much  ... I am now able to control the two relays via the webpage that requires a username/password.

Now, how do I receive sms in order to turn on/off the relay.  I've read the manual and there is no mention that the demo software has capability to turn on/off the relays via sms.

what code should I add or which code in the source file should I modify so that I can receive sms and parse the data and change the states of the relay?

Thanks in advance.

Ambo

ambo

I'm really quite amazed by this product since this has been out for several years already ... no sample codes for receiving sms for remote control  :'(  Days of googling yielded only results of others trying to find the sample codes Like what I'm doing.

The gsm code is very criptic and not so useful few comments.  Heck I can't even seem to access the sim300d modem by creating a serial bridge from serial1 to serial2.  Whenever I try to incorporate my code or make changes to the main gsm code, portions of the ethernet code seems to stop working.  I can only conclude that it's not possible to receive remote sms control and ethernet at the same time, but thats only me speaking as I am only a hobbyist.

Sure hope someone out there can provide a sample working code ... or just even a hex file with working sms remote controls to give me hope that its possible to code the remote sms commands.


LubOlimex

Hey Ambo,

Please check the "Read Me!.txt" for detailed explanation of the demo program (https://www.olimex.com/Products/PIC/Development/PIC-GSM/resources/PIC_GSM_5_42stack.zip). Unfortunately, our software development capacity is limited and in most of the cases it is impossible to cover each possible scenario of demo program for our multi-purpose boards.

You may also find helpful the examples for MOD-GSM since it has some receive SMS examples and routines that work with PIC32 boards, has almost the same GSM chip. For instance: https://www.olimex.com/Products/Duino/PIC32/_resources/PINGUINO_MODGSM_send_receive_sms_example.zip

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

eagleeye

#5
Quote from: ambo on January 01, 2013, 04:30:58 PM
Hi,

Thank you so much  ... I am now able to control the two relays via the webpage that requires a username/password.

Now, how do I receive sms in order to turn on/off the relay.  I've read the manual and there is no mention that the demo software has capability to turn on/off the relays via sms.

what code should I add or which code in the source file should I modify so that I can receive sms and parse the data and change the states of the relay?

Thanks in advance.

Ambo


You would have to look at the GSM ISR routine to see if you can check for the length of the buffer
in the routine. Once the buffer has reached a certain number, then you need to scan the buffer to
look for your special command (via SMS) that you have sent to the controller.

I think for you, its best to get an ICD3/pickit3  and MPLABX so that you can do source level debugging
and then you can inspect the buffers for your sms. This way you can understand very fast.

MPLAB IDE does not allow you to inspect some structures, so MPLABX is the best choice for learning fast