tangle-accelerator icon indicating copy to clipboard operation
tangle-accelerator copied to clipboard

Implement endpoint_diagnose app for recording hardware information

Open marktwtn opened this issue 5 years ago • 5 comments

A new app is required to let the user have the endpoint and hardware status. The naming of the app is endpoint_diagnose.

Goal: Record or log the following information:

  • [x] Signal strength
  • [x] GPS
  • [x] Timestamp
  • [ ] Transaction sending failure

marktwtn avatar Jun 25 '20 00:06 marktwtn

I am trying to use the API offered by Legato to get these informations.

To use the API, we must include the corresponding header file and modify the Component.cdef and the .adef file.

When I was trying to get the signal strength, everything went well.

  • Include le_mrc_interface.h
  • Component.cdef
    requires:
    {
      api:
      {
        modemServices/le_mrc.api
      }
    }
    
  • .adef
    bindings:
    {
      test.testComp.le_mrc -> modemService.le_mrc
    }
    

However, when I was trying to get the information of GPS, the app just hung there. It did not start to execute at all. I just add the following modification:

  • Component.cdef
    requires:
    {
      api:
      {
        modemServices/le_mrc.api
        positioning/le_gnss.api
      }
    }
    
  • .adef
    bindings:
    {
      test.testComp.le_mrc -> modemService.le_mrc
      test.testComp.le_gnss -> positioning.le_gnss
    }
    

I will try to figure out the problem.

marktwtn avatar Jul 01 '20 03:07 marktwtn

The problem has been solved. Just replace positioning with positioningService in .adef file.

However, there are things to be mentioned:

  • Somehow the GPS information has latitude and longitude but no horizontal accuracy.
  • The minute and second of the time information are correct, and the others are wrong.

marktwtn avatar Jul 03 '20 08:07 marktwtn

After the hardware is connected to the network, the time is synchronized. Check https://docs.legato.io/latest/howToSetUserTimebase.html.

However, the Linux command date is correct but the time APIs give the wrong time without considering the time zone.

marktwtn avatar Jul 13 '20 15:07 marktwtn

For the IPC between endpoint and diagnose app, I reference the Low-level Messaging API and add the corresponding APIs. It does not work because of the lacking of the binding, which should be added in *.adef and *.cdef.

However, the rule to write the binding is not quite clear in the Legato document.

marktwtn avatar Jul 27 '20 00:07 marktwtn

For communicate with two components in same executable, you can refer to the Extend helloWorld.

splasky avatar Jul 27 '20 01:07 splasky