[SOLVED] Device is offline (using virtual Arduino simulator, USB-link and Local Server)

As i run the blynk app on my android it shows device is offline
At first attempt this project worked out but now its not working?
I am using virtual ports to simulate blynk project on proteus and using local server for that purpose everything that i have learned is implemented same but yet i can’t simulate it.
Please help me out in this one?

You are not giving us enough information.

Android or IOS

Versions of everything.

Show us the sketch that worked and the sketch that doesn’t (if different).

What, if anything, can you see on the Serial Monitor.

Shoe size (optional)

Compulsory :slight_smile:

1 Like

Android or IOS
i am using Android
Versions of everything.
arduino IDE 1.6.4
proteus 8.5 sp0
Virtual Serial ports emulator 0.938.4.846
Show us the sketch that worked and the sketch that doesn’t (if different).
sketches both are same
What, if anything, can you see on the Serial Monitor.
I haven’t checked it but am on it
And sorry I don’t get it about shoe size (optional) what it means

and one thing more i have created circuit in proteus to blink 3 leds from three digital pins 8,9,10 and i have created virtual ports namely COM1 and COM2 and then i have run the local server in order to get the auth token from my blynk app from android which was sent to my email and i copied it from there and then paste it in the simple code in the arduino ide and then copied the hex and elf file to the file where i have saved the proteus file and then in order to connect to blynk i typed the following command ‘blynk-ser.bat -c COM2 -s’ infront of the path C:\Users\xyz\Desktop\libraries\Blynk\scripts and then pressed enter everything fine till that time and after that i interfaced my android mobile with the laptop through vysor app which is help to control your android app from laptop and then opened up mine account on blynk app ip address and everything checked and they were correct and the problem comes here when i run the program then there yellow text appeared saying device is offline and i also disabled my avast but all in vain and yet still trying to get it corrected but…
Code that i am using is,

#include <BlynkSimpleStream.h>
#define BLYNK_PRINT Serial // Enables Serial Monitor

// Pin Assignments
int redPin=8,greenPin=9,bluePin=10;

//Your app authentication token (can be fetched from your blynk app
char auth[] = "d0fe9f19208a4e118c0e6bfafced14b0";

void setup()
  //Set the three LED pins as output

  // Blynk will work through Serial
 Blynk.begin(Serial, auth);

void loop()
  // All the magic is here

Please help me out in this and also thanks for taking into account my problem.

OK, as I understand it (after much Googling) you are using Proteus VSM Simulation in place of an actual Arduino board - https://www.labcenter.com/buy-vsm/#arduino

This is a first for me :stuck_out_tongue_winking_eye: Is there any particular reason you are using software valued at approx $250+ instead of a $5 UNO?

Honestly, I think your issue may be well beyond the scope of this forum… We can’t easily duplicate or troubleshoot a virtual Arduino with you… I mean, how well does it work with Blynk’s USB-link and Local Server, etc.

Well, one shot I guess… Does it have a “serial monitor”? And what, if anything, does it show when you run your “Virtual Arduino”?

Yeah i have found that one and why i prefer 250 than 5 because i have developed a habit to check every circuit first in proteus and then implement it in real life so thats the reason for that
And please suggest to me to take what steps now. Mean if i can’t be implemented in this way should i try it implementing on circuit along with arduino UNO
and i have tried opening serial ports both in arduino IDE but it say port is busy and i used virtual terminal in proteus to open serial monitor there but nothing is shown there just the serial monitor screen appears there.
Thanks for the reply again

Well, at a guess, I think your issue is something to do with the serial ports… the USB-link batch script needs one dedicated port (typically the USB port on the Arduino UNO) to the “virtual arduino”. And the window for that batch script MUST stay open for it to work.

The IDE serial monitor will need another “port” on a SoftwareSerial connection for the diagnostics (which you do NOT have setup in your sketch). Rig this up and it will help you see if the “virtual arduino” is running your script properly or not.

Kay i will follow these instructions
and now i am trying it on real time hope it works
and thanks

Hello @Imran123,
I can confirm that using Proteus VSM, serial port and Blynk works well up to this moment. I believe you came by my tutorials. You may first commence by using Blynk Cloud since Blynk developers changes server.properties parameters leading to make me pull my hair (or residues left). So to narrow down the odds, try the cloud before jumping into local server.

Also check that you adjusted the Virtual COM port baud on Proteus. Start with small program sending data between two Arduino simulation boards using COMPIM to make sure your serial emulator works as expected. Also if you assign COM1 in COMPIM, then COM2 is the one to be written with BlynkSer.bat command

1 Like

Yeah Sir waleed I have red your both tutorials on instructables and tried them and i think the problem with be the blynk cloud server.properties one and i am gonna try it.
and yeah i have changed the baud rate on virtual COMPIM on proteus to 9600 and am using one com for proteus and and other one for connecting blynk and proteus.
Thanks again sir for taking in account this problem.

No problem @Imran123. Just don’t use local server as a start . Login using Blynk cloud server and change your Blynkser.bat calling into blynk-ser.bat -c COM2 without server address -s

This is a first for me :stuck_out_tongue_winking_eye: Is there any particular reason you are using software valued at approx $250+ instead of a $5 UNO?

The value of virtual simulation is way beyond a simple blinking LED :grin: . I work with a client who has a giant cooling system that I need to perform testing on its Blynk logic without compromising the plant. Thanks to Blynk and Proteus, I can simulate the different changes in temperature medium without even leaving my office. So it is worthy when speaking on large scale project to use such a method (at least it worked with me).

Thats The truth and the power of virtual simulation
Thanks sir for the help

That was more a tongue in cheek comment :wink: I can understand the benefits of simulation, it just seemed strange at the time to simulate such a readily available and cheap component… but with some admittedly brief, reading on thir site, I gather this program does much more than just look and act like an UNO.

Anyhow, it still was a first for me to see on this forum, and I am glad someone was aware of it enough to assist… I was wondering if i was going to have to install a trial version just to learn enough to help… such hard work always learning how to play with my toys :smiley:

Best of luck

Hello sir,
I am facing the exact same problem what imran faced. I initially checked with blynk cloud servers and it worked fine. The com ports paired using VSPE are working fine, but blynk app shows device is offline while using local blynk server. One of the com port successfully got connected to local blynk server using the command ’

’ and blynk app also got connected to the server. Can you please help me solving this issue