Open jadonk opened 6 years ago
The JavaScript library should be asynchronous. What system event can I use to trigger the update rather than an arbitrary stall that could be unreliable?
From @RobertCNelson on January 4, 2018 20:41
can you loop over the dir? it should change from root:root -> root:pwm
From @RobertCNelson on January 4, 2018 20:42
This would be overkill:
https://www.npmjs.com/package/udev
Regards,
From @fivdi on January 23, 2018 20:0
The approach taken by beaglebone-io is to repeatedly access the files until there's no exception.
see https://github.com/julianduque/beaglebone-io/blob/v3.0.0/lib/pwm-output.js#L20-L53 and https://github.com/julianduque/beaglebone-io/blob/v3.0.0/lib/pwm-output.js#L98-L104
As mentioned in the comments it's a bit of a hack but it works.
From @RobertCNelson on January 2, 2018 21:8
Fix in Adafruit-lib: 100ms delay:
https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/c_pwm.c#L415-L418
On first startup, the pwm will fail in user mode:
However, If you re-run it, it works fine, as udev has had time to fix the permissions..
Copied from original issue: jadonk/bonescript#161