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

Input5 included in input mask even though it is set as an output. #48

Open
PaulHeitkemper opened this issue Mar 30, 2018 · 3 comments
Open

Comments

@PaulHeitkemper
Copy link

PaulHeitkemper commented Mar 30, 2018

Title says it all. I have all I/O disabled except for input 0 as a digital input, and DIO5 as a Digital Output(low). Pullup is set for all I/O pins. However Input5 comes back very often (but not always) in the input mask when I deassert DIO0. Interestingly, it isn't included when I release my button to let input 0 go high.

@jefffhaynes
Copy link
Owner

jefffhaynes commented Mar 30, 2018 via email

@jefffhaynes
Copy link
Owner

Can you post your code and let me know what device you're using? Thanks

@PaulHeitkemper
Copy link
Author

PaulHeitkemper commented Apr 10, 2018

The following code seems to sometimes give me

DigitalSampleState = Input0, Input12

Despite the fact that Input12 (pin 4) is internally pulled up, disconnected, and disabled in XCTU. Hardware is a XBeePro-900HP as remote unit (shown below as "ButtonAddress"), with same type of module connected to a USB serial board as the controller. remote module has controller address as DH/DL.

using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using XBee.Devices;
using XBee.Frames;
using XBee.Frames.AtCommands;

namespace XBee.Classic.Tester
{
    class Program
    {
        private const InputOutputChannel LedChannel = InputOutputChannel.Channel0;
        private const string ButtonAddress = "0013a20041073502";

        private static XBeeController controller;
        private static XBeeNode node;
        static void Main(string[] args)
        {
            var controllerTask = XBeeController.FindAndOpenAsync(9600);
            controllerTask.Wait();
            controller = controllerTask.Result;

            if (controller == null)
            {
                Console.WriteLine("Could not find controller. Exiting.");
                return;
            }
            controller.SampleReceived += Controller_SampleReceived;
			
            while (true)
            {
                getSignalStrength();
                Thread.Sleep(10000);
            }
        }

        private static void Controller_SampleReceived(object sender, SourcedSampleReceivedEventArgs e)
        {
            Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
            Console.WriteLine("Controller_SampleReceived from {0}", e.Address);
            Console.WriteLine("DigitalSampleState = {0}", e.DigitalSampleState);
        }

        private static void getSignalStrength()
        {
            try
            {
                var t = controller.Local.GetSignalStrengthAsync();
                //var t = node.GetSignalStrengthAsync();
                t.Wait(TimeSpan.FromMilliseconds(700));
                var rssi = t.Result;
                Console.WriteLine("RSSI: {0}", rssi);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception getting RSSI: {0}", ex.Message);
            }
        }
    }
}

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

No branches or pull requests

2 participants