GSM (EB066, Generic AT)

For general Flowcode discussion that does not belong in the other sections.
Post Reply
zoli2496
Posts: 28
http://meble-kuchenne.info.pl
Joined: Wed Sep 22, 2021 7:23 am
Been thanked: 2 times

GSM (EB066, Generic AT)

Post by zoli2496 »

Hello!

I use Flowcode V9 software. It contains the GSM module (EB066, Generic AT). I would like to ask how to call a specific phone number using the module. (just ring the phone) Which macro component should be used and how? Unfortunately, I couldn't find an example program in the Help menu.

Thank's

chipfryer27
Valued Contributor
Posts: 1313
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 317 times
Been thanked: 458 times

Re: GSM (EB066, Generic AT)

Post by chipfryer27 »

Hi

Here is a link to some posts in the v8 forum that may help in using a GSM module with "AT" commands,

https://www.matrixtsl.com/mmforums/view ... 27#p106927


You might have some issues using some component macros but if you send the relevant "AT" instead you should be fine.

Regards

EDIT.....
I think I still have my GSM module setup somewhere. If you still need an example I can create one later in the week.

zoli2496
Posts: 28
Joined: Wed Sep 22, 2021 7:23 am
Been thanked: 2 times

Re: GSM (EB066, Generic AT)

Post by zoli2496 »

Welcome!

Yes, the example program would be great :) The goal is:

If I press a button, the module rings my own phone. As long as the button is pressed, my phone will ring.

Thank's ;)

chipfryer27
Valued Contributor
Posts: 1313
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 317 times
Been thanked: 458 times

Re: GSM (EB066, Generic AT)

Post by chipfryer27 »

Hi

That should be simple enough to do.

However when you press the button (possibly holding it too) you will send code to the module for it to set up and connect to a distant number (e.g. your house phone). To end the call you would need to send further commands to the module. You could easily "poll" the status of the button and if released then send commands to end the call.

However you will need to properly debounce your button or you could accidentally end your call before you begin :)

Regards

zoli2496
Posts: 28
Joined: Wed Sep 22, 2021 7:23 am
Been thanked: 2 times

Re: GSM (EB066, Generic AT)

Post by zoli2496 »

without a push button for now.

I guess that's not good logic...?
Attachments
GSM_CALL.fcfx
(11.12 KiB) Downloaded 112 times

chipfryer27
Valued Contributor
Posts: 1313
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 317 times
Been thanked: 458 times

Re: GSM (EB066, Generic AT)

Post by chipfryer27 »

Hi

I had a couple of issues as documented in my link, so I reverted to using the UART to send/receive appropriate "AT" commands. I'll dig out my module and have a play when I get the chance.

A great way to trouble shoot and learn how things are working is to use a TTL serial-USB convertor which can be bought cheaply from all the usual suspects. With that and a terminal emulator such as "Terminal" or "PuTTY" you can see what is going on.

If you connect the Rx pin of the convertor to the PIC/whatever Tx pin, you will see what is being sent. If you connect to the chip Rx pin you will see what is being received. This is a great way to see what's happening.

Regards

chipfryer27
Valued Contributor
Posts: 1313
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 317 times
Been thanked: 458 times

Re: GSM (EB066, Generic AT)

Post by chipfryer27 »

Hi

Setup my SIM800 but of course the SIM had expired. I tried using the one from my phone but I can't register on a network. Where I stay has sketchy coverage at best, so I'll try again from a different location in a day or two.

Regards

chipfryer27
Valued Contributor
Posts: 1313
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 317 times
Been thanked: 458 times

Re: GSM (EB066, Generic AT)

Post by chipfryer27 »

Hi

With my sim inserted into the module I could send AT commands and read what networks are available, but for whatever reason I couldn't actually register on to my network. With the sim in an old extremely basic 2G phone it registered fine. All usual troubles checked, such as power (4.2V / 3A supply). Blinks ten times then pauses before repeating. Only seeing about 100mA being drawn which suggested power was the problem.

It was. I was running from a bench supply with more than adequate resources but stupidly, and I should know better, as I was in a hurry I connected up to breadboard using jumpers. Big mistake....... With the module connected directly to the PSU it registered fine. If called, my terminal that I was using showed "RING" :)

Too cold to do more so I'll post some code later.

However to make a call from a Terminal (or via UART) send:-

ATD+ +AAbbbcccdddd;

where +AA is country code and bbbcccdddd is the number (e.g. +441234567890). Don't forget the semicolon at the end.

To hang up send

ATH

Regards

chipfryer27
Valued Contributor
Posts: 1313
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 317 times
Been thanked: 458 times

Re: GSM (EB066, Generic AT)

Post by chipfryer27 »

Hi

The GSM component has a bug in that it doesn't correctly return status, so if you are checking if connected you may not get the correct reply. It would be good practise to perform various checks before / during / after connection to verify states, but not strictly necessary for operation.

The first example "Dial Out via GSM" is very basic and does not perform any checks. It works with my module but yours may be different or using different firmware. My module will accept numbers either with or without country codes and in the example you need to change the Dialled Number in the component macro to suit.

The program initialises the module, waits for a button connected to A0 to be pressed, dials the number then waits for A0 to end the call before repeating.
Dial Out via GSM.fcfx
(10.34 KiB) Downloaded 107 times

In the next example I use the UART component to send "AT" commands to the GSM module. Both the UART component and the GSM component use the same Tx/Rx pins.

This time I create the Send String in a calculation and the Country Code and Number use variables. This structure should work irrespective of location / existing firmware. Change the initial value of the variables to suit your needs.
Dial Out via UART.fcfx
(11.87 KiB) Downloaded 105 times
Note that you need to visually verify Network Connection before any of the above will work. The onboard LED should be flashing once every three seconds to signify the module is registered on the network.

If you have a Serial-USB connection you could monitor the Tx/Rx pins using a Terminal program to see what is being sent to the module and any replies.

Regards

EDIT,...
Just noticed I forgot to include a short delay after "Hang Up". You may need to insert one to prevent the loop redialling if button isn't released quick enough

Post Reply