When blynks run, sms are not received

Hello

At first. Sorry, but my english is not very good.

I have a problem when blynks run into my project.
A few years ago I created a project to control a swimming pool and another things using sms and phone calls (using Arduino Mega and SIM900 shield) it was working ok, but my telephone company starts to charge sms on my account (before they were free for me).
Then I decided to control it through blynk. Now, everything goes ok with Blynk, but there is a “newproblem”: sms and phone calls doesn’t work properly whenk blynk is connected,(Sometimes it works but most times aren’t received / read)
However, if I comment the line “Blynk.begin(auth, modem, apn, user, pass);” on my sketch, the sms and calls work properly
I have tried a lot of changes, and the “traffic” between my SIM900 modem and the phone is perfect (not flooding - not blynks references on void loop).

Note: I haven’t post my Sketch because it’s very long (over 2000 lines) and it isn’t organized neither finished yet.

Thanks in advance.

Blynk uses TinyGSM to communicate between MCU and modern. How it works is quite easy to follow by observing communication between modem and MCU and serial logs. While I can assure you the GPRS connection and TCP/IP stream is quite stable when using with Blynk, I can say nothing about its “cooperation” with voice and/or SMS communication. Therefore I advise you to follow the SIM900 docs and follow the way Blynk/TinyGSM handles the TCP/IP comm.

Blynk.begin() is a blocking command… meaning if it cannot connect to the server, the code halts there until it can.

Then the carrier connection is the suspect, more so then Blynk or your code… I think.

Yes, that’s true, even though the docs.blynk.com states something different:

  • 3.Tries to connects to the server once (can block for more than 30s)

But in fact it just blocks program flow until connected. That is why I avoid using it.
I wonder if the docs shouldn’t be updated? Or library modified?..

Well… I guess “more than” can == forever so even the old Docs are “technically” correct :stuck_out_tongue_winking_eye:

Will blynk.config() work with GSM? I don’t see why not, but don’t have any cellular modules to test (and I think the data/only service costs are rising too much here anyhow… and unsure about continued GSM support, so I never picked any up when I had the chance)

1 Like

Sure!

1 Like

Thank you very much for your answers. 'll try to reply:

1.- Sorry, I don’t know anything about TCP/IP…but I promise you I’'try to learn.

2…-When the code is running, blynk connects and it doesn’t drop, so I am able to control my arduino (with lcds, rtc, leds…) using my android phone (blynk app) without any problem, and if I include “#define BLYNK_DEBUG” to enable debug prints on serial, it seems not to be therefore saturated…I think connection is ok and doesn’t block the code (not for any second at least).

3.-In fact…when blynk has connected, a few times, SMS and CALLS work (Serial port overloaded?), but when I disconnect it (removing “Blynk.begin…” it works perfect (not any fail). (Blynk.begin is on setup, and blynk.run is included in the loop)

I’ll try to get a very, very simply code, only with both performances. If it remains failing, I’'post this simply code.

Thanks again.

Hmmm… It might be… Who knows… Anyway worth checking with increased SERIAL_RX_BUFFER_SIZE (the standard Arduino is 64 bytes, but I don’t know if MEGA hasn’t any larger by default)

Ok.You have open a new window!!, I will get to work right now. Thanks again.

Are you trying to use the same GSM modem module for both a Blynk connection to the server (via the modems internet connection) and as some form of independent connection to your phone? That might be an issue… as a typical serial connection is meant for one thing at a time, not a shared connection for multiple “serial conversations”.

Yes, I’m using the same SIM900 module for both, and that’s what I meant to say: Shared connection seems not to be a good idea, but I thought smartphones worked that way. Don’t they?.
In my sketch I have an option to send AT commands, this option force the controller to wait a response (response to AT command) , I have checked that when I am sending /receiving AT commands:

1.- SMS and phone calls work properly.
2.- If I stay in that situation for a while (30 seconds I think) when I return to the loop the blynk connection has drop.

in conclusion: Problems with shared connection.

Anyway, in addition: I have changed my Sketch: To read SMS and incoming calls, in void loop, I have replaced “If (Serial3.available ())…” for “do (…) while serial3.available ()”, and now… everything it’s OK!!!. However, all is not a bed of roses: I have checked the loop have noticeably slowdown (I have a LCD which display the times of a RTC, before this modification it blinks every second, now it blinks every 4 seconds, 4 times slower!!!)

Then Your code needs further optimizations. :slight_smile: I don’t know how far you can go with it anyway, so good luck…

Smartphones over WiFi, yes. Serial devices like your GSM modem connected to your Arduino… NO! Use it to connect to the internet & Blynk Server only. Do all device to phone communication via that link (AKA, Blynk)