Xiao BLE sense Motion recognition - serious issues

I am trying to replicate the Motion recognition based on Seeed XIAO BLE Sense project from hackster-io with my new XIAO BLE SENSE,
Motion recognition based on Seeed XIAO BLE Sense - Hackster.io but the code V3.ino provided has issue with include libraries!

#include <XIAO-BLE-gestures_inferencing.h>
#include <Arduino_LSM6DS3TR_C.h>
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>
#include <bluefruit.h>
#include <Adafruit_LittleFS.h>
#include <InternalFileSystem.h>

The Arduino shows lots of errors, it can not find the bluefruit and Adafruit_LittleFS and InternalFileSystem!!!

I have the latest Arduino IDE and installed xiao ble sense version 2.6.1. but there is no libraries mentioned and nor I can install them from the Arduino library manager!
I see also the code is a mix-up and made-up from another code Bluefruit Feather52 from Adafruit Industries

// Configure and Start Device Information Service
  bledis.setManufacturer("Adafruit Industries");
  bledis.setModel("Bluefruit Feather52");
  bledis.begin();

The other strange thing is they train code from Gyro values but they run it from accelerator !!! :
here is the code for training :

void loop() {
if (millis() > last_interval_ms + INTERVAL_MS) {
last_interval_ms = millis();
Serial.print(myIMU.readFloatGyroX() * CONVERT_G_TO_MS2,4);
Serial.print('\t');
Serial.print(myIMU.readFloatGyroY() * CONVERT_G_TO_MS2,4);
Serial.print('\t');
Serial.println(myIMU.readFloatGyroZ() * CONVERT_G_TO_MS2,4);
}

here is the code for running the model:

void loop()
{
uint8_t buf1[64]=“idle”;
uint8_t buf2[64]=“circle”;
uint8_t buf3[64]=“swing”;

u8g2.clearBuffer();
u8g2.setFont(u8g2_font_ncenB08_tr);
ei_printf("\nStarting inferencing in 2 seconds...\n");

delay(2000);

ei_printf("Sampling...\n");

// Allocate a buffer here for the values we'll read from the IMU
float buffer[EI_CLASSIFIER_DSP_INPUT_FRAME_SIZE] = { 0 };

for (size_t ix = 0; ix < EI_CLASSIFIER_DSP_INPUT_FRAME_SIZE; ix += 3) {
    // Determine the next tick (and then sleep later)
    uint64_t next_tick = micros() + (EI_CLASSIFIER_INTERVAL_MS * 1000);

    IMU.readAcceleration(buffer[ix], buffer[ix + 1],buffer[ix + 2]);

    buffer[ix + 0] *= CONVERT_G_TO_MS2;
    buffer[ix + 1] *= CONVERT_G_TO_MS2;
    buffer[ix + 2] *= CONVERT_G_TO_MS2;

    delayMicroseconds(next_tick - micros());
}

Am I missing something here ?? This Motion recognition based on Seeed XIAO BLE Sense project at hackster-io is a from official seeed account? or it is a fake account?
If it is an official seeed, they do not run the code even once?
The code neither compiles nor is correct !!!

1 Like

bCatianus,
I was about to say welcome to the club but when I read till the end, it is worst than I thought. Well, I am not shocked but this is as you said it is a real shame and bad reputation for seeed, and like if they care!
Btw the library issue you are reporting is another big mess that has been discussed here if you search the forum. It seems if you roll back to the board libs version 1.0.0 you should be able to run your code.
It was said seeed’s engineers would release a new version to patch those issues in early May but well what can I say.

update;
Well, I checked the code that you mentioned, and you are right. I am wondering why they do not check or run the code before publishing the project. :thinking:
It looks like somebody just copy-pasted some code and dropped it in hackster.

1 Like

Include <bluefruit.h> is a hint that version 1.0.0 of the board core should be used (see NFC feature on the wiki).
2.6.1 doesn’t support bluefruit, it’s not based on FreeRTOS and requires AndroidBLE instead.

Thank you for your comment. I understand now what the problem is. I will give it a try with version 1.0 on the weekend. However, I do not see any other version on the Arduino board manager. Does anyone know what happened to libs between 1.0.0 and 2.6.1? And why they have jumped from 1 to 2.6.1?
I reviewed most of the comments in the xiao forum. Why doesn’t there seem to be active support?
Although I understand seeed’s focus is on amateurs and hobbyists, but I must confess that observing such behavior, after twenty years of experience, makes you feel that there is intentional deception!
I read your comment on another subject that you are going to give up on, but I stay and request seeed’s answer to clarify and their promised commitment to provide proper support and clear responses.

1 Like

turing-complete-labs,
I already got that from Dr_Blueble’s comment. I am not sure what your point is here! This is not a proper practice to publish a code based on a very old version of the board! or even expect users to use such an old version of the library, additionally, without notifying the user.
Also, there is no need to say the rest of the code is wrong, and it is irresponsible to drop a reference code that they have not run it once before publishing.

1 Like

Sorry, I didn’t realize the 1.0.0 point was already made.
To answer your question the version 1.0.0 is based on Adafruit’s Bluefruit core and runs on top of RTOS; the 2.1.1 runs on top of Arduino (?) core for Nano 33 BLE Sense which runs on top of mBed OS.

If you know how to move around, I suggest using the Adafruit’s core since it has more features. I explained it in an article on how to do that with PlatformIO here.

I believe this is a great board in terms of physical format, but the software support seems half-baked. I found enough info through the forum, schematics and the code to move on on my own. But I feel what you say.

I am not sure about the reason why there are missing libraries between 1 to the latest, and now that you are pointing it out made me curious too.
I understand where you came from but I felt it is just a waste of time working on seeed products or expecting them to reply anymore. My impression is they are not professional otherwise this mess up in “Motion recognition” project alongside other reported problems must be quite embarrassing for them which seems to me they do not care at all. And as you mentioned most of the people who buy these products are doing projects for fun and they do not care about wasting their time even they see it as a challenge to show off their skills. So, please do not get their reply as covering seeed’s poor job.
For a person with paid $100+/hour is just a waste of time reminding seeed’s engineers they are doing a terrible job, so that was the reason I gave up taking xiao ble serious. I just got another board and now I am almost halfway to being done.
Cheers,

1 Like

It’s not really missing libraries, is more likely that they took Arduino mBed code and didn’t finish making all the changes required for their board.

I solved the problem going the opposite way: using the Raytac module sold by Adafruit which is very basic, added the softdevice API used by XIAO (which is version 7.0.0 vs Adafruit’s base 6.1.1) and copied the variants files over.

I don’t know why the code seems to come from someone that’s not officially SeeedStudio (example) but to my surprise my approach worked. All other devices libraries (IMU, microphone, etc.) should be basic component libraries which under PlatformIO are incredibly easy to install.

This board is nowhere close to the level of support of others (Raytac, Adafruit, Sparkfun, Arduino) but I like it because of the form factor. To me cycle over hardware design (I PCB’d 5 versions of my ESP32 dev board and still not happy) would have been more expensive than fixing the issues I have with this one. So I am here to help others who are in a similar situation.

Ciao

turing-complete-labs,
I’ll look at your article. I am a firmware&ASIC engineer but new to Arduino e.g. nrf52840. I want to start a side project with the less expensive device and tools with minimal headache. I think my first pick started from the wrong device and place. I actually did think to set up Arduino with an nrf52840 generic or similar board and define the config file (header file) for xiao. But I read in the forum that there is ambiguity in the xiao ble sense schematics. Assuming I pick the board manager v1.0.0, how many bugs and problems I should expect? I think they have developed to v2.6.1 for a reason, right? fixing the bugs and performances and all that. so what is the point of v2.6.1 at all? it is pretty odd to use this old lib, do not you think?

Dr_Blueble,
I get what you mean, thanks for the wise words.

No problem.
I would have suggested to start with ESP32 which has an incredible support and plenty of educational material to cover every single aspect of such devices. I am a software engineer at a large company going the opposite way :slight_smile:
There are plenty of ESP32 devices, with TinyPico being an excellent fit for the same form factor.
I got into nRF52840 because, as I explained in the article, current ESP32 devices don’t handle BLE without employing a lot of power. Knowing a bit how Arduino worked helped fixing my grudges with this board.
Yes, the pin do not match with the schematics, but the important ones are correct in the variants.h file which is the file that handles the symbols for common peripherals (LED, BUTTON, etc.) and so far so good.
How many bugs should you expect? Adafruit’s Arduino nRF core is pretty stable and the only bugs Seeed XIAO’s specific are going to be limited to the Variants files. That said, I don’t work for them, I just have a generic idea of how these dev kits are put together and so far confirmed by my experiments.
Here to help.

When trying to follow your hackster.io link (from the first post), I am greeted with a “You are not authorized to access this page”.
Is this just me?

It seems they hide it rather than clarifying, but you can find it in web-archive :
Motion recognition based on Seeed XIAO BLE Sense - Hackster.io (archive.org)

or you can find the revised version that they added this can only work in very old version 1.0.0 but still the training code and model are wrong :
Motion Recognition based on Edge Impulse - Seeed Wiki (seeedstudio.com)