A customer try to compile the python example in the SDK V1.8. using Pi running Ubuntu 18.04 server, but got this warning while building:
screenshot1
He can install it in the CORE without a problem, but when running he encounter this:
screenshot2
Also tried running it manually, but this doesn’t have the right environment.
screenshot3
Any tipp or idea? Thanks!
Solved! Go to Solution.
Hi redford,
yes you are right, you cannot run the script manually without the right environment.
Just a small hint, your customer can check the user-permissions of the start script "register_node" before running snapcraft.
Regards
Johannes
Hi Johannes,
could you please be more specific where and what we should change in the start script? Any tips how we can run the script?
Thanks!
Hi redford
you can see in the screenshot the "regeister_node" script. Open the folder ./datalayer.provider/wrapper, then you can check the permissions with "ls -alh".
It should be executable.
If it is possible you can provide the systemreport.
Regards
Johannes
Hello Johannes,
Manage to build the python snaps for the CORE! Thank you for the help!
Now we try to run a flask server. We managed to run it on the emulation without problems, but on the real CORE it is saying that the connection is already in use (0.0.0.0:5000).
I also tried different ports and I’m using 0.0.0.0 to be able to access it from the outside.
Do you have any idea how we could go around this?
Also, is there any way to not specify the connection provider?
This was possible with the C++ SDK, but I couldn’t accomplish it here…
Best regards
Hi Redford,
My Flask app(s) are working. Example i hope it may help you.
I have just proxy integration. It is simply a basic demo.
Mauro
Your example works, thanks for that!
Other question, I am not able to give removable media access to the python snaps
We were able to give it to the C++ snap, but with python it doesn't work. Any idea how to solve it?
Hi redford,
Neve tried to do it. I think that the deviceadmin snap should connect any plug autonomously but i am not a developer. paste here the .yaml(s) if you can, maybe i can give you an hint.
where have you seen the message on the screenshot? never seen it.
Mauro
the message can be seen in the logbook..
here is the snapcraft.yaml:
name: rexroth-python-provider
version: 1.0.0
summary: Testsnap for Python
# title: SDK-Python
description: 'It Provides simple data to ctrlX Data Layer
'
base: core18
confinement: strict
grade: devel
apps:
interpreter:
command: python3
plugs:
- network-bind
- network-observe
- serial-port
- removable-media
provider:
command: wrapper/register_node
plugs:
- network-bind
- network-status
- removable-media
daemon: simple
flask-server:
command: wrapper/runserver
plugs:
- network-control
- network-observe
- network
- network-bind
- process-control
- gsettings
- udisks2
- hardware-observe
- system-observe
- mount-observe
- removable-media
daemon: simple
parts:
interpreter:
plugin: python
python-version: python3
source: .
#python-packages:
#- jupyter
provider:
plugin: python
python-version: python3
source: .
python-packages: # requirements go here
- ./ctrlx-sdk/public/whl/ctrlx_datalayer-1.0.1-py3-none-any.whl
- ./ctrlx-sdk/public/whl/ctrlx_fbs-1.0.0-py3-none-any.whl
- flatbuffers~=1.12
- flask
- flask-socketio
- python-socketio
files:
plugin: dump
source: .
# describes which interface slots are supported by defining the plugs
plugs:
datalayer:
interface: content
content: datalayer
target: $SNAP_DATA/.datalayer
system-files:
interface: system-files
write:
- /dev/shm
Since there where conflicts with removable-media interface and another feature, we decided to allow the usage only for signed apps reviewed by us to ensure system integrity. In the upcoming release 1.10.x the interface removable-media will be available and can be used by unsigned apps.
HI jochen-scheib,
really cool!!