Local server confusing dashboards

Hi,

I think I’ve discovered an issue with the Blynk local server getting dashboards confused and displaying the wrong info to the wrong dashboard.

I’m running Blynk local server v0.7.3 on my Linux box.

I have written an program, running on the same machine, that will bridge my Panstamp network to the Blynk local server. To the Blynk server it appears as a generic hardware device, and uses the same authentication token as one of the dashboards. I’ve configured it to send a battery voltage to the Blynk server on pin v1. On my IOS device I have the Panstamp dashboard that has the same authentication token it displays the voltage on a gauge.

I have also created another program, running on the same machine, which bridges my ls30 alarm system to the Blynk local server. Again it appears to the Blynk server as a generic hardware device, although it is using a different authentication token. The Alarm dashboard is a bunch of leds that display the open/close state of the sensors. I have a test sensor sending it’s state on pin v1, so the led on the dashboard changes state to match the sensor.

If I only have one of my programs running, everything works fine and the dashboards behave as expected.

If I have both of my programs running then the server doesn’t seem able to separate the pins and the dashboard will display whatever was the last value to arrive on the v1 pin, regardless of which program/hardware sent it.

For example, if I have the Alarm dashboard running, then when I open the sensor (on v1) the led lights on the IOS device, when I close the sensor the led goes out. If my Panstamp hardware then sends a voltage of 1.3 (on v1) the led will light again.

This only seems to be an issue for the dashboard on the IOS device. When I check the data files, the server is managing to keep the two v1 pins separate, so I have one file that is keeping all the voltages from the Panstamp hardware and I have a different file that has the values from the Alarm hardware.

I would normally thing that I have the authentication tokens confused, but I’ve check the sockets and the tokens from the programs are different and the values are being sent on different sockets/ports, although on the same machine. Also the fact that it is storing the data to different data files indicates to me that the server is able to keep things separate for the data recording code.

Any suggestions on where to go from here, or what I should be capturing?

BTW. I’ve discovered that you can only have one dashboard active at a time :-(. Also the logging on the server lets me know that a signal has arrived (ping, hardware etc) but doesn’t give an indication which hardware/socket sent the signal.

Thanks

@NickM wow! Thank you for such detailed description!

This is server bug. I’ll fix it today. Thank you again!

@NickM

Made a fix and made new release version. Please try it. https://github.com/blynkkk/blynk-server/releases/tag/v0.7.4

1 Like

Thanks Dmitriy,

That fixed it, the problem isn’t in the v0.7.4 version.

Now my problem is that the app keeps timing out. On my TCP trace I can see the server sending a 53 byte packet to the device every so often, but the only thing I can see from the device is the TCP ACK returning.

The server keeps this up for a while (it seems like 5 minutes) and then clears the socket to the device.

It puts this into the log;

21:38:51.203 TRACE - Application timeout disconnect.
21:38:51.204 TRACE - Application channel disconnect.

I think I’ve read that this may be an app thing and I have to wait for the next version of the app to get through Apples checks…

In case app is inactive for 10 minutes (no any requests from application) server drops connection. You could change this via app.socket.idle.timeout property. See documentation for details. Or you could just add some widget with frequency interval.

Let me know if that helps.

1 Like

Thanks, I extended the idle time to 15 minutes which helped.

I had assume that the app would be sending a heartbeat to the server, and so the idle time referred to the heartbeat rather than user input. I also assumed that the app would automatically try to reconnect if the connection is dropped, it doesn’t seem to do this.

My dashboard only has a bunch of leds on it, so not much chance of getting user input on that, I’ve put a dummy button on it and have a nodding bird that presses it all the time to keep the connection up :smile:

I had assume that the app would be sending a heartbeat to the server,
and so the idle time referred to the heartbeat rather than user input.

That’s true for hardware, but not for App. in real cases nobody holds Blynk open for long time. Usually users open Blynk for 2-3 minutes and close app.

I also assumed that the app would automatically try to reconnect if the connection is dropped, it doesn’t seem to do this.

It does when user starts doing something.

For your case you could just make idle timeout very big.

Hi Dmitriy,

In my project I am planning to use a spare iPhone as a permanent monitoring station thus it will be ac powered and have the blynk screen open continuously, is there an option to set the timeout to an infinite value?

@Bobbo_SA

You mean for local server?

yes, I’m currently using a local server running on a Pi.

You need to leave

app.socket.idle.timeout=

empty like above or remove it. But I just implemented it, so will be available in next version.

Excellent, just updated to 0.7.4 so doing some more tests.

I have an issue with the bridge dropping connections but I’m doing more troubleshooting to find the cause, will create a new topic if i find something.