Parsing data on R232 RBR Sensor

Hello,

I am integrating an RBR Sensor to the Bristle mouth board and Spotter Buoy. I am attempting to work off the code for the (v0.6.0) Bristlemouth Dev Kit Guide: Integrating an RS232 Serial Sensor. I am on the fourth section, but I am not sure which code to use. The user_code.cpp at the end of the section does not compile. I tried building my own but I am not sure what directives to use.

The sensor I am using is the RBR concerto³ . The output onto the spotter terminal is “82142t f60605e502e024f4, [payload] | tick: 25403, rtc: 0, line: 2024-09-02 14:26:16.500, 0.0012, 24.6651, 23.8400, 200.8109, 0.0117, 1495.9879, 1.2547, 77.3767”

I want to average these over a certain timeframe, then send them via the satellite. Any help would be appreciated.

Thank you

Hi @Swordfish!

I tried to compile the user_code.cpp downloaded from the v0.6.0 RS232 guide and I was able to compile it. Specifically it was the file right after the line: “Your completed serial_payload_guide/user_code/user_code.cpp file should look like this:”
What compile errors are you seeing? What is the cmake command that you are using?

Have you had a chance to check out the OrderedSeparatorLineParser and AveragingSampler? Check out bm_protocol/src/apps/bm_devkit/rbr_coda_example for an example on how to use the OrderedSeparatorLineParser to turn the serial string into values and then use AveragingSampler to perform computations with it!

Let us know if you have any questions!

Victor

Hello,

That is the one I am compiling. I am using make command in the terminal window. This is the error I get.

“(bristlemouth) swordfish@fish-MBP RBR_Data_1 % make
[ 0%] Built target conda_check
[ 26%] Built target lwipcore
[ 26%] Built target linkerscript
[ 26%] Generating version.c, _version.c, version_string – git version: v0.5.0 Consolidate compiler generated dependencies of target bm_mote_v1.0-RBR_Data_1-dbg.elf
[ 26%] Building CXX object src/CMakeFiles/bm_mote_v1.0-RBR_Data_1-dbg.elf.dir/apps/bm_devkit/RBR_Data_1/user_code/user_code.cpp.obj
/Users/swordfish/code/bm_protocol/src/apps/bm_devkit/RBR_Data_1/user_code/user_code.cpp:26:8: error: ‘cfg’ does not name a type 26 | extern cfg::Configuration *userConfigurationPartition; | ^~~
/Users/swordfish/code/bm_protocol/src/apps/bm_devkit/RBR_Data_1/user_code/user_code.cpp: In function ‘void setup()’:
/Users/swordfish/code/bm_protocol/src/apps/bm_devkit/RBR_Data_1/user_code/user_code.cpp:58:3: error: ‘userConfigurationPartition’ was not declared in this scope 58 | userConfigurationPartition->getConfig(“plUartBaudRate”, strlen(“plUartBaudRate”), | ^~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/bm_mote_v1.0-RBR_Data_1-dbg.elf.dir/build.make:814: src/CMakeFiles/bm_mote_v1.0-RBR_Data_1-dbg.elf.dir/apps/bm_devkit/RBR_Data_1/user_code/user_code.cpp.obj] Error 1 make[1]: *** [CMakeFiles/Makefile2:531: src/CMakeFiles/bm_mote_v1.0-RBR_Data_1-dbg.elf.dir/all] Error 2 make: *** [Makefile:91: all] Error 2”

I saw those commands, I wanted to try compiling the user_code before moving to that folder, I did not know they were the same file. I will try it and report back. Do you have an recommendations for extracting the timestamp?

Ahhhh! Okay, I was able to reproduce your build errors.

I looked back at the v0.5.0 guide to see what changed when going to v0.6.0 and I see that the user_code.h file is no longer provided in the guide, however, there is an addition to this file that you need to include. In the user_code.h file you need to add #include "debug_configuration.h" and then your compile error should go away. Let me know if this works or doesn’t!

With regards to extracting the timestamp, is this a timestamp coming from your sensor? If so can you provide an example output string from your sensor?

Hope this helps!
Victor