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

Configuration and Data Layer Access

Configuration and Data Layer Access

jand
Member

I'm trying to implement a snap in Go that lets users send data from configurable data layer paths to an MQTT broker. If I'm understanding correctly the "active-solution" slot/plug is used for storing and reading configuration files as JSON.

Is there an easy way to set some key-value-pairs or does each snap need to provide it's own webserver, website, and configuration UI? Or is the recommended way to download the configuration ZIP-file, uncompress, add a configuration file, compress and upload again?

There is currently no Go example for accessing the data layer, but if I'm reading the C++ "datalayer.client" example correctly, it opens a connection to "tcp://boschrexroth:boschrexroth@127.0.0.1:2069" and uses the REST API. Is the Port always 2069? What username and password should be used, or is there a way to access the data layer from a service that runs in the background, when no user is logged in?

4 REPLIES 4

CodeShepherd
Community Moderator
Community Moderator

If I got you right you like read out data from the ctrlX Data Layer via an own app using go language. The necessary extension in our SDK will be available from RM21.07 on.

At the moment you would have to use a standard http client using the REST API of the ctrlX Data Layer. The TCP connection is one of the ways to a communication and also an inter process communication is available (enumeration for the connection is DL_IPC_AUTO see SDK 1.6.1, example datalayer.realtime, main_user.cpp, line 73). The password used for the TCP connection is simply the one of an user on the crlX CORE that has the right to access the data. As you are running on the same system behind our reverse Proxy a non encrypted communication should be possible.

Ok, I'll look forward to the next SDK. As it is called "RM21.07", will it be available in July 2021?

I'm still a bit unclear on how the username and password should be managed. Is the snap responsible for providing a website with a configuration form, where the username and password is stored by the snap itself to be used when it is running as a service, without user interaction?

CodeShepherd
Community Moderator
Community Moderator

Sorry for the confusion. RM21.07 is meaning the release milestone in July 2021 as you guessed right.

When you are running as a process on the control you do not need username and password for communication. You just need it to get access from the outside. Just have a look in the example (DL_IPC_AUTO) I mentioned above. It is the same for an http client. it will have have access without authentication.

Thank you, I will look into that example and try to recreate it in Go. Looking forward to the next release in July with hopefully more non-C++ example projects to get started more easily.

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