Hi All!
Ive got a problem with getting advertisementData to return data. (without connecting)
Sitrap: Seeed nr52840 sending advertisements. Reading them with another module shows the manufacturer data okay. Also okay on ble scanner app.
When I change the uuid in MIT to a wrong number the Advertisement data returns null. That is fine.
With the correct uuid the AdvertismentData returns . (two square brackets)
So, it looks that the numbering is all okay, there is just no data !
arduino code:
using BLE Extension Version: 20230728
Any suggestions on how to solve this is very much appreciated, I've googled for hours on end, but no result on that.
Thanks,
Chris
Ah, thank you for the effort, I didnt know to use,ino. makes sense.
yeah my data is just 12345678, as test. I see that on my ble scanner app also.
The 2 byte addData function, I added that to send the short service.
When I do not add it I get a null from AdvertisementData. so I think i do need that as well.
Getting down to basics, what is your Project actually designed to do?
Where does the Sketch come from? I see you have not used the Seeed BLE Library (for the Arduino IDE) but instead you are using Bluefruit from AdaFruit.
We don't often see two BLE services run on one board. I recognise the GATT LED Button Service LBS, but what is "VService" "FFE1"?
If you have no genuine manufacturer data, do not advertise it.
oh I am prototyping, and was interested to get the manufacturer data into my app, without the need to connect
Also it needs to be very low power. I succeeded by using the bluefruit and the nrf52840.
So for now , as a test, it is just FFE1.
I just cant understand why the AdvertisementData is returning an empty array.
Does someone maybe have a working example for me? I keep trying all kind of different hw and sw solutions, but no success. Stuck now.
Dont really want to go back to flutter...
As far as I am aware, the AdaFruit library doesn't use type char array for data, it uses type uint8_t (byte) unsigned chars (integers), but you may have discovered a different method, which is why I asked where the Sketch came from.
That isn't the correct UUID. I hadn't looked at your App Inventor code, good effort but unfortunately there is a lot wrong and the snag is there is a lot missing too. How did you get any kind of a result? I think what you have posted is not all of your code.
Post the App Inventor file (.aia)
Here is a simple Project to try. It does not list available devices because you have the name of the device of interest, "Viax". It also does not ask for BLE permissions, which you will need if later you connect to the device. I have nothing to test the code with here!
We find it best to test Bluetooth Apps as an APK rather than use the Companion.
Hi Chris,
The goal for now is to is to let MIT show me the manufacturer data from the AdvertismentData block. Any data... Let say a 1 from a button service.
nothing fancy just something simple stupid.
So decided started again, with a led example from arduino
LED1.ino (2.7 KB)
and the aia: Advertise_test (5).aia (278.3 KB)
Label1 shows the correct uuid, so device is found
I would think I could use the uuid global for AdvertisementData. But then I get:
So I use the preset value.
But data2 is still : null
BLE scanner shows the manufacturer name and the data and the name and service. Obviously because mit finds it also.
edit :runtime error was solved using Select List Item List 1 after global uuid. But still null on data2
Ah, you are ahead of me. Actually your original Sketch "test.ino" has a better chance of working, with the tweaks I mentioned.
LED1.ino does not have a BLEService UUID for advertising.
EDIT: - though if you fix the UUID issues, LED1.ino will be more familiar to the Power Users. Adafruit have their own way of doing things, so if using their libs, best to be using their hardware too.