Course module 12 finishes up by implementing a weather station device using the the Environmental sensors and the BLE device. This course module is another example of the course not being finished before it was released. There are 3 lab videos, the first one is a combination of the following two and probably should have been deleted.
In module 11 I encountered a problem where the device did not seem to be advertising its BLE characteristics. I wondered if this could be associated with the fact that we were provided with a different BLE shield than what the project had used. We received an X-NUCLEO-IDB05A1 which replaced the XNUCLEO-IDB04A1 which had been deprecated. I tried building the weather station program with the same result as previously. The program built and downloaded successfully but BLE did not seem to be working. After a lot of Google searching I found some X-CUBE-BLE1 apps that implemented drivers on the X-NUCLEO-IDB05A1: https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32c…
One of these apps was a SensorDemo_BLESensor app. It approximated what the weather station program was trying to do. I tried building and deploying it and voila - everything worked.
I was able to discover the device:
and display the environmental sensors:
And plot the data:
After a close examination of the code, I discovered that X-NUCLEO-IDB05A1 requires extra parameters when setting up its GAP profile.
Here are the gap_init functions:
tBleStatus aci_gap_init_IDB05A1(uint8_t role, uint8_t privacy_enabled, uint8_t device_name_char_len, uint16_t* service_handle, uint16_t* dev_name_char_handle, uint16_t* appearance_char_handle)
tBleStatus aci_gap_init_IDB04A1(uint8_t role, uint16_t* service_handle, uint16_t* dev_name_char_handle, uint16_t* appearance_char_handle)
The IDB05A1 has two additional parameters, privacy_enabled and device_name_char_len. The latest mbed SDK code has provisions to handle either board. The lab code using an older version of the SDK does not have the extra code for the IDB05A1. So again, the course is out of date.
I thought that I might try to fix the old program, but the file structure and file locations have changed between SDK versions and I also found that there were 89 references to the IDB05A1 in the files. Other incompatibilities probably exist. So, I guess I'm satisfied that I accomplished the intent of the lab. Not worth the effort to make it work exactly like it should have.
The final section of the course was to build a weather station app for the Android device. I thought I'd give it a try to see if I could get it to work with the new mbed code. Again, ran into problems with obsolete code. This time the Android code/configuration.
The versions of Gradle used previously have issues with the latest version of Android Studio. A bit beyond my current level of understanding. I went through a couple rounds of updates and finally was successful after upgrading to the latest versions of Gradle and Gradle Plugin (was a bit of a pain because the version numbers don't track easily - needed to find a cross reference table). I ended up using Gradle 5.1.1-all and Gradle Plugin 3.4.1.
I was able to deploy the app to my Nexus tablet, but it didn't work (wouldn't connect).
At this point, I think I'm done. It has been a very frustrating experience. All that's left is to write my review.
Top Comments