DDS-XRCE Exception (28)

4 posts / 0 new
Last post
Offline
Last seen: 2 years 11 months ago
Joined: 11/10/2021
Posts: 1
DDS-XRCE Exception (28)

Hello, I'm a student at Hungary, and i got a project to do at the university, which is include DDS-XRCE.
I have to read sensor data from a temperature sensor with an "NodeMCU Lua Amica Module V2 ESP8266 ESP-12F WIFI Wifi Development Board with CP2102". I'm trying to use the SensorWriterUdp arduino program from the RTI GitHub, but it only trows "Exception (28)" as soon as it connects to the nano-agent.
I cound't find any information what it could be. If anyone knows please help me out!

Thank you so much!
Gyula

AttachmentSize
Image icon The Exeption (28)31.56 KB
asorbini's picture
Offline
Last seen: 1 year 1 month ago
Joined: 02/06/2013
Posts: 11

Exception 28 is an error code of the ESP8266 BSP caused by an invalid memory access (you can find it in section 2 of this official manual).

The first step would be to run the stack trace through the ESP8266 exception decoder (available for the Arduino IDE and as a CLI version). If you're not already familiar with it, you might find this guide useful.
 
The decoded stack trace should help us determine where the exception is being thrown in the code.
 
Another useful step for debugging the error would be to enable the logging statements embedded in the library. Logs are disabled by default, and they can be enabled by setting macro NANO_FEAT_LOG when building the library.
 
Log would be automatically enabled when building Debug libraries with CMake, but I assume your project is not built with CMake, so I'll propose a couple of alternatives:
 
- If you are using the Arduino IDE, your options are very limited, and you will need to modify file `nano_core_user_config.h` which is designed to give users a way to customize various macros in such constrained situations. Once you have located the file, uncomment/add the line `#define NANO_FEAT_LOG 1`.
 
- If you are using Platform.IO, then you can add `-DNANO_FEAT_LOG=1` to the `build_flags` field of your project.
 
Once logging has been compiled in, you will have to enable statements at your desired level of verbosity. You can do this by defining macro NANO_LIMIT_LOG_LEVEL_DEFAULT to one of the log level macros (similarly to how you define NANO_FEAT_LOG). Or you can add a call to `Client::log_level()` (e.g. `client.log_level(XRCE_LOG_LEVEL_DEBUG);`). Keep in mind that when debug is enabled, there might be a lot of text coming out of the board, especially at high verbosity levels.
 
Anyway, if you can capture logs and share them , it will be useful to try to look through them to try to understand what's happening. Same for the agent's logs. Fortunately, on that side, logs are always compiled in and they can be enabled via command line argument (e.g. `-v 3`).
 
If you are using the Arduino version of the library, I would also recommend to make sure to use the latest version by regenerating the Arduino bundle. I have also attached an updated zip that I just generated from the latest commit.
File Attachments: 
asorbini's picture
Offline
Last seen: 1 year 1 month ago
Joined: 02/06/2013
Posts: 11

I have been able to get my hands on the same exact board, but I am still unable to reproduce the errors that you are seeing.

I tried running the SensorWriterUdp example with the agent running on both Linux (Ubuntu 20.04) and Windows (10), and in both cases the board was able to successfully communicate with it, and data was published on the DDS databus.

For reference, this is a summary of the test:

  • Clone and build nano using Connext 6.0.1 (example is for Linux, but Windows follows a similar workflow):
    • git clone --recurse-submodules https://github.com/rticommunity/nano-agent
      
      source ~/rti_connext_dds-6.0.1/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.bash
      
      mkdir build
      
      cmake -B build -Hnano-agent -DCONNEXTDDS_DIR="${NDDSHOME}" -DCMAKE_INSTALL_PREFIX=install
      
      cmake --build build --target install
      
      ./install/bin/nanoagentd -c nano-agent/nano-client/resource/xml/examples/sensor_agent.xml -a -U -v 3
      
  • (Requires make, thus probably on Linux only) Regenerate the Arduino packaging of nano-client to make sure to use the most recent version of the library:
    • rm -rf ~/Arduino/libraries/nano-client-arduino*
      
      make -C nano-agent/nano-client/extras/nano-client-arduino INSTALL_DIR=~/Arduino/libraries
      
  • Modify/build/upload SensorWriterUdp.ino using the Arduino IDE
    • Customize macros WIFI_SSID, WIFI_PASSWORD, and AGENT_ADDRESS to match you local network configuration.
    • The following is a screenshot of the configuration parameters used for the board:
    • Arduino configuration for NodeMCU board
FMA
FMA's picture
Offline
Last seen: 1 year 1 week ago
Joined: 09/09/2014
Posts: 10

@asorbini must the RTI Connext be version 6.0.1? Can I use 7.2.0?