Author Topic: waiting for data  (Read 2852 times)

dale.s

  • NewMember
  • *
  • Posts: 14
waiting for data
« on: August 07, 2015, 12:12:48 AM »
After i got everything working great, i suddenly get a new problem :(

When i connect to the gateway i get the socket, then get stuck on "waiting for data".  if i ssh to the gateway and run top, i see that node is using 97%+ of the cpu.  Before i download the new image and start over anybody run into this before and know a quick fix?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for data
« Reply #1 on: August 07, 2015, 10:24:37 AM »
dale.s,
When you say "got everything working great".... what does that mean? Did it work (ie webpage loaded socket and showed the UI) and then it stopped working without any reason?
Can you try to restart the socket?

> cd ~/moteino
> pkill node
>  node gateway.js &
     (temporary start, this outputs any errors to the console, prefix this with nohup to make it permanent after you make sure there are no errors in starting the gateway socket script)

dale.s

  • NewMember
  • *
  • Posts: 14
Re: waiting for data
« Reply #2 on: August 07, 2015, 10:41:49 AM »
I had it 100% working, connecting perfectly, displaying nodes.  i think i rebooted (might have been shutdown, was late last night) now i get the socket problems.

Restarting the socket via command line or init.d script results in the same 97% cpu use and no response (although it does connect to the socket, just not get any data)

No errors get displayed, only output is the dbCompact line then the connection accepted line
« Last Edit: August 07, 2015, 10:43:21 AM by dale.s »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for data
« Reply #3 on: August 07, 2015, 04:04:01 PM »
That's normal, for a while. It can take about 30 seconds for the socket to recycle the DB if there's a lot of data in it. If it worked the first time I see no reason why it should not work after a reboot. Essentially nothing has changed, and a reboot is == to initial boot.

dale.s

  • NewMember
  • *
  • Posts: 14
Re: waiting for data
« Reply #4 on: August 07, 2015, 08:14:37 PM »
So i accually got connected, dont know how, left it trying when i went shopping and it had the main page displayed when i got back, yay!  Now there is defiantly some problem with the websockets, no idea what.  Just to be sure i download your latest image and im running on that, also apt-get update, upgrade and npm update.

If you view the network data info in firefox/chrome i get this

Code: [Select]
Status 101 (Switching protocol) on /socket.io/?EIO=3&transport=websocket&sid=w5RgduPFC0Rtt29gAAAC 

It seems it has a problem accually connecting too and/or keeping the websocket open.

If i try to make any changes once i finally get connected (marking a sensor hidden, deleting a sensor ect) nothing is saved, raw data log shows nothing.  Reloading the page (after the 10-15mins to get the data) reverts all changes made.

-- i just checked back on the gateway tab i still have open and the sensor i marked to hidden 20mins ago is finally hidden, however the one i set right after is still not.

edit:  Should the node process be using 100% cpu?  That could account for the delays if there is just no CPU left to accually handle the websocket.
« Last Edit: August 07, 2015, 08:25:24 PM by dale.s »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for data
« Reply #5 on: August 09, 2015, 08:20:05 PM »
The node process should not use much CPU, except when it does DB intensive processing/recycling. So maybe something else is going on .. what is the Pi you are running this on?

dale.s

  • NewMember
  • *
  • Posts: 14
Re: waiting for data
« Reply #6 on: August 10, 2015, 12:41:52 PM »
The pi is a regular B, not the B+
i noticed it starts at 75% cpu, then climbs to 97% within 10 seconds, then stays there all the time.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for data
« Reply #7 on: August 10, 2015, 02:05:53 PM »
That's strange. It should not do that, I don't think an older model should make a difference.
Any chance you could try a fresh install on another Pi?

dale.s

  • NewMember
  • *
  • Posts: 14
Re: waiting for data
« Reply #8 on: August 10, 2015, 02:47:57 PM »
Sadly i only have the one pi atm, i think ill try setting-up with the walk through instead of the image and see if there is a difference.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: waiting for data
« Reply #9 on: August 10, 2015, 02:50:03 PM »
Ok, let us know how that goes.