Project - Windows Phone 8.1 Bluetooth controlling NETMF Gadgeteer

I just posted Windows Phone 8.1 Bluetooth controlling NETMF Gadgeteer on Codeshare. Feel free to discuss and make suggestions here.


For people who do not have the Windows Phone Developer Registration for their phone, the App can now be installed from the Windows Phone App Store.
The Name is: BT-SPP-WinPhoneClient
But with this the second problem came up. The App does not run under the lock screen and so the Bluetooth connection is interrupted when the lock screen comes up.
So it’s the task for the next version, allow running under lock screen.

@ RoSchmi - I have been following your Bluetooth posts and am pretty excited about this post. I have been developing a system based on a HP tablet running Windows 8.1. I took care of the lockscreen issue using pc settings. The next issue was keeping my app on top which was partly taken care of using the DisplayRequest class. My app still ends up under the desktop occasionally. I believe this is where I am encountering the same problem you are seeing. My understanding is that when your app is covered either by the lockscreen or another app your app becomes inactive and you need to save the state of your app. The need to save state is necessary because after some time interval the operating system moves your app out of memory with no notice.

My approach to your problem then is to disable the lockscreen and keep my app on top. I have not been entirely successful but I am still looking for a solution.

@ Bill_Wyo - Thanks for your feedback,
yes, I searched for a solution yesterday and found as well that on Windows Phone 8.1 RT the DisplayRequest Class seems most promising.
The command
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled
can only be use in Windows Phone 8.0 or Silverlight Apps.
A really satisfying solution seems not to be possible before the used StreamSocket can be disposed and a new StreamSocket can be connected to bluetooth without throwing an exception. (At least I did not find a solution to this). Perhaps anyone else knows how this can be done?
So we first will have to wait until this issue is solved.

@ RoSchmi - try Settings > battery saver > usage > tap on application > On/Off Background - not sure if this is helpful.

@ Bill_Wyo - thanks for the hint,
I’m using the DisplayRequest Class now and it seems to work quite well. There is now a toggleSwitch which is used to prevent the lock Screen. The revised App for the phone can now be installed from the Windows Phone App Store


I’ll post the source code on Codeshare later.
BTW: Talking between the phone and teraterm an the PC works too (terminal must be set to append CRLF).


Could you help me, please?

We have the following system:
FEZ Spider 1
USB Client DP 1.3
Bluetooth 1.1 (GM-312)
Display T35 1.5

We tried program:
Windows Phone 8.1 Bluetooth controlling NETMF Gadgeteer by RoSchmi
from the page

We got the error message:
Cannot display the base assembly ‘mscorlib’, or any of his satellite assemblies,to device-USB: Gadgetteer twice. Assemblly ‘mscorlib’ on the device has version 4.1 2821.0, while the program is trying to deploy version

So, do you know how to correct this situation? Can we somehow change the mscorlib? Or should we buy a newer version of Spider? Or is the problem in some incorrect module ?


Is your Spider firmware update ?

@ Runsen Ma - Hi, welcome to the forum.
I would suspect that you have connected the Blootooth Module in the designer to the Spider Mainboard. This is not allowed in this project as the driver for the module is included separately.
Kind regards

Can somebody tell me how the firmware is up-dated? Is there a guide for that?

@ User_7874 - there is a nice Video tutorial by Duke Nukem
[url]Gadgeteer FEZ Spider Update - YouTube
If you have issues with Windows 8.1 or Windows 10, try a Windows 7 PC. Windows 7 worked best for me.

@ RoSchmi - Thank you for your Video tutorial .We have updated the firmware succesfully .

@ RoSchmi - And we have just ran into another problem:
Our emulator can not find the BT ´device . Please see the picture attached.
Could you suggest a solution for it ?

@ cyberh0me - the BT device is as shown in picture from GHI Electronics BT1.1

The emulator is downloaded from .NET Micro Framework – GHI Electronics.
The BT device can not be recognized By any physical phone.The BT device is connected to U.

@ Runsen Ma - you can download the Phone App from the Microsoft App Store, the name is Bt-spp-WinphoneClient. I did not try with the emulator. Is the Bluetooth module on the Gadgeteer mainboard properly installed?

@ RoSchmi - Our BT device is connected to connector 11 ,we need a U connector and there are so many U connectors. Can you indicate which one is the correct?

@ Runsen Ma - In the application for the Spider it is set to Socket 8

const int MySocketNumber = 8;

@ RoSchmi - do not miss to set the correct #define directive for the GHI Bluetooth Module in the class BluetoothBee.cs
#define GHI_Bluetooth_Module
//#define Bluetooth_Bee_Gadgeteer
//#define Bluetooth_Bee_Cerbuino

@ RoSchmi - We have chosen GHI_Bluetooth_Module in file BluetoothBee.cs. Is there anywhere else that are needed to be changed?

@ Runsen Ma - No, I don’t think so. Have a look on the Debug.Print Messages when the application is deployed. Don’t forget that you have to do the pairing with your phone before the phone app will work (unfortunately the pairing has to be done after every disconnecting)