Hello old friends. I’m back trying to launch programs with my Raspberry Pi, but now I have a Pi 4 and I was never really satisfied with using nodejs, because … ew.
Anyway, I’m trying new things and attempting to launch programs using blynk with Python.
I found some handy code samples and some help on this forum Python Terminal (updates and FIFO) but, when I try to run my simple program I get this error “('Cmd too big: ', 8245)”
Any idea what’s going on? I’ve tried it multiple ways, but every time I get this error, it seems.
thanks for the help
-J
#!/usr/bin/env python
import os
import sys
import errno
import BlynkLib
BLYNK_AUTH = 'd84d576c8bdb4ca2a7c459949396b47b'
blynk = BlynkLib.Blynk(BLYNK_AUTH)
playing = "0"
eca = None
@blynk.VIRTUAL_WRITE(1)
def v1_write_handler(value):
global playing
global eca
if value[0] == '1':
print '1';
os.system('top')
eca = subprocess.Popen(['top']).pid
print(eca)
playing = "1"
if value[0] == '0':
if playing == "0":
return
eca.terminate()
playing = "0"
print '0'
@blynk.ON("connected")
def blynk_connected():
print 'connected';
while True:
blynk.run()