Would like to get SMS working from Blynk

I know this topic has been asked before but I have not found any solutions.
I already have a Nexmo account that works from other application(s) with out any trouble.
I have set the as directed in the Blank home folder.
The code does not moan if I use Blynk.sms(“some message”); and the log does mark sms(1), however where does one put the telephone number?
If I look at the Blynk Server, I see something like public void send(String to, String text) {
But if i try Blynk.sms("",“message”); it moans as the library can only take one argument.

Can someone please advise, would be nice to use my Nexmo account to alert me when hardware looses power etc …

Obviously I could write my own hooks, but if the code is there, and is suppose to work, why not use it?

Solved. I did find a message on the community, though not absolutely clear, did indicate that one had to add some json code to create a SMS widget. So I created a version that works. Bear in mind that it needs to exactly match the space where a real widget will go. The easiest is to say add an email widget and then replace the entries in the widget with the appropriate SMS ones. Here is an sample of my code. Obviously use your Cell number.

        "type": "SMS",
        "id": 432,
        "x": 2,
        "y": 7,
        "color": 1602017535,
        "width": 2,
        "height": 1,
        "tabId": 0,
        "isDefaultColor": false,
        "to": "619876543210"

I used a json editor to make it easy to do.

Hi @Kawayuppie

It’s exactly what I’m looking for, but I don’t understand how you created an SMS widget ?
Could-you explain this please ?

I think (and I’ve never done this, so it’s an educated guess) that you have to edit the .Blynk.user file on the Blynk local server.

Create/edit your project in the app, and add an email widget to it as mentioned above.
Then navigate to your .Blynk.user file using something like WinSCP.
For me the file lives at /home/pi/Blynk/myemailaddress.Blynk.user

You’ll then need to edit this file - preferably using a JSON editor. When you drill in to the file, the structure is:

      Dashboard ID
           Widget ID

Find the email widget that you’ve added (probably the highest numbered Widget ID) and edit it with the data in the post above.
Don’t forget to change the “to” value to match the mobile phone number that the SMS will be sent to.

You’ll then need to copy the file back to the server. It would obviously make sense to keep a backup of your original file in case it all goes horribly wrong.
I’m assuming that you’ll need to stop and start the Blynk server, and maybe restart the app too.

If you try this and manage to get it working then maybe you could provide some feedback and revised instructions?


1 Like

Many thanks Pete !
I’ll provide feedback ASAP :wink:

Great ! It works !!

Here’s a method using a local Blynk server on a Debian distro. I use ssh and sftp tools because my PC is under Linux :

1- Create an account at Vonage (formerly Nexmo). You’ll get some free SMS
2- Create file within same folder where server.jar is, with your Vonage credentials :


3- Create/edit your project in the app and add an email widget
4- Save and edit this file : /home/user/Blynk/youremailaddress.Blynk.user
5- I use VS Code to edit it (add .json extension before) and format your JSON file using Ctrl+Shift+I
6- Find code of email widget that you’ve added and replace “EMAIL” by “SMS”, “” by “yourPhoneNumber” (with Vonage format) and delete contentType line (and the comma above)
7- Save this file and put it into /home/user/Blynk/ (with .user extension, not .json !)
8- Add Blynk.sms("YourText"); in your sketch and upload it to your board
9- Restart Blynk server and app (the modified widget is marked as “not supported”)
10- Check the SMS service !

Many thanks to @PeteKnight and @Kawayuppie :slight_smile:

1 Like I saw the email over teh weekend, but only had access to my laptop today to sign in.
I am glad that you have sorted out the problem and thanks to you and @PeteKnight for improving the instructions.