-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature to set frequency for pwm output in gpiod node #425
base: master
Are you sure you want to change the base?
Feature to set frequency for pwm output in gpiod node #425
Conversation
Hi, has this been discussed on the mailing list or slack? As per our contribution guidelines that is our preferred starting point for any feature request or proposal. |
Have you checked the underlying library ? |
@dceejay That's why i wrote the note. It's ok to set another value but gpiod will round it to the next valid value. As we don't know what the user is passing as option when starting the daemon (-s option), we don't know which values are appropriate for a dropdown. @knolleary Hi, no yet. As we just started discussing here, should we still went over to the mailing list? |
As you started here, stay here. Just pointing out the contribution guidelines. In fact, I realise we haven't set the pr template in this repo which would have made it clearer... Will fix that up. |
@dceejay I just checked if there's any easy possibility to get the sample rate but didn't found one. So i could make a dropdown with all values possible on all sample rates or leave it as it is. Sorry that i somehow missed that in the contribution guidelines. |
OK - as long as it handles "any" number and picks the closest automatically then that would be better (rather than trying to get into lists based on sample rate etc... - just setting a frequency would be much easier) |
It seems that the default rate is the 6th rate (1-4000, 2-2000, 4-1000, 5-800 , 8-500 , 10-400). As for the default rate 5 leads to a default frequency of 800Hz, that would be the value to choose. |
not sure what you mean by 1-800, 2-800 etc... what are the frequencies ? |
Format: Selected sample rate - Frequency in Hz |
as usual .. it depends :-)... it can set defaults, provide suggestions etc... but if a user sets something it shouldn't then get changed without the user explicitly changing it. (Ie it shouldn't change just by re-opening the config page) |
I asked because the frequency is only changed when the node is deployed or started. But i think i will split it of the node handling if it's possible (need to take all changes like ip, port into account). So only think is how the format of this info should be. Do you prefer text like info text or is it ok to add an input field which is not writeable (maybe next to frequency field)? Should i remove the checkbox or not in despite of the different resulting default frequencies? |
Prefer set into text rather than look like an input you cannot use. |
I figured out 2 ways of getting the current/actual frequency value.
What would you prefer? |
Hmm tricky... having 2nd thoughts. Neither ideal. |
Hi - where did we get to on this ? |
I'm implementing it with the node.status now, but had troubles with get_PWM_frequency(). I need to investigate on that first. It seems that the callback isn't ever called. I do not have access to a Pi until next sunday, so it will take a little bit until i finish this. |
Seems that the callback isn't ever called because there's another command in progress (set_mode() or set_PWM_frequency()). Got it to work so far by adding callbacks for these functions in js-gpio. Need to figure out why this happens. Maybe a restriction of pigpiod socket interface? |
…koman1990/node-red-nodes into feature-setfrequency-for-pwm
Hi did you mean to update this quite so much ? We aren't going to merge 179 file changes... can you flatten it so only the relevant changes are in the PR ? (or close and re-submit)... Thanks |
Hi, no this wasn't intentional. Just wanted to rebase with master branch to get other changes. This somehow went wrong 😕 Sorry. As miketrebilcock/js-pigpio#3 is still not resolved i can't finish this PR. Thinking about to change the underlying library, but i will open a discussion for this in the forum. |
Feature is optional, so old config should still work.
Depending on sample rate setting in gpiod real values can vary.