Page 1 of 1

MX029 - GSM Remote Control

Posted: Sun Aug 07, 2011 2:23 pm
by JohnCrow
Article: http://www.matrixmultimedia.com/article.php?a=504

If you have any questions or comments on the article, please post them below.

Re: Basic GSM Remote Control

Posted: Sun Aug 21, 2011 2:29 pm
by JohnCrow
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 1664 times

Re: Basic GSM Remote Control

Posted: Sun Aug 21, 2011 3:47 pm
by JohnCrow
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 1647 times

Re: MX029 - GSM Remote Control

Posted: Sat Jun 30, 2012 8:58 pm
by maan_q
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

Re: MX029 - GSM Remote Control

Posted: Sun Jul 01, 2012 9:12 pm
by JohnCrow
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.

Re: MX029 - GSM Remote Control

Posted: Mon Jul 02, 2012 8:19 pm
by Spanish_dude
Looks awesome, very well done John.

Nicolas

Re: MX029 - GSM Remote Control

Posted: Wed Jul 04, 2012 11:25 am
by Enamul
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

Re: MX029 - GSM Remote Control

Posted: Thu Jul 05, 2012 1:06 am
by Enamul
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

Re: MX029 - GSM Remote Control

Posted: Thu Jul 05, 2012 9:39 am
by Benj
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.

Re: MX029 - GSM Remote Control

Posted: Thu Jul 05, 2012 9:57 am
by Enamul
Hi,

You are welcome :)

Enamul

Re: MX029 - GSM Remote Control

Posted: Wed Jul 11, 2012 8:07 pm
by maan_q
Sir John Crow ,
can you tell me whats error in my project,
Flowcode1.fcf
(9 KiB) Downloaded 1305 times

Re: MX029 - GSM Remote Control

Posted: Wed Jul 11, 2012 9:08 pm
by JohnCrow
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 1327 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.

Re: MX029 - GSM Remote Control

Posted: Thu Jul 12, 2012 8:03 pm
by maan_q
THanks Sir John Crow ,
I have tried the program with a little modify is working very good you can see below,

Re: MX029 - GSM Remote Control

Posted: Sun Feb 17, 2013 3:27 pm
by BEANBAGS
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.

Re: MX029 - GSM Remote Control

Posted: Fri Mar 08, 2013 1:09 pm
by Benj
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.

Re: MX029 - GSM Remote Control

Posted: Mon Mar 25, 2013 7:37 pm
by lewisrendal
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

Re: MX029 - GSM Remote Control

Posted: Mon Mar 25, 2013 8:13 pm
by JohnCrow
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

Re: MX029 - GSM Remote Control

Posted: Mon Mar 25, 2013 9:05 pm
by lewisrendal
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

Re: MX029 - GSM Remote Control

Posted: Thu Feb 13, 2014 10:26 pm
by saad.sharif
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...

Re: MX029 - GSM Remote Control

Posted: Sat Feb 15, 2014 1:43 am
by margaretdavid
hmmm great thank for sharing this information

Re: MX029 - GSM Remote Control

Posted: Sun Mar 30, 2014 8:39 am
by lewisrendal
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

Re: MX029 - GSM Remote Control

Posted: Sun Mar 30, 2014 8:47 am
by kersing
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

Re: MX029 - GSM Remote Control

Posted: Sun Mar 30, 2014 9:00 am
by lewisrendal
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

Re: MX029 - GSM Remote Control

Posted: Sun Mar 30, 2014 9:27 am
by lewisrendal
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:

Re: MX029 - GSM Remote Control

Posted: Thu Apr 10, 2014 4:10 pm
by lewisrendal
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