How can I access the light sensor value when using bbc:microbit over bluetooth? - bbc-microbit

I am playing around with bbc:microbit using bluetooth web api to access the microbit service data (button event, led, magnetometer, ...).
It looks like the light sensor information are not accessible from the javascript API.
From the microbit documentation, light sensing are accessible from the led service, but it looks like the lib is missing them.

The micro:bit Bluetooth profile is defined at:
https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html
It does not expose the light sensor information by default over Bluetooth. My initial thought for a quick workaround is that you could send the value over the Bluetooth UART service. I used the editor at: https://makecode.microbit.org/#editor to create a hex file for the micro:bit that seemed to work:

Related

Samsung SPF-71N UPnP photo frame

I have a Samsung's photo frame which is connected to LAN. It broadcasts as UPnP device like that:
09:48:05.429956 IP 192.168.5.4.1900 > 239.255.255.250.1900: UDP, length 279
E..3."#..............l.l...eNOTIFY * HTTP/1.1
LOCATION: http://192.168.5.4:57959/
HOST: 239.255.255.250:1900
SERVER: POSIX, UPnP/1.0, Intel MicroStack/1.0.1868
NTS: ssdp:alive
USN: uuid:cc845bff-073b-c7de-1317-6c3e34888fd0
CACHE-CONTROL: max-age=1800
NT: uuid:cc845bff-073b-c7de-1317-6c3e34888fd0
Frame presents itself as urn:schemas-upnp-org:device:MediaPlayer:1, but I cannot find this device type on UPnP Forum pages. Here is XML descriptor: https://www.dropbox.com/s/unuarev1ywr8hc5/ramka.xml
I tried to set up frame entering my DLNA server IP address (frame configuration), but didn't work. Frame says that there is no server it can play content from.
There is no MediaRenderer service so I cannot just send pictures. I suspect that frame is a "kind of client" but I don't know how to use it. User manual says nothing about media server and serving content from network.
Has anybody some idea how to figure it out?
The device type is MediaPlayer which suggests that it can discover your UPnP MediaServer using SSDP, and then you should be able to browse your photos and play them via the Samsung Photo Frame. Try switching your MediaServer off and then on to encourage it to send a NOTIFY packet so that the Photo Frame finds it.
The MediaPlayer device will not be recognised by standard UPnP CP apps (they are looking for MediaRenderer and MediaServer device types).
The device description XML lists AVTransport and Rendering control services which suggest that the Photo Frame can be controlled remotely e.g. play a photo, set brightness.
The non-standard UPnP device type and extra services suggest that there must be an App from Samsung for the Photo Frame. That is your best option for a remote control.
There is no MediaRenderer service so I cannot just send pictures
That's not the whole story. It's true that the device does not seem to implement ConnectionManager service so it couldn't be a compliant MediaRenderer device (and naming apparently proprietary Samsung things in the "upnp-org" namespace seems obnoxious to me), but the device does claim to implement RenderingControl and AVTransport so it's conceivable that it could be controlled with a (almost) standard control point...
As an example, I'm guessing gupnp-av-cp (a testing AV control point from gupnp-tools on most linux OSes) might work with a oneline change to replace the device type and another to set a fake renderer protocolinfo (basically making a guess on what kind of data the renderer accepts).

Access SmartCards from Windows 8 Store App (WinRT)

In a Windows 8 Store App I would like to read Data from a SmartCard. After installing the SmartCard reader (USB Device) I can read its device path and connection state via the Windows.Devices.Enumeration namespace. Even the device interface id is retrievable (50dd5230-ba8a-11d1-bf5d-0000f805f530) and I put this as a required capability in the App's manifest file.
For the interaction with the device I use a C++ Component calling the CreateDeviceAccessInstance Method. But this call always results in an ACCESS_DENIED exception.
Further research taught me, that interacting with a custom hardware device (everything that is not a printer, microphone, mouse, ...) would need several adjustments in the device driver published to the windows 8 driver store.
I'd be glad to do so, but I am no IHV and would like to use the generic driver and the generic interface.
Could anyone give me a hint how to proceed from here and use the generic interface for USB SmartCard devices?
This is not a real answer, but I have the same problem and I have spent quite some time looking for the hard-to-find bits of information on this subject around the internet, and I'd like to share my results.
Windows 8.1 has some specific APIs for (virtual) SmartCards (API reference, sample), but it seems like they can only be used for authentication and there is no way to send APDU commands to a card at the moment (see this comment by Himanshu Soni). I guess one could use the new USB APIs to talk to the reader directly, but then you'd have to implement the whole protocol yourself.

USB HID device detection

I am trying to access an USB HID device under Ubuntu(kernel-3.0). I want to write a program which could notify me whenever an USB device is attached to the bus i.e is there any event generated whenever an USB device is plugged in which I can monitor. I have looked into DBus and HAL without any success. But I don't want linux to load its current modules(USBHID and HID) when the device is plugged in. I also want to ask if the mentioned modules are also the device drivers used for HID devices.
My sole purpose is to run a script whenever an USB device is plugged into the bus which will indirectly call the above mentioned modules.
I am writing my code in C. I am quite new to linux. So it would be of great help if anyone could point me in the right direction.
Thanks..
The UDisks deamon will send the D-Bus signal "DeviceAdded" when a USB drive is inserted, and probably another "DeviceAdded" for each partition on the drive. If you have automount you would also get a "DeviceChanged" signal when the partition(s) are mounted. You can then query the UDisks interface, as well as individual devices about their properties, for example. You can find more info on the UDisks interface here: http://hal.freedesktop.org/docs/udisks/UDisks.html
One way to get more familiar with what goes on with block devices (or whatever) on D-Bus, is to install and use D-Feet to inspect the bus. UDisks appear on the System bus. You can see what is there and inspect the properties for individual devices as well as the UDisks interface itself.
Another way, which would also allow you to see what signals are transmitted on the bus, is to run dbus-monitor from the command line.

Is it possible to programmatically power on/off the 3V3?

I have a Netduino Plus with at transeiver attached via SPI. I would like to reset the transiever every time the Netduino restarts. Is it possible to programmatically power on/off the 3V3 pin?
I would recommend using a FET (controlled by one of the I/O) pins to enable/disable 3V3 power to your transceiver. When you say transceiver, I think "more than a few mA" :)
BTW, we took this feedback into account with the new Shield Base module for Netduino Go. It has an integrated FET on both 3V3 and 5V power headers, so you could enable/disable power to your shield in code. Once the new Ethernet go!bus module ships and the Shield Base comes out of beta (soon), your solution can be redeployed to Netduino Go + Shield Base with few/no code changes.
Chris
Secret Labs LLC
Looking at the circuit diagram ( http://www.netduino.com/netduinoplus/schematic.pdf ), I can see only the Micro SD Card Slot having its power controlled programmatically. You could rig up a relay to control it (via a transistor, of course) instead, or if the transceiver uses less than 130mA (the current limit of the device shown: http://www.datasheetarchive.com/BSS84W-7-F-datasheet.html) you could copy the circuit from the Netduino Plus. Buying a relay shield looks like overkill, but you might have other uses for it.
Have you looked into resetting the transceiver programmatically instead of the brute-force method of power-cycling it?
Just to provide another view. You could use a transistor powered off the netduino RESET line, this will reset the device every time the netduino reboots. Or you can just link the transistor to a spare digital pin and power it in code..
What specific SPI device are you using? You mention that it's a transceiver but we could probably provide better information if we know the exact part number. If your device requires less than 8mA the Netduino Plus specs seem to indicate that one option could be using a digital output pin as the power source.
Unfortunately Secret Labs don't use exactly the language I'd expect and call out the sink and source current maximums so I would contact them directly first to see if you risk blowing your chip. I'll see if I can get an answer from them and amend this post if/when I do.
Update: Sink and source current is the same on the Netduino. See my post on their forums about sink vs. source current for a more in depth explanation. So, if your device can run off of just a few milliamps you should be able to use a digital I/O pin to power it.
Also, a lot of devices have enable pins. You can usually reset them with that line instead of pulling the power if that helps. Sometimes with flaky hardware it is better to pull the power though.

How to program midi messages to HUI Pro Tools uses?

I found some specs online but It wouldn't work for Play.
I tried
const UInt8 noteOn[] = {0x90, 127}; and it didn't work.
Does anybody know what midi messages to HUI Pro Tools uses for play and stop?
There are 2 main Protocols out there for controlling DAWs, Logic Control and Mackie Control (HUI). Unfortunately both are close protocols. Only recently Apple added support for TouchOSC (iOS application) and the OSC protocol (Open Sound Control) in general for Logic Pro, hopefully Pro Tools to follow (maybe it already did and I'm not updated, you better check it out).
If you want to reverse engineer the record/stop buttons and you own some sort of Mackie Control device, I recommend using Midi Monitor or LC Xmu to monitor what data gets in. Not sure whats there for PC users, on my PC era I used my Pro Soundcard.
If you don't own some sort of controller and looking around the internet for the answer please notice that these protocols have many versions that each manufacture tweak a little bit. On the other hand, there are not that many options, you can try them ALL :)
Anyhow, I program an iOS application that controls Logic Pro without using LC or MC at all. I opened Logic's Key Command and set the Midi Listen button of the Start/Stop on, then sent some Midi Note from my iOS application to calibrate the button. It worked well, but was not intuitive to users so I decided to give up.
You can send a midi machine control message through your virtual server with you virtual server, I had some success after reading this: http://en.wikipedia.org/wiki/MIDI_Machine_Control
Be sure to enable your virtual source as a mmc in your DAW. Also there is a Boolean check in the core midi docs you can use to verify that your program is sending the mmc messages, I believe it is something like kmidimachinecontrolenable, it is a coremidi constant and should not be hard to find.