Author Topic: Dummy Node for polling ISP down/up speeds  (Read 7692 times)

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Dummy Node for polling ISP down/up speeds
« Reply #15 on: November 01, 2018, 02:11:33 AM »
well that is something I don't see, where I live. The biggest problem I ever had is then modem died. Was without internet for few hours. I don't have to deal with ping or speeds though, i'm limited by 100Mb/s lan connection of PI


OOO Felix!! stacked graphs!!! That is what many people don't even know that they want, can't wait for it!!

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #16 on: November 03, 2018, 11:29:31 AM »
Something else to add to the Raspberry generated data I'll be adding:

vcgencmd measure_temp
Code: [Select]
temp=67.1'C
This will get the CPU Core temp from the Raspberry Pi and monitor that along with the internet speed. Anything else available for a standard RaspPI?

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Dummy Node for polling ISP down/up speeds
« Reply #17 on: November 03, 2018, 02:33:59 PM »
vcgencmd measure_temp
vcgencmd measure_clock arm
vcgencmd measure_volts core
free -o -h

some are constant I think

What I want to know is, why is you temp so high, my is 42°C pretty much all the time
« Last Edit: November 03, 2018, 02:51:05 PM by LukaQ »

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #18 on: November 04, 2018, 06:28:16 AM »
I have no idea - For hardware, I have a mightyHat installed and a Lipo backup battery and a RasPi 3b+
For software, the Pi is running the usual gateway.js as the main process's that consuming > 60% of CPU all the time.
Is that a normal %?

I've reloaded both the MightyHatgateway.ino and the rasPi files.

On a full reboot of Pi, the CPU will start around 30% and ramp up to 106% within about 5 mins
MEM is about >10 to 40% for that process
Temp runs at a usual 60+

The 'top' command shows the primary command being 'node' - am I wrong to assume that is the gateway.js?

Also checked the pstree and it looks like there is some child process nodes (but I'm not sure I'm reading that screen right).

Not sure how else to troubleshoot this one. Anyone got additional ideas for things to check?


« Last Edit: November 04, 2018, 02:31:27 PM by wile1411 »

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Dummy Node for polling ISP down/up speeds
« Reply #19 on: November 05, 2018, 12:39:56 AM »
Hey,

no that is not normal. I have almost always 0%. In top (I don't know how you see each core) I have most of the time id >99.5%. The only difference is, I have pi3, not the last version, so here might be a problem with something that you have running.

When I run top, I have top process in the first spot, node come here and there

pstree give me 5 nodes and 4 workerthreads, so that is probably fine. I'm sure there is a problem using 3b+, just don't know how to find the problem

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #20 on: November 05, 2018, 01:08:48 AM »
press '1' while in top to see the cores

I've tried both the latest release of gateway.js as well and the latest commit of gateway.js and both have the same results for CPU / temp.
I've 'sudo pkill node' a few times to kill the runaway process. The temp comes back for a bit, but a new node process starts up and gobbles up all the available ram and CPU and is back up there heating the pi at 60+ degree within 5mins. CPU% pegs out at 116%
« Last Edit: November 05, 2018, 02:53:12 AM by wile1411 »

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Dummy Node for polling ISP down/up speeds
« Reply #21 on: November 05, 2018, 04:52:50 AM »
huh, cool, thanks for that
and like i've said, my cpu is almost always idle. Do you have any older PI?

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #22 on: November 05, 2018, 05:23:40 AM »
Nah - only dipped my toe into RasPi due to this Moteino project. I've only used Arduino Uno and Teensy otherwise.

I'm going to try running the following code from this post to see what process is hogging the CPU
Code: [Select]
node --prof gateway.js

And run analysis with
Code: [Select]
node --prof-process generated_tick_file.log


Late Night EDIT:

*sigh* the title of this thread is about right - "Dummy" indeed...

Found that the opening of the serial port from the PI side to the MighyHat (in my case to upload the internet speed data) is what's causing the PI to 'go nuts' with CPU and memory.

Careful watching of the 'top' interface helped confirm the issue. I was able to run the gateway as above and then kicked off the internet download process. I watched the CPU spike immediately after.

So, that's being turned off as of right now  :-[ and I'll hang on patiently for Felix to get around to looking how to do it his way.

I tried to edit the original post to recommend not to do it, but I can no longer edit the old post. I've reported it to the moderator to add a flag to not to use the suggested code.

I let the capture process run for 5mins in thrashing with high temp before terminating it. I've also attached the node analysis of the gateway.js in case Felix finds any useful information in it for future queries from dummies like me.
« Last Edit: November 05, 2018, 07:25:21 AM by wile1411 »

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #23 on: November 05, 2018, 11:55:46 PM »
Just a thought - can I connect a USB cable from the Pi to the MightyHat and utilise the "/dev/ttyUSBx" rather that the previous "/dev/ttyAMA0" to avoid the conflict I created?

I'm assuming I'll need to snip the power cable in the USB cable to prevent the power looping from MightyHat to Raspberry pi back to the MightHat?

LukaQ

  • Sr. Member
  • ****
  • Posts: 302
  • Country: si
Re: Dummy Node for polling ISP down/up speeds
« Reply #24 on: November 06, 2018, 01:26:49 AM »
Yes, you can use either. I've tried both, connected Moteino to RPi, both worked the same. I would remove power yes, no need to open yourself up to potential problems, MH already has power, I would want to supply it over USB also.

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #25 on: November 06, 2018, 02:13:28 AM »
Ergh, just realised the MightyHat doesn't have a seperate USB connector. I forgot that plug is for power.

Bugger it, I'll just wait for Felix and see what he has planned. At the rate I'm going, I'll probably blowupy RasPi or MH trying something.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Dummy Node for polling ISP down/up speeds
« Reply #26 on: November 06, 2018, 01:32:23 PM »
Just a thought - can I connect a USB cable from the Pi to the MightyHat and utilise the "/dev/ttyUSBx" rather that the previous "/dev/ttyAMA0" to avoid the conflict I created?
No, that's only for power, you power the whole thing from the MHat's USB port, instead of using the Pi's USB input power port.
The serial is connected via GPIO directly. There are some jumpers on MHat which you can cut open and rewire it in some other way, but I've never done it so I don't have a specific tutorial on that for you.

Technically you could use an FTDIAdapter or similar USB-serial adapter to power it from the Pi's USB ports, and wire the FTDI header side to the MHat's serial port (only GND, TX/RX). Then you'd find a new serial port on the Pi emulated by the FTDIAdapter.

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #27 on: November 08, 2018, 10:00:29 PM »
Thanks for the suggestion Felix. I might give it a go to see if I can get it working, even as just a proof of concept.

I'll hang tight and see what methods you have planned for getting the internet speeds recorded. Once that's out, I'll review the options and make a decision on if I need an additional dedicated FTDI adaptor for the 2nd serial connection option.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Dummy Node for polling ISP down/up speeds
« Reply #28 on: November 08, 2018, 10:14:18 PM »
Sorry its taking so long.
I keep adding features, and I'm contemplating a major release (vs a minor). So likely a 9.0 at this point.

wile1411

  • Jr. Member
  • **
  • Posts: 54
  • Country: au
Re: Dummy Node for polling ISP down/up speeds
« Reply #29 on: November 08, 2018, 11:23:33 PM »
Wow - sorry my suggestion for comms between PI and HM prompted that amount work for you.  :o Sound like you've dived a bit deep for these changes. I'm sure it's stuff you wanted anyway, but there's no hurry up from here.  8)

Happy to hang back and let you review / rewrite as often as you like. Looking at your release history for the gateway, you seem to do the occasional 6-8mth update that then gets followed be a few 1-2mth updates. Looks like you're in the later cycle at the moment. Hope you get back to the 6-8mth stable period soon :)