Sphero Windows Sample App? - sphero-api

Has anyone gotten the Sample BasicDriveApp App working in Windows 8?
https://github.com/orbotix/Sphero-Win-SDK
When I build and run the Project I get a message "No Sphero is connected" and when I try to connect the Sphero via Windows 8 Bluetooth it does not work.
Can anyone offer any tips?
Thanks.
John.

It indeed works, I've had some problems with connectivity myself, however.. process I use to restore if all goes awry:
Refresh Sphero (return to base for sleep mode, wait a few seconds, wake up)
Refresh Bluetooth in Windows (off / on) without connecting to Sphero
Open your app, wait for it to connect. It'll find Sphero and automatically dig in if all goes well.
[Update]
It appears Windows 8.1 doesn't really know what to do with Sphero. It has a hard time reconnecting after the connection is lost, even if you close all instances of the app and toggle through Bluetooth.

Related

Xamarin Android 10 UDP Client In Background (Release Mode Only)

I am having an issue with the UDPClient in Android 10 (worked fine in Android 9) so Im assuming Im missing from Android 10 that I have yet to be able to find so far.
I have a UDPService (background service) running which is a pretty standard implementation (Port is 64200)
m_udpSocket = new UdpClient(m_port);
m_udpSocket.Client.ReceiveTimeout = (int)m_healthTimeout.TotalMilliseconds;
m_healthSocket.Client.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, (int)m_healthTimeout.TotalMilliseconds );
I wont post the sending and receiving code at this stage as I think its more permissions related.
The client periodically sends some UDP data to the server for processing. Its all local network based (not internet) and the data is sent via the WiFi on the device.
In Android 9, it all works as expected with the app in the foreground or the background.
In Android 10, it works perfectly when the app is in the foreground, but when the app goes to the background, when I try to issue the send on the socket
System.Net.Sockets.SocketException (0x80004005): Access denied
This error only happens in release mode on Android 10. If Im running in Debug Mode attached to the device, I can put the app into the background and the UDP traffic works as expected.
Based on all the above, Im assuming there is something else I need to do to allow the socket to work in the background in release mode but I cant seem to put my finger on what it is. Ive read about INTERNET permission and how Debug mode automatically adds this so is there something else I may be missing in the Android Manifest that could cause this.
Any help would be greatly appreciated.
Thanks in advance.
For anyone experiencing similar problems, in the end it had nothing to do with the actual code, but it was the Battery Optimisation Settings in Android.
Once I removed the app from the automatic battery optimisations, everything worked as expected.

WebBluetooth Error in Windows 10: "Turn on Bluetooth to allow pairing"

My WebBluetooth app works in Chrome Version 77.0.3865.90 on another system, so this is not a Chrome problem, this is a Windows setting problem. As soon as my web app tries to pair I am getting the message, "Turn on Bluetooth to allow pairing".
Bluetooth is turned on in Windows 10 and I can manually pair my workstation to my Android phone. I have fiddled with every Windows Bluetooth setting for hours now (disabling devices, etc.).
This is the message:
Any help would be greatly appreciated. Thx!
This is probably a Chrome bug. Since I experienced the same problem, I have opened https://bugs.chromium.org/p/chromium/issues/detail?id=1006688 for it.

Appcelerator doesn't detect android phone

Goodmorning,
I'm working quite hard on my own app. At this point I want to run it on my android (galaxy note 3) phone. Unfortunately Appcelerator studio doesn't detect my android phone; Windows does. I've tried it with the new Galaxy s7 of a friend, but same result.
Off course I searched the web like crazy and found several possible (old) answers, but none did the magic.
When I consult the log, there's no new info to be read!
Does anyone have a clue where to look? Looking forward to your answers…
Kind regards!
One thing you should check is if you have set up your phone for development. You can see the instructions here: http://developer.android.com/tools/device.html (... tap 7 times... - took me a while to discover!)
And the small obvious thing is in Appcecelerator Studio you may need to select "Refresh devices" when you try to run the project.
/John
When you say "Windows" detects it, what exactly do you mean? Does adb detect it?
If you run
adb devices
on the command line, does it report your device ID?
On my Mac, I run this and I can see my connected S4:
List of devices attached
9726ea90 device
I'm assuming that the Windows version of adb would output a similar report.
With all the Samsung phones I've debugged with, I always have to go to the notification bar and choose "connect as media device" (or something similar). The default connection mode does not work for debugging. And unfortunately, you have to do this every time you connect the device.

Sphero connect on Mac issue

I recently bought Sphero 2.0 and playing with it on iPad with no problems.
Now I want try to develop some apps with Mac SDK however I am not able to connect my Sphero with my Mac Mini 2012 nor Macbook Pro 2013 Retina. I open Bluetooth settings, I see Sphero-YRG click to "Pair", it shows for two seconds "Connected" and after that "Not connected".
After this pairing process I can still click on "Not connected" Sphero bluetooth device, after few seconds it turned into "Connected" and again after two seconds its "Not connected". I doubted that it really gets to connected state because Sphero won't start light with that blue-white as it does when it connects to my iPad.
This is output from /var/log/system.log :
Feb 3 21:19:11 Pavel-Mac-mini.local blued[83]: Save link key for device: 68-86-e7-00-25-b8
Feb 3 21:19:12 Pavel-Mac-mini.local BluetoothUIServer[3420]: setAudioDevice:kAudioDeviceUnknown
Feb 3 21:19:12 Pavel-Mac-mini.local BluetoothUIServer[3420]: Failed to set the device Sphero-YRG
Feb 3 21:19:13 Pavel-Mac-mini kernel[0]: [0xffffff8058432e00][free]()
What worked for me is quickly running some code using the Sphero during the short interval while it shows "connected" in the Bluetooth settings.
Connect Sphero. It will automatically disconnect, stupid.
ls /dev | grep Sphero shows the name of the port which was associated with the device. Use the tty one (in my case, /dev/tty.Sphero-BOY-AMP-SPP).
Paste the port name into your code, so you can run it quickly.
Remove Sphero from the Bluetooth settings UI.
Choose to pair with the Sphero again, and immediately run your code using it. Now it stays connected and the connection is usable and stable.
The Mac SDK looks like its last update was about a year ago, which would mean that the SDK has not been updated to be able to see or connect to the Sphero 2.0 ball correctly. That being said, the Mac SDK is actually an unofficial SDK, and therefore is not directly supported by us. I will make sure that this gets forwarded to the correct people, and will get you some more information when I know more.
You could try using artoo open source framework to connect and control your sphero from your computer.
Here you can find a tutorial on how to do it: https://github.com/hybridgroup/artoo/wiki/1.3.2.-Sphero
If you don't want to use ruby, you could use http://cylonjs.com with javascript too.

Emulate Sleeping Windows Mobile Device

Is it possible to emulate a device sleeping and waking using the Microsoft-supplied device emulators?
Yes, but you have to generate your own emulator image with a modified kernel (changing OEMPowerOff). Bruce Eitman blogged about it here. You didn't detail your needs, so it's hard to say, but you might be able to provide some form of simulation by manually setting the named power management events.
This is an old thread, but in case anyone else stumbles across it, you can make the Windows Mobile emulators 'sleep' and wake up, though not with the debugger attached.
Close the emulator window while your application is running and save the state. Or, configure power management to sleep the emulator at the desired time; the emulator will close and save its state automatically. If the debugger is attached, it will lose its connection and stop debugging.
Open Device Emulator Manager and click Refresh until the emulator shows up as disconnected (no icon next to it). Right-click on the emulator name and select Connect.
Emulator wakes up and reappears. If your application is listening for the wake-up notification, it will be signaled at this point.
You can also wake up the emulator using Debug > Attach to Process, though this does not always succeed. Either way, by the time the debugger attaches, the wake up sequence will already have executed. If you can get by with debug statements, though, this is easier than modding the emulator image.

Resources