Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

How to gain access to the logs of an app on my CtrlX CORE?

How to gain access to the logs of an app on my CtrlX CORE?

cdutz
Long-established Member

Hi,

so I've managed to get my application working so far with the Rest interfaces and it's working nicely locally and I've managed to build a snap for arm64 and install it on my device. However there's no webserver starting on port 8080 ... so I guess something's wrong. However I currently see no way of accessing the actual log messages that the excution of the snap produces, so it's difficult to track down any potential problems.

Thanks,

   Chris

2 REPLIES 2

Sgilk
Frequent Contributor

Hi Chris,

You are trying to host a webserver on port 8080 from your custom snap? If you could provide some more information on this point (error messages, build logs etc.) I could better help troubleshoot.

How are you writing log messages in your snap? There are a number of ways to do this. In C++, standard library control output (std::cout) will write a system message that can be toggled in the ctrlX diagnostic logbook (settings->show system messages).

See this example on more configurable logbook output using the sd-journal library: CPP Diagnostic Logbook 

If messages are not being written to the ctrlX diagnostic logbook, you will need an SSH connection to debug. On a virtual CORE, this is enabled by default. If you'd like SSH on a physical CORE, you'll need to request a system user assertion file. (See topic "SSH to the core disabled")

Some useful debug/log tools:

  • snap logs snap-name
  • systemctl status snap-service
  • journactl

It's also useful to build a snap for amd and run it in your app build environment before building for arm. This way you can debug all non-architecture specific issues prior to testing on the physical device.

cdutz
Long-established Member

Hi,

sorry for the late reply, was working hard till the SPS fair in Nürnberg but after that had to take care of other things first and completely rewrite the App I was showing. Now I've reached a point where I can continue.

In the end getting root access to the real PLC was the option that I used and that helped me track down what was going on.

thanks,

 Chris

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist