Dear Support Team,
I installed the SDK with daughter board with the DA14531MOD dev.kit. I successfully flashedcodeless_531_set_two_standalone.bin
Issuing commands:
AT+ADVSTOP AT+CENTRAL AT+GAPSTATUS 1,0 OK AT+GAPSCAN SCANNING SCAN COMPLETE OK
It does not discover anything, however we have 3-4 Blutooth devices around.
One of the device which we wanted to read is a Ruuvi tag BLE Beacon:
https://ruuvi.com/ruuvitag-specs/
Thanks....
Device:
Hi janosN,
Thanks for your question online and for your interest in out TINY module BLE solution.
It seems that the sequence of the AT commands is correct. Can you find those devices in a BLE Generic application?
Would it be possible to check this with another DA14531?
Thanks, PM_Dialog
Hi Dialog Staff,
Thanks for your answer. Regarding your first question: yes, I can find my devices with another scanner. I took my Raspberry Pi and installed a BLE-scanner. Here is the result:
As you see, it finds three devices, whereas my DA14531MOD_devkit finds none.
Regarding your second question checking with other DA14531 modules; we have ordered 10 pieces of DA14531 TINY Modules. I want to flash a few modules to test the AT+GAPSCAN function. I will try all three CodeLess fw. I shall report you about the result....
Thank you for your support.
Hi janosN,
Yes please, try to configure a TINY module as a GAP peripheral and let me know if the module acting as GAP Central can find it over the air.
Thanks, PM_Dialog
Dear PM_Dialog,
Now, as I can program the TINY modules (thanks to user: cole), I configured as you suggested; one as central and one as peripheral and now the central can scan the peripheral module:
So, DA14531 Module to another module works. But still it can not scan anything else. As I mentioned earlier, I need to scan BLE sensors advertising temperature, pressure, humidity coded in Manufacture's code like this:
The sensor protocol is described on:
https://github.com/ruuvi/ruuvi-sensor-protocols/blob/master/dataformat_0...
I hardly believe that there is no CodeLess AT command solution for this. We don't even need BLE-connection to these sensors, just scan them. For CodeLess AT there are only 3 fw-versions and I tried all of them.
If no CodeLess scan possible, then what next?
Thank you very much in advance.
Hi janosN,
Could you please do a small change on the CodeLess firmware, re-build and run it?
In the user_on_adv_report_ind() please do the following change in the if-statement : remove theshow &&
Initial :
Modified :
Thanks, PM_Dialog
Dear PM_Dialog,
Thanks to the suggestion. I modified the file: user_codeless.c
Compiled the project without error. But the Linker reported error that the code size exceeded the limit.
I compiled with maximum optimization O3 (Level 3).
Either I need a license from Keil, or another option would be that Dialog is so kind and sends me the hex file.
Thank you very much in advance.
Hi janosN,
Let me check it and I’ll get back to you.
Thanks, PM_Dialog
Any solution?
Hi sfuentes-digi,
Please see my previous comment. A modification should be done in the user_on_adv_report_ind().
Thanks, PM_Dialog
Hi PM_Dialog,
Thank you for responding so quickly but I mean if there is any solution to compile the file.
I have the same error, there is another program for compilation or other way?
Thank.
Dear PM-Dialog,
Dear Sfuentes-digi,
Below I write in more details about CodeLessAT+GAPSCANissue. My problems at the beginning were the following:
Nr.1 solved: what Dialog suggested to leave outshow &&like:
if (show &&(param->report.evt_type == 0x00 || param->report.evt_type == 0x04)) // Only ADV_IND and SCAN_RESPONSE*/
to:
如果((param - >报告。evt_type = = 0 x00 | | param - >回购rt.evt_type == 0x04)) // Only ADV_IND and SCAN_RESPONSE*/
To solve Nr.2:
examining the code above it was clear thatparam->report.evt_typeis responsible what kind of advertising is accepted by AT+GAPSCAN. So, I was looking for another file which describes these types. It was really hard to locate the following header file:...\common\api\co_bt.h; Here the lines 1340-1355:
///Advertising HCI Type
enum
{
///Connectable Undirected advertising
ADV_CONN_UNDIR = 0x00,
///Connectable high duty cycle directed advertising
ADV_CONN_DIR,
///Discoverable undirected advertising
ADV_DISC_UNDIR,
///Non-connectable undirected advertising
ADV_NONCONN_UNDIR,
///Connectable low duty cycle directed advertising
ADV_CONN_DIR_LDC,
///Enumeration end value for advertising type value check
ADV_END
};
In this enumeration from 0x00-0x05 there are different types we can choose. So, I needed onlyADV_NONCONN_UNDIR(0x03 value) because the telemetry beacons advertise non-connectable undirected packets. You can read more about advertising types on:
https://www.novelbits.io/bluetooth-low-energy-advertisements-part-1/(scroll to the middle of the page…) So, I further modified the function to:
如果((param - >报告。evt_type == 0x03)) // Only ADV_NONCONN_UNDIR
Now all beacon devices were listed and others are filtered out.
The last problem: where is my raw-data what the beacons supposed to transmit like temperature, air-pressure, humidity, x-y-z acceleration, battery-voltage?
To solve Nr.3:
For this you need to further modify the function to
You see here the param->report.data[30] is the last byte in raw-data array. Of course, the original size of adv_rep_str[40] was not enough, it is now 260
char adv_rep_str [260];/* original 40*/
The above code is a bit ugly; I could have written in more elegant way in a loop, but it works, I do it later…
To solve Nr.4:I had a 30-day license from Keil which expired. I needed a way to reduce the code-size. See my previous topic:CODELESS Project Size Reducing - Problem Solved....
Here I found 2 linesuser_at_commands.hthat you can comment out to gain more room:
“//#define USE_AT_CONPARand//#define USE_AT_BND是有效的链接之后,代码大小代表orted is:27812(for codeless_531_datapump). So, I can compile the project now without extra Keil license.”
It was a long explanation, but I think you can solve your AT+GAPSCAN problem. The whole modified function I zipped and enclosed together with the scree-shot showing the result.
Thanks to Dialog for the support.
Good luck and good health!
Regards,
Janos N.
Thanks so much for the help. Now I can see my devices.
In order to compile I have had to comment more lines within the user_at_command.h, commenting only the two that you indicate increases the size of the program.
I highly appreciate the time you have taken to reply with your message, it was helpful.
Regards.