We are pretty new to using torizon as a platform and we are coding predominantly in python. When we use the vscode extension to setup a new python project, we are able to deploy the hello world script no problem. The problems only start when we try and add new packages.
We have been struggling with gpiod, but now we have tried other packages and we dont seem to be able to get even things like numpy on the device.
Would really appreciate a more in depth rundown on how to add these without such headache. We are using a veridin imx8+ on a mallow carrier board.
The easiest way to add a package is through the requirements-debug.txt file in your project files. This file is called from your dockerfile during deployment. You can also add packages through the torizonPackages.json
If you are trying to access the GPIO on the mallow carrier, you will need to expose all the gpio chips as devices or you will run into some errors (this is if you are using the chipiterator function, which you probably will be).
To expose the gpio chips, add them under “devices” in the docker-compose.yml file. Here is an example:
We have been struggling with gpiod, but now we have tried other packages and we dont seem to be able to get even things like numpy on the device.
Just to clear up a possible misconception here. With our extension you’re developing a container that will have your application along with all it’s dependencies. You’re not exactly installing these packages directly on the device itself. This container will the run on the device but these packages will only be available in that specific container. Just wanted to clear that up since it does make a difference.
Hi there,
I got it working thank you ! I am struggling to find material on how to control the pin for python code. Is there a simple example script to trigger the pin on and off?
Thank you for that, i got it working also. I have just added opencv to my container and I was wondering how to view the output image by rtsp? is there any material that you would recommend to make this work easier for my python application ?