I
I
Igor Chernyshev2017-06-21 18:56:47
linux
Igor Chernyshev, 2017-06-21 18:56:47

How to designate environment variables for starting Process in Arduino Yun?

I'm trying to run a python script from an Arduino Yun sketch. It looks simple and clear:

process sensor_log;
sensor_log.begin("python");
sensor_log.addParameter("/mnt/sda1/test.py");
sensor_log run();
while (sensor_log.available() > 0) {
char c = sensor_log.read();
Console.print(c);
}

The python script itself only contains print(123). And with this layout, everything works fine. But as soon as I want to use the sqlite3 library and import it, the script execution stops, without any visible errors, warnings, etc. The point, most likely, is that in order to use these libraries, the LD_LIBRARY_PATH environment variable must be set, in which, in fact, the path to the library is indicated. From which user this arduino script runs - I have no idea, and I don’t know how to designate environment variables for this user before running the script.
Any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vanyamba-electronics, 2017-06-23
@vanyamba-electronics

You can try adding to the script:
os.environ["LD_LIBRARY_PATH"] = "/usr/lib"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question