Process Priority

The arduino side create a process constantly to call a python in the linux side (store data in mysql). If i run the web interface i can see perfectly the data … but if i recharge the page constantly the CPU collapses for a few seconds and this affects the storage of the python data in this time.

I see the CPU priority command in linux “nice -n-20” (priority is in range -20 to 20):

Example for wifi status:

Process p;
p.runShellCommand("nice -n-20 /usr/bin/pretty-wifi-info.lua | grep Signal");
int estado_wifi = p.parseInt();
p.close();

The time is very fast!, but if i try this it NOT found:

 Process p;	
  p.begin("nice -n-20 /mnt/sd/arduino/www/arduino_temperatura/py/agregarLecturaX.py");	
  p.addParameter(String(temperatura_celsius));
  p.addParameter(direccion_sensor);
  p.addParameter(String(accion));
  p.run();
  String estado_pines="";
  while(p.available()>0) {
    estado_pines += (char)p.read();
  }
  p.close();

How I can solve the problem?
And if i recharge the page constantly (without affect the process and collapse the cpu)?
Can I solve the times of request if i run the process asynchroniusly?

Thanks!!!

nano /mnt/sd/arduino/www/arduino_temperatura/py/agregarLecturaX.py
#!/usr/bin/python
...
chmod 755  /mnt/sd/arduino/www/arduino_temperatura/py/agregarLecturaX.py

Testing "agregarLecturaX.py":

/mnt/sd/arduino/www/arduino_temperatura/py/agregarLecturaX.py 37 1 200

Testing "nice -n -20":

/bin/nice -n -20  /mnt/sd/arduino/www/arduino_temperatura/py/agregarLecturaX.py 37 1 200

ATmega32u4 code:

Process p;	
  p.begin("/bin/nice");
  p.addParameter("-n");
  p.addParameter("-20");
  p.addParameter("/mnt/sd/arduino/www/arduino_temperatura/py/agregarLecturaX.py");	
  p.addParameter(String(temperatura_celsius));
  p.addParameter(direccion_sensor);
  p.addParameter(String(accion));
  p.run();

And what happens if y recharge constantly the page? (Arduino YUN Linux colapse :() .Thanks a lot bro!!!

criminalkaoz:
And what happens if y recharge constantly the page? (Arduino YUN Linux colapse :() .Thanks a lot bro!!!

How fast you need refresh? few second?

Is for testing prupose. My system depends to the linux side and if it fails... the production fail (money).

The system start and question the number of sensors connected. Arduin side get the information of sensor (actions) to the linux syde (python and mysql) and receive the information every time in the arduino side (make an action widh this information). If i refresh the page constantly the linux side colapse for a few seconds and in this time the arduino side is waiting for the response to the linux side and wait wait wait wait (in this time the production fail because the action is very important ---> temperature control).

by pass bridge class, use ATmega32u4 flood sensor datas to UART port, Linux use C to monitor UART port and re-broadcasting data to TCP port.