Trying to connect particle electron after all the updates and server problems [WORK AROUND FOUND]

You may do ping from your PC. What IP does your hardware show?

@slimfetz ok. I see in logs your app logins, but no hardware logins. So it make me think something wrong with hardware setup. As temporary solution you may try to put those IP in sketch.

Something like that

Blynk.begin(auth, SSID, pass, IPAddress(XXX,XXX,XXX,XXX));

I don’t know what SSID and password would be

This is Wi-fi network name

i’m not using wifi it is cellular connected. My PC is not going to be connected to my hardware. Hardware is normally in remote location.

Can you post up the code that was working before?

// This #include statement was automatically added by the Particle IDE.
#include “blynk/blynk.h”

STARTUP(cellular_credentials_set(“apn.konekt.io”, “”, “”, NULL)); //uncomment for cellular

char auth[] = “xxxxxxxxxx”;

int power_input = C0;
int press_input = D4;
int pump_output = D0;
int press_analog = A0;
int pressure;
int moisture;
int temp;
bool manual_on = false;
bool auto_on = false;
unsigned long start;
unsigned long start5;
unsigned long start10;
unsigned long start20;
unsigned long start30;
unsigned long timeroll = 5000;

void setup() {
Serial.begin(9600);
Blynk.begin(auth);
Serial1.begin (9600);
pinMode(press_input,INPUT_PULLDOWN);
pinMode(pump_output,OUTPUT);
pinMode(power_input,INPUT);
digitalWrite (pump_output,LOW);
}

void loop() {

pressure = analogRead(press_analog);
pressure = map(pressure, 369, 3599, 0, 100);

if (timeroll > millis()){
start = millis();
start5 = start;
start10 = start;
start20 = start;
start30 = start;
}

Blynk.run();
if (manual_on == true || auto_on ==true){
digitalWrite (pump_output,HIGH);
if(digitalRead (power_input) == LOW){ // switch to low
digitalWrite (pump_output,LOW);
manual_on = false;
auto_on = false;
Blynk.virtualWrite(V3,“OFF”);
Particle.publish(“POWCLAY”);
}
}

(I took out all the irrelevant stuff further)

So it might be a case of Konekt needing to update it’s DNS records… But I would have thought that would have been done by now…

1 Like

how do I check on that? Is that completely out of my control if that is the case?

Remember before when I said i solved the problem by setting my DNS to 8.8.8.8 in my wifi router?

In your case the router is operated by Konekt…

1 Like

Ok Dave, as a troubleshooting step I hooked up a particle sim card and different electron and I have the same result. Device not in network. the serial says invalid auth token :tired_face:

@Dmitriy does this latest info help?

I used a photon with the same code and just changed pins so that the code would work and the app will connect using wifi. It is definitely a problem only involving cellular.

so without wanting to offend you or disparage your intelligence, have you checked:

https://community.konekt.io/

unfortunately yes :cry: but I also get the same result from particles sim card. I get cellular connectivity but no connection to blynk

@vshymanskyy not sure if this is a blynk problem or a particle problem. When I was using particle 0.5.1-rc.1 pre release my electron was working with blynk. After it was working it was taken out of service for about a month. After trying to hook everything back up and make code adjustments the 0.5.1-rc.1 is no longer an option on the build IDE so I had to update my firmware to 5.1 After I updated 5.1 and I found blynk also had some server issues and migrated their servers and I had to update my blynk library. So after updating particle firmware to 5.1 and blynk firmware to 3.5 and writing some new code my blynk app that was working before on 0.5.1-rc.1 with blynks older firmware will not work. The error I get back from the serial monitor is invalid auth token. I know the auth token is correct as it has been verifed several times and I used the exact same code and firmware with only changed pinouts and I can connect to blynk with a photon. I have tried downgrading firmware back to 0.5.1-rc.1 but it will not work as the build IDE wont let me select 0.5.1-rc.1 as an option for building any longer it only lets me use 5.1 or 5.0 and I can not use 5.0 because that is the firmware with the original electron problem that needed fixed to begin with. Basically I don’t know if this is a blynk library issue or a particle firmware issue as it was running on a previous version of both and now will only work with a photon. Any help would be greatly appreciated I’ve been banging my head on this for a week :weary:

@Dave1829 @Dmitriy Wow Dave, think you were spot on with your DNS update. I find it strange that both konekt and particle both have not updated their DNS. I made a clone of the blynk firmware and changed #define BLYNK_DEFAULT_DOMAIN from “blynk-cloud.com” to “45.55.130.102” and my electron is up and running smoothly. Thank you both for your help I used a combination of both of your information :grin:

1 Like

@slimfetz glad you did it. Please don’t forget in future to switch back to host (when it will start working for you). To avoid possible problems in future.

I too am having trouble with the Particle Electron build v0.5.1 and Blynk 0.3.5 library always giving me an ‘invalid auth token’ error when looking at the logs.

I took the conclusion from @slimfetz and instead of cloning the blynk firmware, I used one of the overloaded begin methods. There is a begin method that takes the auth token, IPAddress and port. When I changed the ‘begin’ call to look like below running on the Electron started to work for me.

Blynk.begin("your auth token here", IPAddress(45,55,130,102), 8442);

obviously this is less than ideal. What needs to happen for us to use the host instead of the IP address? Where can I log a request to make that happen?

Thanks to everyone that contributed in this thread. The information here helped me figure out what was going on.

1 Like