Empty ETW message in Windows Device Portal - c#

I’m trying to log some stuff to ETW on my UWP application deployed to RPI2 (Windows IOT v.10.0.15063.0). On device portal I can see new logs but message is empty (payload gives me: “stringmessage:,”)
var _loggingChannel = new LoggingChannel("HA4IoT", null, new Guid("4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a"));
_loggingChannel.LogMessage("Test", LoggingLevel.Information);
I’m trying to use LogEvent instead but any string field behaves like that - values logged are empty and saved CSV also have no data about logged stuff.

Sorry you hit this - there's a known regression in the ETW parsing logic in the Creator's Update for Device Portal that we're working to fix. Right now we don't have a workaround except to write a WPR profile and collect an ETL, and use the ETL to collect your logs.
You can track our fix here: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/18591439-loggingchannel-not-showing-string-message-content
I'll update it when the code is fixed in an Insiders flight, and then once we know if the fix can be backported.
Update: This is fixed in the Fall Creators Update, and has been in flights for a couple months. Expect to see it in the next update of Windows across platforms.

On my Raspberry Pi2 it works. I copied your code and executed it.
My Windows IoT Core 10 version is: 10.0.14393.67
The result looks like this:
I set the target version of the IoT background application to the following:
The CSV export also looks fine on my machine:
Timestamp,Provider,ID
04/27/2017-21:23:36.8150656,HA4IoT,0,Keyword:1,Level:4,ProviderName:HA4IoT,StringMessage:Test,TaskName:LogMsgInformation,WebbCompletePayload:stringmessage:test,
Best regards,
Christian

Related

Cannot create valid ProvisioningTransportHandlerMqtt

I am trying to create a IoT DPS device with a symmetric key, For that to work, I need a ProvisioningTransportHandlerMqtt.
I have tried the console application fromlearn: https://learn.microsoft.com/en-us/azure/iot-dps/how-to-legacy-device-symm-key?tabs=windows&pivots=programming-language-csharp and I can provision devices with it.
I have tried making an interactive .Net notebook, and I can also provision devices from that:
The issue is only in my own cs file. When I try to run a similar line in a cs file the object is different:
The samplecode from Microsoft produces a valid transportHandeler:
I have no clue how to create a proper transportHandler. How do I get a proper ProvisioningTransportHandlerMqtt()?
Turned out including the DotNetty dlls in my app solved the issue.

RaspberryPi bluetooth le application always asks for pairing on iOS

Im currently working on a Mobile application which connects to a Ble peripheral and reads data from it. In order to test if the connection is working. I have written a small C# application that utilizes the RaspberryPi4 bluetooth via DBus with BlueZ.
Everything works except that when connecting to iOS a pairing request is issued by the raspberry, eventhough I do not have any encrypted characteristics.
I have read on the Apple forum that this is because bluetoothd is automaticly trying to read the battery level of the phone. But sadly even after the fix suggested there I get the pairing requests.
Does anyone have an idea how I could fix this?
Thanks in advance
I believe disabling this bluez config option in /etc/bluetooth/main.conf would prevent the pi from trying to read characteristics from the iOS device, if that is the issue:
# Do reverse service discovery for previously unknown devices that connect to
# us. For BR/EDR this option is really only needed for qualification since the
# BITE tester doesn't like us doing reverse SDP for some test cases, for LE
# this disables the GATT client functionally so it can be used in system which
# can only operate as peripheral.
# Defaults to 'true'.
#ReverseServiceDiscovery = true
Check the connection min and max intervals, they shall be compliant with the iOS guidelines: https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf (page 180 - 40.6 Connection Parameters).
You can tune them like this:
echo "30" > /sys/kernel/debug/bluetooth/hci0/conn_min_interval
echo "45" > /sys/kernel/debug/bluetooth/hci0/conn_min_interval
The default values worked for me: [24,40]

How to scan for another device through Bluetooth- Xamarin

I'm developing Xamarin application using Visual Studio 2019. I have to connect to another device through Bluetooth and send some data and receive acknowledgement back. Tried these two samples out
https://github.com/msthrax/BLEApp
and
https://github.com/didourebai/BLEPluginDemo.
But didn't help me while scanning for nearby Bluetooth devices, since the below codes are not giving expected result respectively..
1.
listView_DeviceList.ItemsSource = CrossBluetooth.Adaptor.GetListOfDiscoveredDevices();
and
2.
adapter.DeviceDiscovered += (s, a) =>
{
deviceList.Add(a.Device);
};
Both Bluetooth and location turned on in my devices. Can anyone let me know the possibilities of problem here. I don't have any build errors in both of the above samples. Whereas, I have one surprise also. Below line is giving proper result, which is of no use for me currently.
listView_PairedDeviceList.ItemsSource = CrossBluetooth.Adaptor.GetPairedDevices();
After enabling the Location Permission for the app(earlier, I turned on Device Location, but we should allow the app to get device location), all my above problems are solved out.

Error 404 when using Xbox Live SDK Leaderboards

I’ve built a game (C#, UWP, Monogame) and want to integrate it with Xbox Live SDK (Microsoft.Xbox.Live.SDK.WinRT.UWP from NuGet).
Already got auth working but experiencing some problems with StatisticManager/Leaderboard.
What exactly am I doing:
Add user with StatisticManager.AddLocalUser(user) and wait for StatisticEventType.LocalUserAdded event from DoWork
Save score with StatisticManager.SetStatisticNumberData(user, leaderboardName, data) and wait for StatisticEventType.StatisticUpdateComplete event from DoWork
Get the leaderboard with StatisticManager.GetLeaderboard(user, leaderboardName, query) and wait for StatisticEventType.GetLeaderboardComplete event from DoWork
On step 3 I get a C++ exception:
“Not found (404)”.
[This looks very similar to this issue](Exceptions and Error 404 when using StatsManager
).
So I’ve already checked the sandbox ID, config file and leaderboard ID but still get the same result.
I did capture the traffic from HTTP monitoring and I see URL like:
"https://leaderboards.xboxlive.com/scids/{scid}/leaderboards/stat({leaderboardId})?xuid={myXboxId}&maxItems=5"
under development, you must change your Xbox SANDBOX from RETAIL to {your sandbox} using XboxLiveTools (you can find it in github).
after published you can switch it back to RETAIL,and if there is no data in leaderboard return result with zero row no exception throw
I fixed the same problem by myself

extendedExecutionSession : Can we run UWP like Desktop app without Suspending?

I'm planing to start a UWP application that monitor a sensor data for 365 days and save all data to database(Sqlite).
I still worry about UWP capability. Please advice me Which should I use (UWP/WPF) ? I want to use better UI, than, I want to use UWP if possible...
UWP-Suspending is my worry.
With this post, Some people said a way to prevent a UWP application from suspending..
var extendedExecutionSession = new ExtendedExecutionSession();
extendedExecutionSession.Reason = ExtendedExecutionReason.Unspecified;
var extendedExecutionResult = await extendedExecutionSession.RequestExtensionAsync();
if (extendedExecutionResult != ExtendedExecutionResult.Allowed)
{
//extended execution session revoked
extendedExecutionSession.Dispose();
extendedExecutionSession = null;
}
Question
If I wrote this code in UWP app, Can I use a UWP application like Desktop WPF application ? I want to run my UWP application for 365 days without stopping
.. even if user do "minimized" on desktop... Please advice it...
Yes, you can do that with ExtendedExecution. One thing to note is when you run on battery (e.g. laptop, tablet) you will get suspended after some time - however you can prevent that as well by going into the Battery settings page and set your app as "Always Allowed".
Details are documented here: https://learn.microsoft.com/en-us/windows/uwp/launch-resume/run-minimized-with-extended-execution

Categories