Go to advanced search

by loop_1
Wed Jun 28, 2017 3:36 pm
Forum: Python
Topic: script killed...
Replies: 4
Views: 703

Re: script killed...

Thanks! Ok, i tried to add a |logfile but it is empty also after the end of the python process... Randomly i see the top and the system usage is low... but i can't see it when the python process is killed beacuse it is randomly... the last time, it keep alive for two weeks... today i restarted it an...
by loop_1
Wed Jun 28, 2017 2:36 pm
Forum: Python
Topic: script killed...
Replies: 4
Views: 703

script killed...

HI, i use my raspi only for one purpose: it is connected to a RS485 usb key in order to read the values from a watt meter installed in my home and send the data to the emoncms.org server... i use this script: ​ import os import time import requests while 1: sdm120 = os.popen("/usr/local/bin/sdm120c ...
by loop_1
Mon Jan 09, 2017 9:19 pm
Forum: Beginners
Topic: Python script use high CPM and memory
Replies: 0
Views: 294

Python script use high CPM and memory

Hi i have this script: import os import time import requests while 1: sdm120 = os.popen("/usr/local/bin/sdm120c -a 1 -b 9600 -q /dev/ttyUSB0 -w 5 -j 10 -z 5 -i -p | cut -d' ' -f1-2 | tr ' ' ','") i = sdm120.read() sdm120.close() dati = "csv=" + i print dati r = requests.get("https://emoncms.org/inpu...
by loop_1
Wed Dec 21, 2016 3:23 pm
Forum: Automation, sensing and robotics
Topic: python script stop
Replies: 2
Views: 674

Re: python script stop

oh i doesn't think was it necessary...

And how i can close the connections? I can use this code?

Code: Select all

process = os.popen('script')
preprocessed = process.read()
process.close()
by loop_1
Wed Dec 21, 2016 1:30 pm
Forum: Automation, sensing and robotics
Topic: python script stop
Replies: 2
Views: 674

python script stop

Hi, i have finally a fully functional python script that start at startup/reboot. I have inserted this code in my crontab @reboot /usr/local/bin/python /home/pi/sendemoncms.py The script is this: import os import time import requests while 1: i = os.popen("/usr/local/bin/sdm120c -a 1 -b 9600 -q /dev...
by loop_1
Thu Dec 01, 2016 9:31 am
Forum: Troubleshooting
Topic: Execute python at startup
Replies: 4
Views: 803

Re: Execute python at startup

Thanks, now the script start automatically after startup!

...but i have another problem... after about 2 days the script functions aren't available... if i try a reboot, the python script run normally... for about 2 days....

there is any timer function that i ignore?
how i can verify the problem?
by loop_1
Fri Nov 18, 2016 8:19 pm
Forum: Troubleshooting
Topic: Execute python at startup
Replies: 4
Views: 803

Re: Execute python at startup

Thanks!!!!
by loop_1
Fri Nov 18, 2016 5:50 pm
Forum: Troubleshooting
Topic: Execute python at startup
Replies: 4
Views: 803

Execute python at startup

Hi, i have a problem... I need to execute this code at startup: File name sendemoncms.py import os import time import requests while 1: i = os.popen("sdm120c -a 1 -b 9600 -q /dev/ttyUSB0 -w 5 -j 10 -i -p | cut -d' ' -f1-2 | tr ' ' ','").read() dati = "csv=" + i print dati r = requests.get("https://e...
by loop_1
Mon Jun 15, 2015 9:10 pm
Forum: Networking and servers
Topic: senda data to Emoncms
Replies: 0
Views: 915

senda data to Emoncms

Hi! I have a emoncms server on my Raspi and use an SD120c connected via modes in order to collect the data. I have written this code in python: import os import time import requests while 1: dati = os.popen("sdm120c -a 1 -b 2400 /dev/ttyUSB0 -q").read() print dati dati2 = "csv=" + dati print dati2 #...
by loop_1
Mon Jun 15, 2015 9:05 pm
Forum: Italiano
Topic: Raspberry, modbus, emoncms
Replies: 1
Views: 666

Re: Raspberry, modbus, emoncms

questo è lo script in python, mi pare corretto ma il server emoncms non riceve nulla... se copio la url generata e la copio in un browser funziona invece... cosa sbaglio?? import os import time import requests while 1: dati = os.popen("sdm120c -a 1 -b 2400 /dev/ttyUSB0 -q").read() print dati dati2 =...
by loop_1
Mon Jun 15, 2015 1:10 pm
Forum: Italiano
Topic: Raspberry, modbus, emoncms
Replies: 1
Views: 666

Raspberry, modbus, emoncms

Ciao a tutti, ho un raspi B che uso sia per l'irrigazione che, ora, per registrare i consumi dell'impianto elettrico tramite modbus. Ho solo un problema, come inviare i dati al server emoncms che li gestisce? io tramite script in python riesco a leggere i dati via modbus ed a formattarli per attacca...
by loop_1
Tue Mar 03, 2015 4:25 pm
Forum: Networking and servers
Topic: Two web server on the same RasPi
Replies: 5
Views: 2277

Re: Two web server on the same RasPi

Thanks! now i try this!
by loop_1
Sun Mar 01, 2015 7:01 pm
Forum: Networking and servers
Topic: Two web server on the same RasPi
Replies: 5
Views: 2277

Re: Two web server on the same RasPi

yes, i need to change the port but i think that there is also a sql conflict...
by loop_1
Sat Feb 28, 2015 11:51 am
Forum: Networking and servers
Topic: Two web server on the same RasPi
Replies: 5
Views: 2277

Two web server on the same RasPi

Hi! My name is Ale, from Italy. I'm a beginner in the raspi world but i have two projects: 1- sprinklers_pi 2- Emoncms can i install both on the same Raspberry? If i install sprinklers_pi it's all ok... If i install Emoncms it's all ok... but when i install the sprinklers_pi over the machine with Em...

Go to advanced search