I'm trying to get the node-hid (https://github.com/node-hid/node-hid) module working on Windows 7. I can open a device and write to it, but no data ever arrives.
I've verified the device is sending data. I've dug through the node-hid code (HID.cc) and tried several things to get it working:
Modified the HID::recvAsync function to use an hid_read_timeout in a loop to see if that would return anything.
Set both blocking and non-blocking.
Changed buffer sizes to exactly fit what the device sends.
On Windows 8, with the hid_read_timeout call change, this all works fine. I'm not sure what may have changed between the two systems, but I plan on using this on windows XP as well, so I can't just call it good.
I'm struggling to come up with more ideas as to how to debug this issue. Has anyone successfully done this before? Is there a better option to use Node.js with an HID device?
After some serious debugging, I found that for some reason I have as of yet not been able to determine, the source file, HID.cc for the node module node-hid needed a call to hid_init() within the constructor before the hid_open call. I'm assuming that somehow this is getting hit with multiple threads, making the safety of calling hid_init before hid_open necessary.
I now have this working on both windows 7 and windows 8.
Summary of changes I had to make:
Add hid_init before the hid_open call I'm using.
Change hid_read to hid_read_timeout in a loop. (Since reads won't return on windows XP when shutting down otherwise.)
Once I've cleaned it up, I'll send the author my changes.
Related
I have been working with web-bluetooth for the past several months on iOS and ChromeOS without any problems. But today, I tried to run some of my examples on Windows for the first time, and to my surprise, most of the things I had implemented didn't work with Windows. I am able to successfully connect to my peripheral, but whenever I try reading or writing anything to a custom service with a custom characteristic, I get the error "GATT operation not authorized". I have tried looking around but there is no information anywhere about this.
I am including below the simplest example I have which is just for turning the LEDs on / off on an nrf52832 board. There is only one custom service and one custom characteristic implemented, the value of which controls the states of the LEDs. This works without any problems on Chromebooks and Macs but does not work on Windows. Here is the link to this simple project including the embedded code and the web-app.
https://github.com/shtarbanov/WebBluetooth-Feather-nRF52832/tree/master/LED%20Control
I have made two implementations of the same thing, one based on promises and another based on async-await located in the folders "WebApp (Async)" and "WebApp (Promises)", respectively. Both of those implementations work fine on Mac and Cromebook, but not on Windows.
It is a known issue that secure characteristics are not accessible using Web Bluetooth on Windows. On other platforms the pairing occurs automatically, but not on Windows. There is an issue tracking this:
https://bugs.chromium.org/p/chromium/issues/detail?id=960258
Stuck with this also and as for workaround i can recommend for windows platform to pair device firstly using windows itself and than to pair it via browser(as a workaround). Not much but hope this helps, at list a little.
P.S. it should be paired via windows only once, so PC will remember device, and than you can pair via browser as long as PC remembers device.
I'm using the Bluetooth Low Energy (BLE) API introduced by Microsoft with Windows 8, the BluetoothGATTxxx functions.
My code is working fine on Windows 8.1, but I have observed a difference in the behavior of BluetoothGATTSetDescriptorValue between 8.1 and Windows 10.
The scenario is the following:
Pair the device with the Windows interface.
Find it and enable data notifications with a call to BluetoothGATTSetDescriptorValue to set the field 'IsSubscribeToNotification' of ClientCharacteristicConfiguration to true.
Register a callback to receive the new values (I tried to register the callback first, didn't work well).
The callback gets called every time new data is sent from the device.
All is good. Now, if I turn the device off and on, then repeat steps 2 to 4 it will work fine on Windows 8.1, but not on Windows 10:
BluetoothGATTSetDescriptorValue returns 0x80070572 i.e.
HRESULT_FROM_WIN32(ERROR_NO_USER_SESSION_KEY).
In practice, this means the user has to remove the pairing and redo it every time the device is turned off.
The problem is made worse by the fact that the device has some power management feature and will turn off automatically if it stays idle too long. It seems I need to keep it alive if I don't want the user to delete/redo the pairing every time they want to use the device!
Is anyone else running into this issue too? I tried several searches here and on the net but with no luck. A solution would be to force a new pairing programmatically, and since there is no API for this it would be an ugly hack. I definitely don't want to take that path...
I am trying to build v1.2 of firefox os for my zte-open. With a few hiccups I was a able to configure and build it using the inari device profile. But the process fails at the last stage of flashing.
here is the output of the ./flash.sh command
rog% sudo ./flash.sh
[sudo] password for abhiram:
< waiting for device >
erasing 'cache'...
OKAY [ 0.531s]
finished. total time: 0.531s
erasing 'userdata'...
OKAY [ 1.399s]
finished. total time: 1.399s
sending 'userdata' (53571 KB)...
OKAY [ 4.518s]
writing 'userdata'...
FAILED (status read failed (No such device))
finished. total time: 9.911s
After that the device starts fresh with no userdata (obviously). Right now I am guessing that if it passes the user-data phase it might flash the system and boot partitions.
Btw, my phone running the version 1.1 of the firmware, which was from an official Zte update.
update
I tried flashing separate partitions of (system and boot) but the it gives me the same error.
with ./flash.sh system
FAILED (status read failed (No such device))
I have this same problem. However I do not think that fastboot is disabled.. I say that because I can see ROAMER2 if I do a
fastboot devices
Please note.. if you cannot preform that command try running the following command first
adb reboot bootloader
after this I bet you will be able to see the devices using the fastboot command.
So fastboot seems to be able to connect to the device and the fastboot command erasing cache seemed to have worked, and the fastboot command erasing userdata command worked. So my guess is that it is not fastboot itself but the device preventing the push from occurring.
Perhaps there is a log we can read somewhere?
Update:
I called the company. Their official line is that they do not support updating the phone and you should only use the Update feature on the phone itself. There is an update coming however it is being pushed out one a time not a global push to all devices. In some blogs on this subject I saw users complain that the device is advertised as open but is not in fact open. Point being this: If the device is preventing the push as I suspect (then we as a consumer have been tricked) and the device is operating correctly.
Update: (more info)
There is a set of problems and it depends on if you upgraded your phone or not. If you read the discussion here I think it pretty much covers everything: http://www.reddit.com/r/FireFoxOS/comments/1ugx5g/firefoxos_buils_for_zte_open/
Also check to see if your device is rooted by the following
adb shell
if you see $ continue to the next command, if you see # you have root
su
If you are in the same boat as me, and have updated to 1.1 using the ZTE images. Then you are a little stuck. We need to downgrade back to 1.0 revision 2 (B02). This will require the clockwork mod recovery to do this. The problem is that we also need the original img. ZTE has taken this image down. If you have this image or if you can find it please upload it and post it here and in the link I provided (you'll be a hero to a very small group of nerds). Otherwise.. a Mozilla developer stated that ZTE will have yet another update coming soon. (However chances are this is going to be yet another locked down version). So the hunt in on for the original image.
After emailing the b2g-dev mailing list, I figured out that this was a problem with the firmware of the zte-open.
AFAIK, the latest firmware update to 1.1 brings all the devices to OPEN_US_DEV_FFOS_V1.10B01 firmware, which for some reason comes with fast-boot disabled. Hence it is not possible to flash it.
It looks like zte are working to bring out a new update that comes with fastboot enabled. So I guess I'll have to just wait it out.
Update
It took me a while to figure out how to update the damn phone, to upgrade you need to downgrade to the firmware 1.0B02 on which fastboot seems to work.
To downgrade I had to install clockworkmod as the default recovery program complains of signature mismatch( Zte! can't I donwngrade to your older official firmware?).
Rooting and installing clockworkmod, I had to remove some assert checks on the device-name from the updater-script and then pack it. Once this is done downgrading the device is quite simple.
After this I had to individually flash the three images (boot,system,userdata) using fastboot flash command
I'm running Asterisk 11.2.2 with SRTP and STUN support under Calculate Linux (Gentoo-based distribution).
When I try to call from one WebRTC instance to another, using JSSIP, the call passes, but if i answer it on another instance, the call suddenly terminates. Using Asterisk debug mode, i can catch 488 error (Not acceptable here).
If I use one SIP phone (Ekiga) instance instead of WebRTC, then I can call JSSIP from it, and everything works fine. Nevertheless, I can't call Ekiga from JSSIP, and this makes me confused.
Can you advise me, what have I do to localize this bug?
The problem was in my Asterisk: it had some WebRTC issues in 11.2.2 version. Upgrading to 11.4.0 makes everything works fine.
I just encountered the same issue, for me it was codecs issue. I was allowing only G729 in sip.conf file and hence it was throwing 488 error. For now, I fixed it by setting allow=all (I would check later on which particular codec does it needs).
I'm exploring porting a .NET C# application from Windows to Linux using Mono. The problem I'm stuck with is that asynchronous TCP socket calls do not work. This means that I can send data with no problems but I'm only seem to be able to receive the very first response from the socket (via Socket.BeginReceive()). The next BeginReceive() puts the thread into a wait state.
In it possible in principle that our socket code contains a bug but as it's been working flawlessly in Windows for years.
Thank you
This works fine with the mono-2-10 branch (soon to be released as Mono 2.10) and master.
The Mono 2.6.7 shipped with ubuntu fails and so does Mono 2.8. I've found the problem and I am testing a fix.. The next releases in the 2.6.x series will have the fix (also 2.8.x if there's any, since we are moving to 2.10 in a few days).
Btw, you should report problems in Mono following http://mono-project.com/Bugs instead of here.
If you use a synchronous socket, do things work as expected? That's a quick way to help narrow down the issue.