Blynk local server on wireless router without internet connection

Hello,

I am trying to get my Blynk local server (on a raspberry pi) combined with a particle photon working on a wireless router (the TL-WR710N).
Everything works perfectly as long as the wireless router is connected to the internet. But once I disconnect the wireless router from the internet the particle photon can’t login on the network.

What could be the problem. The wireless router can be set to following modes:

  • wireless router
  • access point
  • client
  • WISP
  • repeater

I would think the wireless router option is the correct one.

Can you help me with this problem?

Thanks in advance,
Bart

Are you connecting to your server with photon using your local IP?

Hello,

The server gets an IP from the wireless router. This works fine.

The problem is that the photon can’t connect to the wireless router unless the router is connected to the internet. Do you mean that the photon needs to get a local IP from the wireless router? And that for the moment (with internet connection) the photon doesn’t get a local IP but it gets an IP form the internetmodem? If that is the case in which mode should I set my wireless router ? Should you want more info, this is my wireless router:

http://uk.tp-link.com/products/details/cat-9_TL-WR710N.html

Thanks in advance,
Bart

Actually I was refering to the IP Adress you wrote in your HW code, did you supply the LOCAL IP of the computer running the server or did you use your WAN IP?

It sounds strange that it should not work without an internet connection on LAN, but it could be the case if you used your external IP and not internal to connect the HW.

@mertensbart20 I would try AP mode as per http://uk.tp-link.com/FAQ-641.html

Some wireless routers will only function in router mode when they detect a DSL connection.
You might be able to overwrite the “locked down router mode”, if that’s the problem, with special firmware like ddwrt.

Not something you should try until you have exhausted all other possibilities first but link provided anyway https://www.dd-wrt.com/phpBB2/viewtopic.php?p=1056835

I used the IP-address that my raspberry pi as server was given. Otherwise it would never have worked.

The seems to that the photon stays in the mode “Connection to the cloud” when my wireless router is diconnected from the internet. That’s why I am wondering if my router should be set to a different mode.

@Costas: I tried the with an AP but this doesn’t solve it (see explanation below)

I am getting closer. It seems that the photon automatically tries to connect to the cloud before executing code. And since I my wireless router is not connected to internet it can’t connect to the cloud and thus it won’t run the code. When I found a solution I’ll post it here.

Hello,

The problem has been solved with some help from the guys from particle. Here is the solution. Put “SYSTEM_MODE(SEMI_AUTOMATIC);” before your “void setup()” and put “WiFi.on();” and “WiFi.connect();” in the setup. This way the photon only connects to your wireless network and not the internet. All the offline code will run.

Below you can find my simple program with the added coded explained above.

Greetings,
Bart

 #include "blynk/blynk.h"
 #define BLYNK_PRINT Serial
 #include "blynk/blynk.h"

char auth[] = "e83bf9f63b3aa3fc895728cff48de341";
IPAddress server_ip (192,168,0,100);

int ledPin = D7;
Servo motor;
Servo actuator;
Servo grijper;
Servo vlag;

SYSTEM_MODE(SEMI_AUTOMATIC);

void setup()
{
    WiFi.on();
    WiFi.connect();
    Serial.begin(9600);
    Blynk.begin(auth, server_ip, 8442);
    vlag.attach(D3);
    grijper.attach(D2);
    actuator.attach(D1);
    motor.attach(D0);
}

void loop()
{
  Blynk.run();

  if (digitalRead(D5)==HIGH)
   {
        vlag.write(133);
        digitalWrite(ledPin, HIGH);
    }
    else
    {
        vlag.write(0);
        digitalWrite(ledPin, LOW);
    }
}

BLYNK_WRITE(V1)
{
  motor.writeMicroseconds(param.asInt());
}
BLYNK_WRITE(V2)
{
  actuator.writeMicroseconds(param.asInt());
}
BLYNK_WRITE(V3)
{
  grijper.writeMicroseconds(param.asInt());
}
1 Like