Hi Pedro,

On Wed, Aug 19, 2020 at 11:59 AM [email protected] <[email protected]> wrote:

> How can i send a command to a device? I think i need to reboot the device
> when installing https://github.com/openwisp/lua-monitoring/issues/10  to
> work.


you should not need to reboot the device to install the monitoring scripts
into the device, does your firmware have the packages already pre-installed
or do you install them by hand or with a script?

The problem may be due to the fact that the current way to install the
monitoring scripts is a template
<https://gist.github.com/nemesisdesign/cb005dc80a75536cf8537105c3038a71> which
deploys a crontab to the device:
by default, OpenWRT does not contain a crontab file, which will cause the
cron process to not start.
When the cron is installed by OpenWISP, the cron process may not be running
and the reload script will not start it (because reload operations only
reload running processes, they don't start non running processes).

One solution is to include an empty crontab file in the firmware image,
which makes cron start and do nothing, but it will work out of the box when
installing the template.

Another solution is to ensure the crontab is started at boot with a couple
of commands:

touch /etc/crontabs/root
/etc/init.d/cron start

I updated the monitoring template example
<https://gist.github.com/nemesisdesign/cb005dc80a75536cf8537105c3038a71> to
include an /etc/rc.local script (executed at boot) which does this.

Regarding sending commands to devices, OpenWISP does not have this feature
yet, but it's on my todo list for the next release, I just noticed it was
not in the issue list so I created the issue of the things I will be
implementing: https://github.com/openwisp/openwisp-controller/issues/253
It's a feature many people have asked, although in my experience, once the
system is set up correctly, it will not be really needed, but I understand
it's handy for many situations so I'll be working on it.

 I hope this helps to fix the issue you're having! Let me know.

Federico

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAERYH6UCYtuTg5JQumyyLxTJHN7fVjCMLS0zVTgjQ%3DcnbcSPZQ%40mail.gmail.com.

Reply via email to