Issues with phpserial

I'm reading a temperature with Arduino and a LM35 sensor.

A PHP page, through phpserial, reads the current temp value sampled by Arduino 10k, by mean of USB port.

The first issue is that I have, every time I connect Arduino, to set up again /dev/ttyUSB0 permission to 777 (otherwhise phpserial isn't able to open the device).

The second issue is that on the first loading of PHP page, it prints"0" instead the current temperature...the next loading, instead, was ok also if sometime and randomly the "0" happens again.

Then I tried to make an array of 30...40 reading (by mean of a for loop) and I noticed that the first 3-4 reading are lost (print "0").

I traced serial stream and noticed that the data was correctly sent from Arduino to PC...

My OS is Ubuntu 8.04.
:frowning:
Was wondering If I have to make some mod to phpclasses to workaround above issues.

Thanks in advance.

For the permission problem, try add the user www-data in the dialout group:

sudo gpasswd -a www-data dialout

After that restart apache2:

sudo invoke-rc.d apache2 restart

It works thanks!

Fixed also issue #2 after reading this great post:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1213719666/28#28

I had to disable autoreset by putting a 150 ohm resistor between +5V and RESET pins

Now all works fineeee :slight_smile: