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

Problem with Raspberry Pi #13

Closed
MartinF95 opened this issue Jul 30, 2018 · 1 comment
Closed

Problem with Raspberry Pi #13

MartinF95 opened this issue Jul 30, 2018 · 1 comment

Comments

@MartinF95
Copy link

I've used this Code with Mono on a Raspberry Pi but it doesn't work. The same Code works with Visual Studio on Windows. On Windows i get "NTP OK" and on the Raspberry I get "NTP ERORR".

    public static void CheckTimeOK()
    {
        var client = new Yort.Ntp.NtpClient("130.149.17.21");    
        client.TimeReceived += Client_TimeReceived;
        client.ErrorOccurred += Client_ErrorOccurred;
        client.BeginRequestTime();
    }

    public static void Client_ErrorOccurred(object sender, NtpNetworkErrorEventArgs e)
    {
        Console.WriteLine("NTP ERROR");
    }

    public static void Client_TimeReceived(object sender, NtpTimeReceivedEventArgs e)
    {
        System.Diagnostics.Debug.WriteLine(e.CurrentTime);
        Console.WriteLine("NTP ok");
    }
@Yortw
Copy link
Owner

Yortw commented Jul 30, 2018

Hi,

There were a few problems with the Xamarin iOS and Android versions where the underlying monoruntime lied about supporting DnsEndpoint (or similar, I forget the details now). It could be the same thing but I can't tell because no error details are included.

Could you check you are using the latest package, and if the error still occurs, print the full exception details in your Client_ErrorOccurred event handler? The exception object should be included as part of the exception arguments (e in your exception handler above).

Thanks.

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