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

Accessing USB serial port with Node application / snap build fails

Accessing USB serial port with Node application / snap build fails

japikas
Established Member

Hi,

I'm trying to access USB serial device from custom snap Node application in CtrlX CORE. I have developer-enabled version of CORE with ssh access to terminal. Inside CORE I can receive data with miniterm from my USB device connected to the integrated USB-C port of CORE. So far so good. Also my node application, when running in development environment (native Linux or MacOS) can receive data from the USB device, so nothing wrong with the node application itself.

I have described serialport dependency in the package.json of my snap as follows:

    "dependencies": {

        "serialport": "^10.3.0"

    },

When building the snap, I get following error message:

Staging app 

+ snapcraftctl stage

Priming app 

+ snapcraftctl prime

not a dynamic executable

not a dynamic executable

Unable to determine library dependencies for '/home/boschrexroth/sick/prime/lib/node_modules/sick/node_modules/@serialport/bindings-cpp/prebuilds/android-arm64/node.napi.armv8.node'

not a dynamic executable

not a dynamic executable

Unable to determine library dependencies for '/home/boschrexroth/sick/prime/bin/node'

not a dynamic executable

not a dynamic executable

Unable to determine library dependencies for '/home/boschrexroth/sick/prime/lib/node_modules/sick/node_modules/@serialport/bindings-cpp/prebuilds/linux-arm/node.napi.armv6.node'

not a dynamic executable

not a dynamic executable

Unable to determine library dependencies for '/home/boschrexroth/sick/prime/lib/node_modules/sick/node_modules/@serialport/bindings-cpp/prebuilds/android-arm/node.napi.armv7.node'

not a dynamic executable

not a dynamic executable

Unable to determine library dependencies for '/home/boschrexroth/sick/prime/lib/node_modules/sick/node_modules/@serialport/bindings-cpp/prebuilds/linux-arm/node.napi.armv7.node'

not a dynamic executable

not a dynamic executable

Unable to determine library dependencies for '/home/boschrexroth/sick/prime/lib/node_modules/sick/node_modules/@serialport/bindings-cpp/prebuilds/linux-arm64/node.napi.armv8.node'

This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft:

- libc.musl-x86_64.so.1

These dependencies can be satisfied via additional parts or content sharing. Consider validating configured filesets if this dependency was built.

The 'passthrough' property is being used to propagate experimental properties to snap.yaml that have not been validated.

Strange thing here is that the error message is referring to x86 architecture, even if I'm building for ARM:  build-snap-arm64.sh 

The snap'd application itself works, I can see console.log debug printing in log file, but it simply does not receive any data from serial port, even if the specified /dev/ttyACM0 interface exists.

Any ideas?

2 REPLIES 2

japikas
Established Member

Missing piece of information: I'm building in App Build Environment of WORKS version 1.18.2 

japikas
Established Member

Got my problem solved. Had to enable access to the serial port by adding it in snapcraft.yaml file:

    plugs: [network, serial-port]

However, the error message is persistent when building the snap app. To ensure it's not caused by any of my configuration changes, I created a new App Build Environment (1.18.2) and only installed sdk (1.18.0) and snapcraft with the scripts included. The error message is as stated above.

My snap app source is copy of the hello-world Node sample, with only src/app.ts, package.json and snap/snapcraft files modified accoringly.

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