GSM Component

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

keejay
Flowcode v5 User
Posts: 110
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 14 times
Contact:

GSM Component

Postby keejay » Sat May 21, 2016 11:25 am

Hi guys,

Is there any way of extracting the number of a call to a GSM module. The component to extract the number from an incoming SMS works well for an SMS, but I'm trying to get the number of an incoming call. Any ideas?

Thanks

User avatar
Bachman
Posts: 64
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 8 times
Been thanked: 35 times
Contact:

Re: GSM Component

Postby Bachman » Mon May 23, 2016 8:07 pm

Did you try pure UART (RS232) communication? I think, when you call the GSM module, it's sending the information via UART.

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

Re: GSM Component

Postby Benj » Thu May 26, 2016 11:30 am

Which GSM module are you using? If you look at the AT command datasheet for the module then there should be a way of getting the caller ID. Maybe via an AT command or maybe it is sent along with the incoming RING message.

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Tue May 31, 2016 1:49 pm

Hello,

i would prefer to ask this in this topic instead of creating a new one.


With Flowcode V6 i am using the well known GS M Module SIM8OOL and i need to receive an SMS message.

Inside a loop i read a variable for the incoming message.

If i got the variable for incoming message equal to 1 then using an IF statement i compare the incoming string with a string of my preference and if both are identical then i turn on an LED.

Usually this works fine but sometimes i need to send the sms multiple times in order to get the LED turned on.

One of the questions that i have is: should i place a delay component inside the loop that i check for an incoming message ? And if yes, what is the time delay value?

Do you have any idea what may be the solution for the above issue?


Thanks In Advance
Regards
George

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: GSM Component

Postby acestu » Tue May 31, 2016 5:47 pm

Hi George,

Can you post your chart so that we can have a look what you are doing, I am playing with this module at the moment myself and I am finding them very unstable, you need filter caps as close to the board as possible, also you need a good 4.5 - 4.8 volt power supply that can handle a 2 amp spike when the module makes a call or sends a text, I will find a diagram of the filter caps for you and put it on here.

Thanks
Stuart


EDIT: Here you go: https://bigdanzblog.wordpress.com/2016/ ... stability/
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Tue May 31, 2016 8:25 pm

Hi Stuart, thank you for your help!


The Module that i have at the moment is This

I will try to upload the flowcode Program when i will have free time in the weekend


Many thanks
George

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Mon Jun 06, 2016 12:32 pm

Hello,


I tried to use the capacitors according the details in the link above, without any change.

The current problem that i am facing is that sometimes i receive the sms message and sometimes i don't.

I will try to upload the program so you can have a better view.

Have you experienced this issues before?


Regards
George

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

Re: GSM Component

Postby Benj » Mon Jun 06, 2016 2:34 pm

Hi George,

Sounds like a powering problem to me. If you have a scope then look at the power rails and see if you get any high frequency dips in the voltage.

Caps will certainly help, tantalum caps are best for this as they can provide large amounts of current in a small amount of time which is what the GSM module will likely need.

Are you using a voltage regulator? If so then what current can it handle?

I have often powered GSM modules off single cell lipo batteries. These have a working voltage range from 3.7V - 4.2V and can be connected directly to provide all the current the module needs.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: GSM Component

Postby acestu » Mon Jun 06, 2016 7:24 pm

Hi George,

as Ben says the power supply for these devices have to be bang on, if you click on the link that I sent you above, at the bottom of the page a reader has replied to the blog adding 2 x links that explain decoupling power supplies and how best to achieve it, well worth a read, it helped me.

Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Tue Jun 07, 2016 6:52 am

Hi to all and thank you for your replies!

Benj wrote:Sounds like a powering problem to me. If you have a scope then look at the power rails and see if you get any high frequency dips in the voltage.

Caps will certainly help, tantalum caps are best for this as they can provide large amounts of current in a small amount of time which is what the GSM module will likely need.

Are you using a voltage regulator? If so then what current can it handle?



I will monitor the power rails with the scope soon.

Yes, I am using a voltage regulator L2576 to convert 12V(from a 7Ah battery) to 5V for the GSM module. I assume that the regulator provides enough mount of current for the Module.


acestu wrote:Hi George,

as Ben says the power supply for these devices have to be bang on, if you click on the link that I sent you above, at the bottom of the page a reader has replied to the blog adding 2 x links that explain decoupling power supplies and how best to achieve it, well worth a read, it helped me.

Thanks
Stuart


I will definitely read the links you suggested.



I will come back with more details of the investigation of the issue.



Thank you all
Have a nice day
George
These users thanked the author George_B for the post:
Benj (Tue Jun 07, 2016 9:46 am)
Rating: 5.26%
 

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Mon Jun 20, 2016 5:46 pm

Hello, finally i found some time to run a couple of tests for the problem mentioned above.


1) I measured the power rails using an oscilloscope, as Benj suggested. The result on the scope was pretty good in term of noise even if I use a switching DC Step down converter (LM2576) to convert the 12V from a battery to 5V for the GSM module.

2) I measured the current consumption of the GSM Module. The maximum current i got measured was 75mA while the module was sending an SMS. Standby current was bellow 60mA.

3) I have attached decoupling capacitors as Stuart suggested.

Some times i get the reading from the message fine, but some times not.


I have attached the part of the program that i am using to Receive a message.

Receive_SMS.fcfx
(12.96 KiB) Downloaded 230 times


Thank You
George

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

Re: GSM Component

Postby Benj » Tue Jun 21, 2016 10:43 am

Hi George,

I have rearranged your program about a bit. Give this a go and see how you get on.

Receive_SMS.fcfx
(14.44 KiB) Downloaded 250 times

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Tue Jun 21, 2016 11:28 am

Hi Benj, Thank you for your reply!

I will try this the soonest.

I see that you removed the component with the AT command "AT+CMGD=1,4" which i was using to delete all the messages. Is there any reason of doing this?


Thank you
George

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

Re: GSM Component

Postby Benj » Tue Jun 21, 2016 11:49 am

Hi George,

It's not strictly necessary to delete the messages.They will continue to come in and I'm not sure if the default is to save onto the SIM card or not.

Anyway have a go and see if this is any better.

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Wed Jun 29, 2016 9:27 pm

Hi again!

I tried the rearranged code from Benj. Unfortunately after the test i observed the same operation as before.

I am wondering if the values, "String Array Size" and "Message Array Size" will affect the receiving procedure?

Flowcode has these values by default equal to 80.

Untitled.png
Untitled.png (18.56 KiB) Viewed 10860 times



Regards
George

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Tue Jul 12, 2016 10:34 am

Hello all,


I was trying to find a reason why the GSM modem would not give correct data while a new message arrives.

I made a couple of test with no luck again.

One thing that i have noticed is that if i reduce the number of the text characters from 18(CN9435693495OK,3,3) to 2, everything will be just fine even if i send sms again and again.

Is there any other idea of what may be going on ?


Thanks
George

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Mon Jul 18, 2016 10:23 pm

Hello,

This is a sample of a message that i get some times..

I tried to change the baud rate value but no change on the results as you can see below


+CMT: "+3##########","","16/07/18,23:58:54+12âC…(úÊÂÊÒ949´§jŠiiSHø

User avatar
LeighM
Matrix Staff
Posts: 1919
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 461 times
Been thanked: 649 times
Contact:

Re: GSM Component

Postby LeighM » Tue Jul 19, 2016 10:40 am

That looks like you might be reading the message in PDU mode and the message data is in its encoded form.
Have a good read through the AT command reference for your modem and see if there are commands for setting text mode.
These users thanked the author LeighM for the post:
George_B (Thu Jul 28, 2016 11:49 am)
Rating: 5.26%
 

George_B
Posts: 88
Joined: Wed Jul 04, 2012 11:21 pm
Has thanked: 37 times
Been thanked: 12 times
Contact:

Re: GSM Component

Postby George_B » Tue Jul 19, 2016 4:11 pm

Hi, thanks for your reply,

I have already configured the modem to operate in text mode.

:?: :roll:

keejay
Flowcode v5 User
Posts: 110
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 14 times
Contact:

Re: GSM Component

Postby keejay » Tue Jul 26, 2016 1:04 pm

Hi all,

I have been using the GSM component with a lot of success. What I would like to do is request the signal strength from the unit. The AT command to do this for my module is:

AT+CSQ

This is not catered for in the GSM component, so I need to manually send the command to the unit. I assume one would do this by using the "SendCommand" macro of the GSM component? The next question, is how to receive the reply. There is a macro called "StringReceive", but the variable that stores the reply is a BYTE, so Im not sure how to read the reply as the reply will be in a string form?

Any ideas?

Thanks

User avatar
LeighM
Matrix Staff
Posts: 1919
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 461 times
Been thanked: 649 times
Contact:

Re: GSM Component

Postby LeighM » Tue Jul 26, 2016 1:19 pm

Hi,
It's probably not as clear as it ought to be...
The StringReceive returns the value 1 if a string (reply) was received, 0 otherwise.
If the return is value 1, then call ReadString to copy what was received to your local string.
Hope that helps,
Leigh
These users thanked the author LeighM for the post:
George_B (Thu Jul 28, 2016 11:49 am)
Rating: 5.26%
 

keejay
Flowcode v5 User
Posts: 110
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 14 times
Contact:

Re: GSM Component

Postby keejay » Tue Jul 26, 2016 1:47 pm

Thanks,

I'll give that a try.

keejay
Flowcode v5 User
Posts: 110
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 14 times
Contact:

Re: GSM Component

Postby keejay » Wed Jul 27, 2016 8:32 pm

Thanks very much Leigh,

That works great!!
These users thanked the author keejay for the post:
LeighM (Thu Jul 28, 2016 9:31 am)
Rating: 5.26%