Author Topic: Sensor data logging error when connecting through WIFI extension  (Read 1058 times)

wengzh

  • Newbie
  • *
  • Posts: 5
    • View Profile
I am using "1 x Master brick + 1 x WIFI extension 2.0 + 1 x humidity 2.0 sensor" to collect environmental data in a research project pilot study. They all connect properly and I can see real-time data being updated on the Brick Viewer interface.

However When I try to log the data into a csv file, the following error always occurs repeatedly:
"Did not receive response for function *... in time (-1)"
I have tried different time-steps (from 10 miliseconds to 5 seconds), and on different PCs and MACs, and the same error remains.

If I am connecting the Master Brick directly with a USB, then the error disapears, so presumably this error is caused by unstable data-exchange with the WIFI extension?

Any insight on this error would be very much appreciated!

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.135
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #1 on: October 22, 2018, 10:09:08 »
Normally the timeout for a getter is set to 2.5 seconds, but in your log you get the timeout sometimes 2 times in 2 seconds.

Do you use the logger in the Brick Viewer or do you have your own program? If the latter, can you post the code?
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

wengzh

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #2 on: October 23, 2018, 11:11:31 »
Thank you very much for getting back to me.

I am using the Brick Viewer at the moment, and the Brick logger for logging the data.

Please find attached another datasheet where the data were set to be logged every 10 milisecond, and this error can occur multiple times in one second.

P.S. I use a USB cable connecting to another PC to power the stack (1 x Master Brick + 1 WIFI Extension 2.0 + 1 Humidity 2.0), would that cause any problem?

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.135
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #3 on: October 23, 2018, 11:18:58 »
P.S. I use a USB cable connecting to another PC to power the stack (1 x Master Brick + 1 WIFI Extension 2.0 + 1 Humidity 2.0), would that cause any problem?

You can use the USB cable to power it, but you can't open the Brick Viewer or run another program on you PC that uses the USB connection. The Brick internally does a routing of the messages (routing to WIFI or USB or into the stack etc). It can't route to two outgoing connections. So if you communicate through USB and through WIFI, this may cause this problem.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

wengzh

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #4 on: October 23, 2018, 13:14:51 »
Thank you for the advice and I am now powering the stack with a power plug. Please see attached image on the set-up.

However the error remains as the same as my previous set-up.

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.135
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #5 on: October 23, 2018, 13:42:44 »
Thank you for the drawing, very nice :).

I will have to try to reproduce this. I wrote it on my TODO list, will probably be able to do it on Thursday.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

wengzh

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #6 on: October 23, 2018, 13:48:33 »
Thank you very much. Looking forward to discussing further after your test.

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.135
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #7 on: October 25, 2018, 10:45:08 »
Unfortunately i can't reproduce the problem.

Attached you can find the log of the logger and a screenshot of the WIFI Extension configuration that i used.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

wengzh

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #8 on: October 25, 2018, 13:58:21 »
Thank you very much for the update! I've checked my wifi status, and there seems to be an issue with my Client mode connection (Please see attached image). The signal strength is very different from yours.

I then set the connection mode to Access Point only, and the data logging error disappears.

We might need to build a network of sensors in a large number of rooms and send data using a WIFI mesh or an alternative option to a database server, would the issue with the Client mode be a problem in this case?

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.135
    • View Profile
Re: Sensor data logging error when connecting through WIFI extension
« Reply #9 on: October 25, 2018, 14:32:24 »
Maybe it is problematic if the client mode is configured to an AP that does not exist and the connection always fails?

But in mesh mode this is not the case, so i wouldn't expect any problems there.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!