Skip to content
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

PCA9685 not working due to onLoop() is not called #485

Open
sepo83 opened this issue Jun 10, 2019 · 3 comments
Open

PCA9685 not working due to onLoop() is not called #485

sepo83 opened this issue Jun 10, 2019 · 3 comments
Labels
Projects

Comments

@sepo83
Copy link

sepo83 commented Jun 10, 2019

The libraries SensorPca9685W, SensorPca9685RGB and SensorPca9685RGBW require their onLoop() function to be called every loop in order to do the color/pwm change. It seems that in V1.8 of NodeManager this is not done every loop.

Workaround: Call the onLoop()-function directely in the loop-funtion of the sketch. For example:
led_b1_rgb.onLoop(NULL);

Is there any "cleaner" solution?

@user2684 user2684 added this to Triage in v1.9 via automation Jun 12, 2019
@user2684 user2684 added the bug label Jun 12, 2019
@user2684
Copy link
Contributor

Hi, thanks for reporting this issue. Theoretically onLoop() is called at any loop() since the latter is just wrapping the first one unless skipped because sleeping or because of a reporting timer set. Isn't it the case? Thanks

@sepo83
Copy link
Author

sepo83 commented Jun 12, 2019

After doing some debugging I think it has something to do with the reporting timer. Every loop I get _evaluateTimer(_measure_timer)=0, _measure_timer=1174, message=0
(debug print was set at the first line of Sensor::loop)

Do I have to set this timer somehow?

I defined the following:
#define NODEMANAGER_DEBUG ON
#define NODEMANAGER_INTERRUPTS ON
#define NODEMANAGER_SLEEP OFF
#define NODEMANAGER_RECEIVE ON
#define NODEMANAGER_DEBUG_VERBOSE ON
#define NODEMANAGER_POWER_MANAGER OFF
#define NODEMANAGER_CONDITIONAL_REPORT OFF
#define NODEMANAGER_EEPROM OFF
#define NODEMANAGER_TIME OFF
#define NODEMANAGER_RTC OFF
#define NODEMANAGER_SD OFF
#define NODEMANAGER_HOOKING OFF
#define NODEMANAGER_OTA_CONFIGURATION OFF
#define NODEMANAGER_SERIAL_INPUT OFF

I configured/set nothing else in before().

@user2684 user2684 moved this from Triage to Bugs in v1.9 Jul 7, 2019
@user2684
Copy link
Contributor

Theoretically, when you set a report timer and if a measure timer is not set explicit, it is just copied over. However, you can set just the measure timer if you wish with:

Sensor::setMeasureTimerMode(timer_mode value)
Sensor::setMeasureTimerValue(unsigned long value)

Something like:

setMeasureTimerMode(TIME_INTERVAL)
setMeasureTimerValue(60)

This is because there is no equivalent for setReportIntervalSeconds() for measure timer, you have to call both explicitly. Try give it a try, if it works, we will add this into this sensor code so the user does not have to make it explicit. Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
v1.9
  
Bugs
Development

No branches or pull requests

2 participants