jefffhaynes / XBee

A .NET library for XBee wireless controllers
MIT License
40 stars 16 forks source link

ForceSample() does not cause SampleReceived event to fire #46

Open PaulHeitkemper opened 6 years ago

PaulHeitkemper commented 6 years ago

Is there a way to get the state of the digital input pins on startup? I tried manually setting IR to 1, to 100, changing the value of IC, but nothing works. node.ForceSamples() does not seem to have any effect.

What should I set up for periodic sampling? Sorry, I guess this inadvertently became two questions.

jefffhaynes commented 6 years ago

ForceSampleAsync should fire the SampleReceived event and you can use SetSampleRateAsync to set the sample rate. I can't think offhand of any way to synchronously read the pin values.

PaulHeitkemper commented 6 years ago

Then perhaps we should treat this incident as "ForceSamples() does not cause samples received event to fire.

On Mar 6, 2018 8:20 PM, "Jeff Haynes" notifications@github.com wrote:

ForceSampleAsync should fire the SampleReceived event and you can use SetSampleRateAsync to set the sample rate. I can't think offhand of any way to synchronously read the pin values.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jefffhaynes/XBee/issues/46#issuecomment-370988747, or mute the thread https://github.com/notifications/unsubscribe-auth/AiHY1B5mXAbrritNjdChg2a5eNiAED_Aks5tbzXWgaJpZM4Sd0rV .

jefffhaynes commented 6 years ago

Hm, ok I’ll take a look

— If you want to build a ship, don't drum up people to collect wood and don't assign them tasks and work, but rather teach them to long for the endless immensity of the sea.

Antoine de Saint-Exupery


From: PaulHeitkemper notifications@github.com Sent: Tuesday, March 6, 2018 8:44:35 PM To: jefffhaynes/XBee Cc: Jeff Haynes; Comment Subject: Re: [jefffhaynes/XBee] How to determine initial Input state? (#46)

Then perhaps we should treat this incident as "ForceSamples() does not cause samples received event to fire. X

On Mar 6, 2018 8:20 PM, "Jeff Haynes" notifications@github.com wrote:

ForceSampleAsync should fire the SampleReceived event and you can use SetSampleRateAsync to set the sample rate. I can't think offhand of any way to synchronously read the pin values.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jefffhaynes/XBee/issues/46#issuecomment-370988747, or mute the thread https://github.com/notifications/unsubscribe-auth/AiHY1B5mXAbrritNjdChg2a5eNiAED_Aks5tbzXWgaJpZM4Sd0rV .

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jefffhaynes/XBee/issues/46#issuecomment-370993119, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJSKR62l9fdEl35tq1cgNlX8ZRRHHzwfks5tbzuDgaJpZM4Sd0rV.

PaulHeitkemper commented 6 years ago

Title changed to better reflect problem description.

jefffhaynes commented 6 years ago

Do you know if you were trying this with an end device or a coordinator? I have a S2C here that I can't get to send a sample locally, even with the X-CTU...

PaulHeitkemper commented 6 years ago

The local device was a XBee PRO 900HP 200K set as Standard Router (CE=0). The remote device I was trying to send the ForceSample() command to was the same type device set as Non-Routing Module (CE=2)