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

Python snap unable to connect to datalayer

Python snap unable to connect to datalayer

anonymousLIN
New Poster

Hello,

As I deployed a python-based snap to read values from datalayer (based on the example provided by ctrlX Automation SDK), I encountered the following issue where the snap was unable to connect to datalayer client.

The error messages are logged as per the attachment below:

yeetlinyap_0-1675066279655.png

yeetlinyap_0-1675068094014.png

 

I have tried deploying similar snap built with C++ and it works. Can anyone help/advise on this issue? Thanks 🙂

 

Regards,

Lin 

4 REPLIES 4

nickH
Community Moderator
Community Moderator

Hi Lin, 

First of all, you can ignore the message you get (apparmor="DENIED" operation="open"....). This was a bug in the device admin, which got already fixed in the newer versions. But other than notifications in the logbook this bug didn't have any negative effect and can be ignored. See also this post.

Which version do you use? (You can check the version, when you look at the system apps on your ctrlX CORE). 
If you use a version prior to V1.16, you could check if your ctrlX CORE is in operating mode. 

Best regards,

Nick

 

Hi Nick,

Thanks for your clarification regarding the bug. However, I've tried both V1.12 and V1.18 running in Operating Mode on ctrlX Core physical device and still received the error:

AVC apparmor="DENIED" operation="open" profile="snap.dev-sdk-py-datalayer.client" name="/sys/devices/platform/amba_pl@0/a0020000.ecm-ip-core/uio/uio0/name" pid=4117 comm="python3" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

 

Four your reference, I also attach hereby the yaml file to build the snap application:

name: dev-sdk-py-datalayer

version: 2.4.0

summary: Data Layer client sample written in Python for ctrlX.

title: dev-sdk-py-datalayer

description: |

  The sample demonstrates how to read values from ctrlX Data Layer tree and write out the values to console.

base: core20

confinement: strict

grade: stable

apps:

  client:

    command: bin/main.py

    plugs:

      - network

      - datalayer

    daemon: simple

    passthrough:

      restart-condition: always

      restart-delay: 10s

     

parts:

  client:

    plugin: python

    source: .

    stage-packages:

      - libzmq5

      - ctrlx-datalayer

plugs:

  datalayer:

    interface: content

    content: datalayer

    target: $SNAP_DATA/.datalayer

 

nickH
Community Moderator
Community Moderator

Thanks for the additional information. Your snapcraft.yaml looks good. Did you try it with the samples from our SDK (without changes)? I was not able to reproduce your error. If you did some changes, what did you change?

CodeShepherd
Community Moderator
Community Moderator

Is this still an issue or can the topic be closed?

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