no functionality after variable number of swipes
aoster opened this issue · 4 comments
Hi Bee-Mar,
the last two days I have played around with your module but have not been able to get it to work properly. When the module is freshly loaded through a MM restart, it sometimes works for several swipes. I first thought that my sensors might be faulty, but this does not seem to be the case as I constantly get measurements when using the swiper executable fom CLI.
As you have written in your manual you also faced this behavior when configuring delays smaller than 1000. Unfortunately my system is not stable even with much higher values.
I therefore have changed the code of the swiper application a little to only send data to stdout when the difference of the measurements of the LEFT and RIGHT sensor has a defined value ( in my case 20). With this change I have made sure, that the node_helper will not be overwhelmed by to much data. This change, however, did not completely resolve the issue.
As the next step I got rid of the sudo workaround by adding the pi user to the gpio group ( sudo usermod -a -G gpio pi ) and changing the child_process in node_helper.js:
// creating demon spawn
const { spawn } = require('child_process');
const child = spawn( __dirname + '/swiper', [ JSON.stringify(payload), ], { detached: true, stdio: [ 'ignore' ] });
child.unref();
With this in place MM can now be properly shut down.
I have recognized, that when the measurements stop to propagate from the swiper application to the modules node_helper the sensors have to be power-cycled to use them again. It seems to me as if the trigger lines somehow stop to work.
This does not happen when using swiper from the command line.
Did you find out what could be the cause of the issue and how it could be fixed ?
Thank you for your kind help.
Andreas
@aoster this is something I’ll have to look into. It’s odd that people have experienced some issues with this when I haven’t experienced any at all. However, since this seems to be problematic, I’ll investigate and keep you up to date
Hello Bee-Mar,
first of all I would like to wish you a happy New Year, I hope you have had a good start.
I have just realized, that the swiper applications does also seems to show unreliable behavior when MM is started in parallel. All my previous tests with the swiper application have been done with MM in shut down state. I have now started MM without the MMM-Simple-Swiper module.
I am wondering if this could be a software issue or some low power problem.
Thank you for your kind support.
Best regards
Andraes
Hello Bee-Mar,
could it be possible that, while MM is running, the 10µs trigger signal can not be properly generated due to higher CPU load on the Raspberry Pi ( Pi 3 B+ ) ?
Which Pi model do you use ? Which modules have you installed/active on your MM ?
Best regards
Andreas
Hi Bee-Mar,
I have played around a little with process priorities. I have raised the prio of the swiper process but this did not change anything. I have observed however, that the swiper process starts using up 100 % CPU on one of the Raspi cores when it stops to respond.
Best regards
Andreas