WinUSB driver on Windows 10 IoT - raspberry-pi2

I'm trying to use the WinUsb.sys driver that comes with Windows (including Windows 10 IoT of Raspberry Pi 2). Using devcon.exe I can see that the USB I'm trying to use is connected (it is named USB\VID_1234&PID_ABCD\5&3753427A&0&4), but I don't know how to force it to use the WinUsb.sys driver.
I found some instructions on microsoft.com but that seems to be for a standard Windows installation where you have Device Manager available (which I don't have on IoT). The INF file example on this page also refers to a CAT-file, which I assume this is some sort of driver signature, and I don't know how to generate this (or if I even need to). There's also a reference to Windows NT (Signature = "$Windows NT$") and I don't know if that needs to be changed for IoT or not (or if anything else needs to be changed for IoT for that matter).
So, using devcon.exe and some sort of INF file, how can I get Windows IoT to use WinUsb.sys as a driver for the USB device I'm attaching?

After a lot of trial and error I finally got it working. Here's a complete INF-file for future reference:
; WinUSB installation file for USB device
[Version]
Signature = "$Windows NT$"
Class = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile = WinUSBInstallation.cat
DriverVer=09/04/2012,13.54.20.543
; ========== Manufacturer/Models sections ===========
[Manufacturer]
%ManufacturerName%=Standard,NTarm
[Standard.NTarm]
%DeviceName% =USB_Install, USB\VID_1234&PID_ABCD
; ========== Class definition ===========
[ClassInstall32]
AddReg = ClassInstall_AddReg
[ClassInstall_AddReg]
HKR,,,,%ClassName%
HKR,,NoInstallClass,,1
HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
HKR,,LowerLogoVersion,,5.2
; =================== Installation ===================
[USB_Install]
Include = winusb.inf
Needs = WINUSB.NT
[USB_Install.Services]
Include =winusb.inf
Needs = WINUSB.NT.Services
[USB_Install.HW]
AddReg=Dev_AddReg
[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{ec55ee47-5758-4378-926b-68ed0aec8170}"
; =================== Strings ===================
[Strings]
ManufacturerName="The name of the company producing your device"
ClassName="Universal Serial Bus devices"
DeviceName="The name of your device"
REG_MULTI_SZ = 0x00010000
Replace the Vendor ID (VID) and Product ID (PID) in [Standard.NTarm] with the corresponding VID and PID of the USB you're adding.
Finally replace the ManufacturerName and DeviceName near the bottom with the correct info for your device.
Put this file somewhere on the Raspberry Pi 2, using either SMB or FTP.
SSH or PowerShell to the Raspberry Pi 2 and go to the folder where you put the INF file.
Run the following command: devcon dp_add .\<name of your INF file>
You should see the following result: Driver package 'oem0.inf' added.
Finally restart the RP2 (shutdown -r -t 0 from SSH/PowerShell).
When the RP2 gets back up your device should be listed under "Connected Devices" on the default startup app, and you should now be able to use functionality from Windows.Devices.Usb to communicate with the USB device.

Related

INSTALL "[AMD/ATI] Tonga XT GL [FirePro S7150]" Graphic Card on a VMu (Centos 6.9) running on XenServer 7.4

Just start using XenServer. Doing some experiment for my company. Installed XenServer 7.4 on a Box and created a Centos 6.9 VMU. Using XenCenter.
Got to the point when I can run the virtual operating system but when I try to use the "Advanced Micro Devices, Inc. [AMD/ATI] Tonga XT GL [FirePro S7150]" graphic card with the command:
xe vgpu-create vm-uuid=xxx-xxx-xxx-xxx gpu-group-uuid=xxx-xxx-xxx-xxx
I receive the following error message:
The use of this feature is restricted.
I have also tried to install the graphic interface (Xen-Center) using a licensed Xen-Server to enable the AMD card using the Tools->Install Update: downloaded and selected the mxgpu-1.0.5.amd.iso to enable the Graphic card but I cannot complete the process as I receive the error message:
The attempt to create a VDI failed
I am running out of option. The CentOS is running but I cannot use the machine AMD graphic card. Can you help?
Could you try running the VM with the virtual disk stored on the same Local Storage repository located on that card's host, and removed from any pools. This is the default configuration, but I'd thought I'd mention these tips in case you have this box somehow mixed in a heterogenous pool. If the machine is part of a pool, make sure that you are not selecting the video adapter to passthrough to the VM of another host's adapter.

WSO2 EMM Agent with COSU not using NFC

I have built the latest version of wso2 emm android agent (cdmf-agent-android v3.1.30) and got some initial tests working in BYOD mode with IoT server 3.1.0
When built for COSU it is waiting for provisioning with another device via NFC. But I want to provision devices without NFC. What options do I have? Could I trigger programmatically a custom provisioning option?
There are some options to do this, depending on your android version.
I will start with the simplest option. If you have Android 7+ you can use QR Code provisioning, this follows the exact same process as NFC provisioning. You can see some specifications from Google regarding this.
The second option is a bit trickier and requires some custom dev on your side. First thing to to make your device a Device Owner (Which is needed for COSU mode, read up about Device Owner here). Using the command: adb shell dpm set-device-owner org.wso2.iot.agent/org.wso2.iot.agent.services.AgentDeviceAdminReceiver
Note: Only one device owner can be set, to remove a device owner the device has to be factory reset.
Once this is done you can launch your app using adb shell am start -n "org.wso2.iot.agent/org.wso2.iot.agent.activities.SplashActivity".
The above will get your app to run correctly but now it has to authenticate itself to communicate to the server. When using NFC provisioning an Access Token is delivered in the Extra Bundle as 'android.app.extra.token', you can insert this extra in the launch intent as follows: adb shell am start -n "org.wso2.iot.agent/org.wso2.iot.agent.activities.SplashActivity" --es android.app.extra.token generated_access_token. You will have to edit the SpashActivity class to accept this token and follow the general authentication processes built into the app.
This may be a little bit late but I hope it is still helpful!
Some extra information you may appreciate, here is a string representation of the NFC message used, these are the specifications set in the NFC Provisioning App:
`
#Thu Apr 12 13:42:11 GMT+02:00 2018
android.app.extra.PROVISIONING_LOCAL_TIME=1523533331087
android.app.extra.PROVISIONING_TIME_ZONE=Asia/Colombo
android.app.extra.PROVISIONING_SKIP_ENCRYPTION=true
android.app.extra.PROVISIONING_WIFI_SECURITY_TYPE=WPA
android.app.extra.PROVISIONING_WIFI_PASSWORD=PASSWORD
android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION=LOCATION_OF_APK
android.app.extra.PROVISIONING_WIFI_SSID="WIFI_SSID_NAME"
android.app.extra.PROVISIONING_LOCALE=en_US
android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM=E8PtiqUOcqKi5IXeRBF-5Br0zXg
android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE=\#admin extras bundle\n\#Thu Apr 12 13\:42\:11 GMT+02\:00 2018\nandroid.app.extra.token\=GENERATED_ACCESS_TOKEN\n
android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME=org.wso2.iot.agent
`
An example of a QR Code representation would be:
`
{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "org.wso2.iot.agent/org.wso2.iot.agent.services.AgentDeviceAdminReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "CSGeivCEHdJrPT0qy4W67LZSy32Fus7GyUn0jE5o028",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "APK_DOWNLOAD_LOCATION",
"android.app.extra.PROVISIONING_SKIP_ENCRYPTION": false,
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME": "org.wso2.iot.agent",
"android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": {
"android.app.extra.token":"GENERATED_ACCESS_TOKEN"
}
}
`

VxWorks issue Can't load boot file

I have an industrial robot arm that has VxWorks running in the controller. I am very new to VxWorks. When I tried to use ftp, there was a password issue. After going through the vxworks boot procedure, I can no longer get the system to boot. I get the following screen through HyperTerminal.
VxWorks System Boot
Copyright 1984-2002 Wind River Systems, Inc.
CPU: PC PENTIUM
Version: VxWorks5.5.1
BSP version: 1.2/2
Creation date: Nov 3 2006, 09:55:58
Press 's' to stop auto-boot...
auto-booting...
boot device : ata
unit number : 0
processor number : 0
host name : NITT
file name : /ata0/vxWorks
inet on ethernet (e) : 192.168.0.253:1947
host inet (h) : 192.168.0.255
user (u) : me
ftp password (pw) : pw
flags (f) : 0x00
other (o) : fei
Attaching to USB disk device...
USBLink, USB Stack Driver, ver 2.02 (build 31/01/2006), staubli rev 1.10
Copyright SoftConnex LLC, 1999. All rights reserved...
UHCI USB Controller initialized ...
Can't load boot file!!
I look at the terse help menue...
[VxWorks Boot]: ?
? - print this list
# - boot (load and go)
p - print boot params
c - change boot params
l - load boot file
g adrs - go to adrs
d adrs[,n] - display memory
m adrs - modify memory
f adrs, nbytes, value - fill memory
t adrs, adrs, nbytes - copy memory
e - print fatal exception
v - print boot logo with version
n netif - print network interface device address
$dev(0,procnum)host:/file h=# e=# b=# g=# u=usr [pw=passwd] f=#
tn=targetname s=script o=other
boot device: ata=ctrl,drive file name: /ata0/vxWorks
boot device: usbstbl file name: /usbdsk0/vxWorks
Boot flags:
0x02 - load local system symbols
0x04 - don't autoboot
0x08 - quick autoboot (no countdown)
0x20 - disable login security
0x40 - use bootp to get boot parameters
0x80 - use tftp to get boot image
0x100 - use proxy arp
available boot devices:Enhanced Network Devices
fei0 fei1 ata usbstbl
[VxWorks Boot]:
The system did previously boot without a PC.
Does anyone see any errors in the parameters?
You have the system configured to load from the ata device. We can see from this line:
available boot devices:Enhanced Network Devices
fei0 fei1 ata usbstbl
that the ata device does exist. So, the most likely explanation is that the file /ata/vxworks no longer exists. Perhaps it has been deleted, or maybe corrupted, or the disk has been formatted. You can check what is on disk using the ls command:
ls /ata
You may be able to recover using another boot method, eg configure to download the boot image via the network or, assuming that usbstb1 is some form of removable storage, by copying a vxworks image onto the system that way.
Using a USB device, you can either modify the boot config to temporarily load the vxworks from the USB (you will need to modify boot device and file name settings), or use the bootloader shell commands to copy the boot file to the target.
Copy file from USB
Using a PC, copy the vxworks image to the USB device - it doesnt matter where, as long as you know where.
Insert the USB into your target.
using the shell commands, copy the file eg
cp /usbdsk0/vxWorks /ata0/vxWorks

Under what conditions would /sys/kernel/debug/gpio be empty?

Summary
My aim is to control the GPIO pins in Peppermint 4 Linux (Kernel version 3.8.0) on an Intel motherboard (NM70 chipset with C1037U processor).
I'm debugging issues I'm having using the sysfs interface and am trying to understand the conditions where /sys/kernel/debug/gpio would be empty?
When attempting to export pins 0 to 255 by
echo XX > /sys/class/gpio/export
for XX from 0 to 255, I get the following error message
echo: write error: No such device
Under what conditions would /sys/kernel/debug/gpio be empty?
 Background
Motherboard: Intel with NM70 chipset
Processor: C1037U processor
OS: Peppermint 4 Linux
Kernel version: 3.8.0
GPIO interface: sysfs
I'm attempting to use the sysfs interface, which allows GPIO pins to be accessed from userspace through the filesystem.
I’ve successfully followed the "Alternate Build Method: The Old-Fashioned Debian Way" section of https://help.ubuntu.com/community/Kernel/Compile to recompile the kernel in order to expose GPIO access in user space and to turn on debug mode for GPIO:
Once the new kernel was compiled, I was able to see the GPIO folder in /sys/class/gpio for the first time. Then, in theory, it should be a case of being able to turn GPIO ports ON/OFF by writing to the filesystem. This approach is outlined at http://falsinsoft.blogspot.co.uk/2012/11/access-gpio-from-linux-user-space.html.
When attempting to export pins 0 to 255 by
echo XX > /sys/class/gpio/export
for XX from 0 to 255, I get the following error message
echo: write error: No such device
When attempting to export pins outside the range 0 to 255 by
echo XX > /sys/class/gpio/export
I get the following error message
echo: write error: Invalid argument
The tutorial suggests this could be because the GPIO ports are reserved for another program and that, if so, the debug file (/sys/kernel/debug/gpio) would be able to show where they are reserved.
However, /sys/kernel/debug/gpio is empty.
I can see and control the GPIO pins in the BIOS (change pins to be input or output HIGH/LOW).
Related questions
writing to /sys/class/gpio/export failing
Enable pullup GPIO
/sys/kernel/debug/gpio will be empty if there no GPIO device registered (warning: when I say GPIO device, I don't mean the piece of hardware, but rather the kernel representation of it).
So, these GPIO devices are registered at runtime by the kernel and associated to a specific GPIO device driver.
In turn, the GPIO device driver is selected and associated to a given device, because it is the one declaring compatibility with said GPIO device.
E.g., the kernel would match on PCI vendor and product ID, and probe a GPIO driver that claims support for that PCI vendor/product. When the GPIO driver is probed, it typically registers the GPIO device instance.
Finally, that registered GPIO device is what provides GPIOs shown in /sys/kernel/debug/gpio.
The above is part of the so-called "Device Driver model" in Linux. Although it's a bit outdated, you can read [1].
Now, let's see what GPIO driver you need to select for your NM70 chipset. Wikipedia says that the chipset codename is "Panther Point-M" [2]. With some luck, the lpc_ich driver could support it. You would have to build your kernel with CONFIG_LPC_ICH=y.
Alternatively, if your GPIOs are provided by a PCI device, you could use lspci to get the IDs, and then grep in the kernel sources for those IDs.
[1] http://www.oreilly.com/openbook/linuxdrive3/book/ch14.pdf
[2] https://en.wikipedia.org/wiki/List_of_Intel_chipsets

Change the channel of a wireless windows 8 hosted network

I've created a hosted wlan network under windows 8 using
netsh wlan set hostednetwork mode=allow ssid=”MySSID” key=”password”
and
netsh wlan show hostednetwork
So far so good, but the channel number is set automatic by netsh. Is there a possibility to change the number manually?
netsh does not support this special configuration. You have to configure channel settings directly on the hardware yourself. In my special case it was possible to set the channel in the device properties of windows. With some older hardware you have to configure the AP through a vendor configuration tool or by modifying the firmware itself in extreme circumstances.
Apparently this is a hardware specific option. For example, on the very common external USB WiFi stick, the Atheros based TP-LINK TL-WN722N (and several others), the channel option is not available on the Advanced properties tab from the Device Manager. Instead, you need to hack the driver INF file for your specific card. To find the driver you use, open an administrative command shell and type:
netsh wlan show all
and then look for the INF file path:
Wireless System Information Summary
(Time: 2015-08-25 11:38:33 FLE Summer Time)
=======================================================================
============================== SHOW DRIVERS ===========================
=======================================================================
Interface name: WiFi 2
Driver : TP-LINK Wireless USB Adapter
Vendor : TP-LINK
Provider : TP-LINK
Date : 2013-11-19
Version : 10.0.0.28
INF file : C:\Windows\INF\oem20.inf
Files : 1 total
C:\Windows\system32\DRIVERS\athuwbx.sys
Type : Native Wi-Fi Driver
Now make a copy of that file and open it in a descent text editor. Look for the [adhocchannelselect.reg] entries. In particular search for the defaultIbssChannel key. In my case it look like this:
HKR, Ndi\params\defaultIbssChannel, ParamDesc, 0, %adhocchannel%
HKR, Ndi\params\defaultIbssChannel, default, 0, "8"
HKR, Ndi\params\defaultIbssChannel, min, 0, "1"
HKR, Ndi\params\defaultIbssChannel, max, 0, "11"
HKR, Ndi\params\defaultIbssChannel, step, 0, "1"
HKR, Ndi\params\defaultIbssChannel, base, 0, "10"
HKR, Ndi\params\defaultIbssChannel, type, 0, "int"
Here the default channel is shown to be 8. These are the registry values that should determine the default channel used. However, they are in the wrong section to be visible in the Advanced tab (Device Manager), so you need to copy it to the [atheros.reg] section and edit the channel you want there. (Don't forget to comment out the old section.)
After you're done, uninstall the previous driver (and unplug the device) and re-install your hacked version. Your mileage may vary.
Alternatively you can try to manually edit the registry.
BE VERY CAREFUL! (First backup your registry before attempting any changes.) As an example for registry script to import:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-...-08002be10318}\0021]
"defaultIbssChannel"="8"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-...-08002be10318}\0021\Ndi\params\defaultIbssChannel]
"ParamDesc"="Default Soft AP Channel"
"default"="8"
"min"="1"
"max"="11"
"step"="1"
"base"="10"
"type"="int"
Here you have to edit the \{4d36e972-...-08002be10318}\0021 part of the path, to match your own.