MX029 - GSM Remote Control

Forum to discuss articles which have been published in Matrix Multimedia's article zone. If you have any comments or questions regarding the articles please post them here.

Moderators: Benj, Mods

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

MX029 - GSM Remote Control

Postby JohnCrow » Sun Aug 07, 2011 2:23 pm

Article: http://www.matrixmultimedia.com/article.php?a=504

If you have any questions or comments on the article, please post them below.
These users thanked the author JohnCrow for the post (total 6):
Benj (Mon Aug 08, 2011 10:08 am) • DavidA (Mon Aug 08, 2011 10:50 am) • garytech (Mon Aug 08, 2011 9:28 pm) • Spanish_dude (Mon Jul 02, 2012 8:15 pm) • medelec35 (Sat Feb 23, 2013 1:55 pm) • prasha920 (Tue Apr 12, 2016 6:27 am)
Rating: 31.58%
 
1 in 10 people understand binary, the other one doesn't !

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

Re: Basic GSM Remote Control

Postby JohnCrow » Sun Aug 21, 2011 2:29 pm

GSM Remote Control
Updated Version


The first version of my GSM remote control was fairly basic with little feedback.
This version has been greatly improved.

The basic hardware configuration has not been altered, except I'm using the standard matrix LCD E-block rather than my custom 4 line display

Sending a binary string i.e. 10100010 (Lowbyte first) will turn on / off the 8 control channels
Bits 1 -4 low nibble
Bits 5-8 high nibble

Initial status is still powered up all off.

When first powered up the local display will show
Finding Network

Once initalised it will show
Network Setup OK

The system then shows

Waiting….
It will stay in this state until a message is received.

The local display will reflect what has been received.


When the control string has been received and applied it is sent back to the control phone for confirmation.


It is now possible to send a single character control to the device.

2 = Status request
This sends the current status of the channels back to the control phone as a binary string i.e. 10010001

3 = All Channels Off
This turns off all channels.
A message confirming this is sent back to the control phone.

4 = All Channels On
This turns on all channels.
A message confirming this is sent back to the control phone.

3 & 4 can be confirmed by sending 2 (Status Request) if required.

Further commands can be added if needed by extending the decision loops.

Any other entry will return a Unknown Command message.

GSM Remote Control Working System V2 - No Phone Number.fcf
GSM Remote Control V2
(22.36 KiB) Downloaded 1280 times
Last edited by JohnCrow on Sun Aug 21, 2011 7:20 pm, edited 2 times in total.
These users thanked the author JohnCrow for the post (total 2):
maan_q (Sun Jul 01, 2012 9:12 pm) • medelec35 (Sat Feb 23, 2013 1:55 pm)
Rating: 10.53%
 
1 in 10 people understand binary, the other one doesn't !

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

Re: Basic GSM Remote Control

Postby JohnCrow » Sun Aug 21, 2011 3:47 pm

Added a security update
Program checks that the received phone number matchs the one stored in the system.
If they dont match, the txt message is ignored with no feedback

This way, if a message was sent in error, the sender does not know what has received the message.

GSM Remote Control V3 - No Phone Number.fcf
GSM Remote Control V3
(22.82 KiB) Downloaded 1277 times
These users thanked the author JohnCrow for the post (total 6):
Benj (Mon Aug 22, 2011 12:04 pm) • Steve001 (Sat Sep 10, 2011 12:21 pm) • maan_q (Sun Jul 01, 2012 9:11 pm) • Enamul (Wed Jul 04, 2012 11:22 am) • belayat (Thu Nov 22, 2012 11:05 am) • medelec35 (Sat Feb 23, 2013 1:55 pm)
Rating: 31.58%
 
1 in 10 people understand binary, the other one doesn't !

maan_q
Posts: 3
Joined: Wed Oct 26, 2011 9:52 pm
Has thanked: 3 times
Contact:

Re: MX029 - GSM Remote Control

Postby maan_q » Sat Jun 30, 2012 8:58 pm

Thanks sir John Crow for this project,
MY question how i can change the numbers 2,3,4 to characters for example AC1ON ,AC1OFF,Status . ?
regards

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

Re: MX029 - GSM Remote Control

Postby JohnCrow » Sun Jul 01, 2012 9:12 pm

Hi
I think that should be possible. For example in the "Decode Message Macro"

Where I look for 2 , 3 ,or 4 you will need to compare for a text string.
Sorry I dont have time to modify it at the moment.
These users thanked the author JohnCrow for the post:
maan_q (Mon Jul 02, 2012 9:09 am)
Rating: 5.26%
 
1 in 10 people understand binary, the other one doesn't !

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: MX029 - GSM Remote Control

Postby Spanish_dude » Mon Jul 02, 2012 8:19 pm

Looks awesome, very well done John.

Nicolas
These users thanked the author Spanish_dude for the post:
JohnCrow (Mon Jul 02, 2012 8:37 pm)
Rating: 5.26%
 

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MX029 - GSM Remote Control

Postby Enamul » Wed Jul 04, 2012 11:25 am

Hi John,

Excellent work! :)

I am trying to use that with wavecom supreme 10 modem so that if anyone doesn't have GSM module can try with standard modem.

I will post the schematic and program soon..

Thanks,

Enamul
These users thanked the author Enamul for the post:
JohnCrow (Wed Jul 04, 2012 11:47 am)
Rating: 5.26%
 
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MX029 - GSM Remote Control

Postby Enamul » Thu Jul 05, 2012 1:06 am

Hi,

I have re-implement John's V3 in FC v4.5 which is compatible with V5 as well. So V4 user can easily use this program. This program can be used by the users who have GSM board (EB066) but also those who don't have EB066 but have RS232 board (EB015) and also those don't have any of those.. :D ..by just making a simple circuit using the schematic given the last page of the pdf in the following link:
http://www.matrixmultimedia.com/resourc ... 5-30-2.pdf

It's pretty simple..just need MAX232 IC and few other components..If anyone still confused..I can post a schematic avoiding the patch...

ok..Now move to the circuit connection of the current post:

PIC 16f877A, 20MHz, LCD>PORTB (DATA>RB0-4, RS>RB4,EN.RB5), Relays(8)>PORTD,

As I have said in my last post, I want to implement this for general purpose GSM/GPRS modem. i have chosen Wavecom Supreme 10 modem which is available to me right now. Although the AT commands we are using in this program are almost similar in most of the modems.

Modem connection via EB015 (custom made max 232 board) >> PORTC
RTS>PORTC0
CTS>PORTC4
TX>PORTC6
RX>PORTC7

Move to Code:

For details description about code, in this forum page John has described everything..I have just modified few things...

To Ben:

Code: Select all

char FCD_GSM0_CheckNetworkStatus()
{
   
   //0 = not connected
   //1 = connected
   //255 = no reply

      char retval = 0;

      FCD_GSM0_SendCommand("AT+CREG?",8,1);      //Check network status

      if ( FCD_GSM0_StringReceive() == 0)
         return 255;

      if ( GSM_STRING_ARRAY[7] == '0' || GSM_STRING_ARRAY[7] == '1' && GSM_STRING_ARRAY[9] == '1' || GSM_STRING_ARRAY[9] == '5')
         retval = 1;
       FCD_GSM0_StringReceive();
      FCD_GSM0_StringReceive();
      Wdt_Delay_Ms(100);

      return retval;

}


I have modified
if ( GSM_STRING_ARRAY[7] == '0' || GSM_STRING_ARRAY[7] == '1' && GSM_STRING_ARRAY[9] == '1' || GSM_STRING_ARRAY[9] == '5')


because I have tried in different modems in other projects, after AT+CREG? command..some modem returns.. +CREG: 0,1 while connected to network but some modem returns +CREG: 1,5 which generally shows in roaming mode but some modem normally shows this..

So using the default code you can't ever get connected.

Rest of the things are ornamentation...John I really like your code! Nice work.

Still anyone needs clarification feel free to ask :)

Thanks,

Enamul
Attachments
GSM_Remote_Control-using modem.fcf
(21.25 KiB) Downloaded 1048 times
These users thanked the author Enamul for the post:
medelec35 (Sat Feb 23, 2013 1:56 pm)
Rating: 5.26%
 
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4145 times
Contact:

Re: MX029 - GSM Remote Control

Postby Benj » Thu Jul 05, 2012 9:39 am

Hello Enamul,

Thanks for the heads up on the code and for providing a working fix. I will make the changes to the master C file so these mods will be in the next release.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: MX029 - GSM Remote Control

Postby Enamul » Thu Jul 05, 2012 9:57 am

Hi,

You are welcome :)

Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

maan_q
Posts: 3
Joined: Wed Oct 26, 2011 9:52 pm
Has thanked: 3 times
Contact:

Re: MX029 - GSM Remote Control

Postby maan_q » Wed Jul 11, 2012 8:07 pm

Sir John Crow ,
can you tell me whats error in my project,
Flowcode1.fcf
(9 KiB) Downloaded 951 times

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

Re: MX029 - GSM Remote Control

Postby JohnCrow » Wed Jul 11, 2012 9:08 pm

Hi maan_q

Try this one. Ive tried it on my GSM board and its working, (but not quite as you want :? )

What Ive done is to have it turn on an LED at each stage
Bit 1 - Network ok
Bit 2 Incoming data
Bit 4 Message Received

By doing this you can tell where the program getting to each part of the flowchart
(You can delete this once you looked at it.)

Simple Txt Works.fcf
(9 KiB) Downloaded 1011 times


Ive kept the flowchart in FC4


Note - from the FC4 Help File

Compare$(string1, string2, compare_type)
Compares the two strings, parameters 1 and 2, and returns a BYTE value corresponding to the following results:
0 = strings are identical
1 = string1>string2
255 = string2>string1


It does not seem to see the received string as identical to the one stored in the compare (Option 0)
Using option 1 allows it to turn on the leds.

Try printing the received string to the LCD and see if the its what you expect.
Also you could try setting the string length in variables to match the length of the strings you are using.
Let me know how you get on, if not I'll have another look tomorrow for you.
1 in 10 people understand binary, the other one doesn't !

maan_q
Posts: 3
Joined: Wed Oct 26, 2011 9:52 pm
Has thanked: 3 times
Contact:

Re: MX029 - GSM Remote Control

Postby maan_q » Thu Jul 12, 2012 8:03 pm

THanks Sir John Crow ,
I have tried the program with a little modify is working very good you can see below,
Attachments
Simple Txt Works.fcf
(10.5 KiB) Downloaded 980 times

BEANBAGS
Posts: 7
Joined: Thu Feb 07, 2013 7:40 pm
Has thanked: 3 times
Contact:

Re: MX029 - GSM Remote Control

Postby BEANBAGS » Sun Feb 17, 2013 3:27 pm

Hi guys,

Sorry for dragging up an old thread, I am doing a GSM based project and was looking through the forums, I am using the EB066 with a development board at this stage. I am not all the familiar with flowcode and was wondering what port is used on the development board for it. I have being using port C and have being trying to send a simple SMS but am failing too. I found a program on here that test the network connection and am sure that I am unable to connect a network.

User avatar
Benj
Matrix Staff
Posts: 14371
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4447 times
Been thanked: 4145 times
Contact:

Re: MX029 - GSM Remote Control

Postby Benj » Fri Mar 08, 2013 1:09 pm

Hello,

For the EB066 to work correctly you first need a non contract type SIM card. i.e. a SIM which you need to buy credit for. Contract SIM cards are encrypted so you need to know the encryption keys for the network which the providers do not usually release to the public.

When the EB066 connects to the mobile network the LED flash pattern changes to about 200ms on and 3s off. If this remains stable then you should have a stable connection to the network.

The GSM board should connect to the port which has the hardware UART on your device. This is usually portC but you can check by looking at the chip diagram in Flowcode and finding the RX and TX pins. You then should refer to the EB066 datasheet for details of how to route the signals correctly using the patch system.

If you are unable to get a stable signal then there was a bit of a bug in the v1 EB066 boards which means that SIMS on the 800MHz band work well but other bands do not work so well. I seem to remember posting a list of network providers in different countries and their associated band here on the forums so let me know if you need this info and I will have a search.

lewisrendal
Flowcode V4 User
Posts: 61
Joined: Tue Feb 01, 2011 7:21 pm
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: MX029 - GSM Remote Control

Postby lewisrendal » Mon Mar 25, 2013 7:37 pm

Hi John,

I hav just got my version 2 eb066 eblock and powered up with the sample program you have, i'm using the 18f4455 instead of he 4550 very simular.

When power is applied is the led lite up ?

The lcd sits there just saying finding network ??

Unfortunatly matrix don't have the datasheet on this module just the old one ?

Thanks for your help

James

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

Re: MX029 - GSM Remote Control

Postby JohnCrow » Mon Mar 25, 2013 8:13 pm

Hi James

If I remember I have used both the 4550 and the 4455 pics for this.
I was not aware a new version of the board had been released. I should think it will be compatible as far as the flow code macros work.

First thing I can suggest, you are using a prepay (pay as you go) sim rather than a contract type one as these wont work.

Are you using FC4 or FC5
1 in 10 people understand binary, the other one doesn't !

lewisrendal
Flowcode V4 User
Posts: 61
Joined: Tue Feb 01, 2011 7:21 pm
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: MX029 - GSM Remote Control

Postby lewisrendal » Mon Mar 25, 2013 9:05 pm

Hi John,

Yes I have had to wait for over one month for it to arrive.

I'm using version v4.5 flowcode.

I have pay as you go sim, one orange and one virgin, both do the same just sit there saying finding network...

Being one of the first eb066-002 to be released maybe the answer ?

I have attached the program which includes the virgin number only.

Thanks for your help

James
Attachments
GSM Remote Control V3 - 18f4455.fcf
(22.82 KiB) Downloaded 805 times

saad.sharif
Posts: 16
Joined: Sun Nov 10, 2013 12:35 pm
Has thanked: 4 times
Been thanked: 1 time

Re: MX029 - GSM Remote Control

Postby saad.sharif » Thu Feb 13, 2014 10:26 pm

hi enamul
i am using sim900d modem i am still confused how to connect with the file u attached above... please can u give me the layout how to do connection with pic and gsm modem...

margaretdavid
Posts: 2
Joined: Fri Feb 07, 2014 11:49 pm
Location: new york
Contact:

Re: MX029 - GSM Remote Control

Postby margaretdavid » Sat Feb 15, 2014 1:43 am

hmmm great thank for sharing this information

lewisrendal
Flowcode V4 User
Posts: 61
Joined: Tue Feb 01, 2011 7:21 pm
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: MX029 - GSM Remote Control

Postby lewisrendal » Sun Mar 30, 2014 8:39 am

HI Ben,

Do you have any idea why the telit module accepts the at+cpbw command but the sim900 does not and returns the error cme 03 "operation not allowed"

In the sim900 manual it says enter - at+cpbw,"99999",129,"fredbloggs"
But in flowcode I have to write "at+cpbw,99999,129,fredbloggs" (is this the issue why) if yes then how can I send the above, flowcode will not let me.

Thanks for any help

Regards
James

kersing
Valued Contributor
Valued Contributor
Posts: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: MX029 - GSM Remote Control

Postby kersing » Sun Mar 30, 2014 8:47 am

lewisrendal wrote:In the sim900 manual it says enter - at+cpbw,"99999",129,"fredbloggs"
But in flowcode I have to write "at+cpbw,99999,129,fredbloggs" (is this the issue why) if yes then how can I send the above, flowcode will not let me.


Hi James,

Could you try entering \" (backslash followed by double quotes) where the manual lists quotes, so the example string would be:
"at+cpbw,\"99999\",129,\"fredbloggs\""

Jac
These users thanked the author kersing for the post:
lewisrendal (Sun Mar 30, 2014 9:29 am)
Rating: 5.26%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

lewisrendal
Flowcode V4 User
Posts: 61
Joined: Tue Feb 01, 2011 7:21 pm
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: MX029 - GSM Remote Control

Postby lewisrendal » Sun Mar 30, 2014 9:00 am

Hi Jac,

Thanks for helping, have tried this one and same error cme 03 comes back ?

When I send at+cpbw=10 (which erases number in position 10) this works and sends back "ok" and when I check using the m2m solution software the number has gone when I read the phonebook. but it does not like at+cpbw,number,code,text"

Even if I try to allocate a position i.e at+cpbw=10,number,code,text" this does not work either, yet they work with the telit 865 module ?

Most bizzare !?

Regards
James

lewisrendal
Flowcode V4 User
Posts: 61
Joined: Tue Feb 01, 2011 7:21 pm
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: MX029 - GSM Remote Control

Postby lewisrendal » Sun Mar 30, 2014 9:27 am

Hi Jac,

Thanks for your help, I forgot to add the "=" it does not work doing it my way, but when I do the command your way e.g "at+cpbw=,\"99999\",129,\"fredbloggs\"" it works !!!

Clever Man, Thanks again

James :mrgreen:

lewisrendal
Flowcode V4 User
Posts: 61
Joined: Tue Feb 01, 2011 7:21 pm
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: MX029 - GSM Remote Control

Postby lewisrendal » Thu Apr 10, 2014 4:10 pm

Hi,

Has anyone had any dealings with DTMF. i.e at+ddet = 1
Answer call:-
Then how to receive the numbers via serial port when keys pressed ?

Many Thanks
James