I'm trying to use Microchip's RN4020 Bluetooth Low Energy module to create my own custom services so I could control them from my phone.
When I try to create only one private service everything works just fine. The problem starts if I try to create more than 1 using the following commands
From all the AOK messages looks like there are no problems but when
i actually list all the available services with LS command
both characteristics are put under the 2nd service and 1st one don't even exist anymore. I tried to set one service at 1st, than reboot and than add another one but it made no difference.
Is there even a way to create more than 1 private service on this RN4020 BLE module?
Hi etrusks I guess by now you might have the answer for this issue. But for those who have the same issue.
It looks like RN4020 module has this issue and its not solved yet (firmware V1.23). microchip has addressed this issue in the "RN4020 Bluetooth® Low Energy Module User’s Guide" They have a work around for this and you can read more about it in the same document.
Thank you!
Related
I am making a smart switch.
The switch has the following features :
The switch can be turned on or off through a physical switch or through thingspeak cloud switch.
it'll calculate the voltage, current and power using current and voltage sensor.
Now i have the code ready for both these functions, now the real problem is that sensors goes in a loop to calculate the value then upload on the cloud, but this causes a delay to the first function I can't use the switch neither the physical switch nor the cloud switch to turn the relay on or off.
I need a solution how to fix this so that I can calculate data and send and at the same time if I wanna use the relay I can get the values from cloud as well or the physical switch.
I am using an Esp32 microcontroller.
Hi CHANAKYA SUNIL JHA,
This is easily doable with FreeRTOS implementation in your code. I assume you are doing this project in Arduino IDE.
With FreeRTOS, you can implement two tasks, and assign each task to each of the core of your ESP32 and allow it to run in parallel.
I will provide a sample code for pinning 2 separate LEDs to 2 separate cores of ESP32 below. You can use this for your project.
Link to code template: https://github.com/Makerdemy/Advanced-ESP32/blob/master/Section%203/3.4/Code/LED_Dual_Core/LED_Dual_Core.ino
I hope this will be helpful and you are able to finish the project
Happy Tinkering,
Thank You.
Naveen PS
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 have a c++ application running on the Raspberry Pi that uses the bluez d-bus api. It supports multiple sensors from different vendors but for the most part adding new sensors has been fairly straight forward once I'd got the first one going. Once connected I'm not really using anything too exotic, just "StartNotify", "StopNotify", "ReadValue", and "WriteValue". Anyway, recently I've had problems adding a couple of new sensors. Both use larger packet sizes so using a packet sniffer I can see the sensors negotiating larger MTU. For whatever reason though after the negotiation I can read larger value characteristics but can't get notifications enabled (or received anyway). Trying different approaches with bluetoothctl I found that using "acquire-notify" seems to solve the problem. I also notice that the new "acquire" commands return the MTU so maybe that has something to do with it. Going back to the sensors I already support I've also found that replacing "StartNotify" with "AcquireNotify" seems to work with them as well. So my delimma is whether to use "AcquireNotify" for all sensors (keeping my code a lot cleaner) or just the new ones that give me an issue.
I haven't really found any in-depth documentation on the new "acquire" interfaces unfortunately. To someone without a lot of bluez history it's not at all clear what the ramifications of using them vs the original interfaces are. So my questions are twofold -
Is there any reason not to use "AcquireNotify"/"ReleaseNotify" for
all sensors (even older ones that use old/lower MTU)?
When using "AcquireNotify" does it matter if you use
"ReadValue"/"WriteValue" on other characteristics, or should I be
using "AcquireRead"/"AcquireWrite"?
Any info greatly appreciated, Thanks!
AcquireNotify returns a file descriptor that you can poll and read and notifications don't go through d-bus. with StartNotify you read the notification value from d-bus. you'll be able to achieve better performance with file descriptors (and without d-bus) if you're sending a lot of data in GATT notifications.
AcquireNotify/AcquireWrite are relatively new APIs and they have some stability issues (bluetoothd can terminate because of SIGPIPE). there are some patches to bluez 5.50 in their repositories that improve it.
Figured I'd follow up for anyone else seeing similar behavior. Oddly, after trying all kinds of permutations sending commands using bluetoothctl I found a way to get it working without using the notify-acquire api's. Randomly I found that if I enabled notifications via "notify on", then did the sensor vendor's recommended write command sequence to get the sensor to start sending data nothing happened. But if I did all that and then simply used "select characteristic" to go back to the notify characteristic I'd enabled it would start sending data. Not sure why. At any rate once I'd fully integrated the sensors into my application they actually worked without requiring anything extra. Not sure why exactly since my code is based directly on the bluetoothctl source but regardless it seems to work (so far anyway)...
I am currently developing a Universal Windows 10 application that is planned to run both on the PC + Mobile and the Raspberry Pi 2.
I was wondering what would be the best way for these two apps to pass data from one another through a local network and not using Azure. It is required that for every transaction done on each device, it gets transmitted over to another.
We also need to remote control the Raspberry Pi 2, like manage the data and shut it down using the app.
We are planning to build a RESTful API that will run on the same local network to facilitate this but I'm not pretty sure what APIs to use for this.
What are the necessary APIs that will be good for this requirement?
Thank you very much for your help!
Depending on the size of what you transfer, I found this:
BackgroundUploader class
Windows.Web.Http namespace.
See https://msdn.microsoft.com/library/windows/apps/br207140?cs-save-lang=1&cs-lang=csharp#code-snippet-2
We have a registered PC based application that needs a Dongle (hardware that gets plugged on the printer port) to start and execute. The vendor who provided us this application and Dongle, does not make or work with these dongles any more, since they are very old technology, and would not help us in this aspect.
So my question is --> is it possible to read the security code from this Dongle and store it in a file or something on the PC. We also do not have the source code of the application. Can we change the call in the application to read the security key from this file instead of trying to read it from the Dongle attached to the printer/parallel port.
Sorry for the vague question but we are very desperate to get help on this problem as out application has 16-bit code and it would not be supported by Windows 7 which is 64 bit. Thanks!!
The LPT security devices don't just contain information but usually include a processor and perform certain operations. Dongle emulators were developed when dongles where more widespread, but as they were based on reverse-engineering, they didn't work exactly right.
To answer your question, no, what you need is not possible. You need to start thinking about migration to another application. A temporary solution would be to have a copy of older OS running in virtual machine and to have your application run in this virtual machine. Such solution will work for another 5-10 years for sure, and I think it's enough for migration.