1

I'm trying to build a simple Telegram bot to start and stop an old Samsung device working as a security cam.

All is good via ssh, so the commands involved have been already proved to be working. It's now a matter of moving them to QPython and the python-telegram-bot lib.

Also the bot is already working, running from the device itself. The problem are the commands involving shell calls, as this one (QPython shell is running with root privileges):

am start -n com.pas.webcam/.Rolling

This should open the IP Webcam app. In the QPython's script or console, if I do:

>>> from subprocess import call
>>> call(['/system/bin/am', 'start', '-n', 'com.pas.webcam/.Rolling'])

...I have the error:

CANNOT LINK EXECUTABLE "app_process": \
cannot locate symbol "jpeg_crop_scanline" referenced by "/system/lib/libskia.so"...

...with exit code -6

From what I understand, there's a problem with a library when the IP webcam app is opened from the QPython shell. I cannot find any reference to similar issues.

Any idea on how can I fix this? Thanks.

dentex
  • 3,223
  • 4
  • 28
  • 47

1 Answers1

2

The solution is:

os.environ['LD_LIBRARY_PATH'] = '/data/data/com.pas.webcam/lib'

This is the app's lib path inside the userdata partition. It's not clear to me why the am binary can't find it if launched from QPython.

After that:

cmd = call(['/system/bin/am', 'start', '-n', 'com.pas.webcam/.Rolling'])

...finally works.

dentex
  • 3,223
  • 4
  • 28
  • 47