Gallen1119
Member
I checked permissions as well as the path previously but I will for sure check that again...
UPDATE: [...]
Watch this space...
#The following 2 lines passes the PIN and PULSE COUNT t$
path = '/var/www/includes/pours.php'
#The following 2 lines passes the PIN and PULSE COUNT t$
path = '/var/www/html/includes/pours.php'
So I re-checked the permissions and the path as stated, and they seemed correct. As I looked at the other code for flow_monitor.py (and I am MOST DEFINATELY not a coder) I found this on lines 45-46
Code:#The following 2 lines passes the PIN and PULSE COUNT t$ path = '/var/www/includes/pours.php'
I don't know if it was the correct thing to do, but I changed it to this
Code:#The following 2 lines passes the PIN and PULSE COUNT t$ path = '/var/www/html/includes/pours.php'
and it seems to be working. Did I screw anything obvious up?
Edit: Something still not right that my poor little mind cannot grasp, but I am working on it.
The success did not persist through a reboot. It does work, if after I reboot I stop flowmon and directly run flow_monitor.py in a terminal window.
sudo update-rc.d flowmon defaults
okay so i followed day tripprs advice from above cause I wasnt sure if you were talking to me or the other guy but heres the output of that
pi@raspberrypi:~ $ sudo /etc/init.d/flowmon stop
[ ok ] Stopping flowmon (via systemctl): flowmon.service.
pi@raspberrypi:~ $ sudo /var/www/python/flow_monitor.py
Traceback (most recent call last):
File "/var/www/python/flow_monitor.py", line 13, in
arduino = serial.Serial(port,9600,timeout=2)
File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 236, in __init__
self.open()
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyS0: [Errno 2] No such file or directory: '/dev/ttyS0'
so those error messages that serial isnt working is not a problem? I installed my raspberry pints in /var/www not it /var/www/html so I dont think that is my problem but nothing updates when i blow through the sensor
Did you miss this step:
Code:sudo update-rc.d flowmon defaults
(makes flowmon start after reboot)
now I get this?
sudo /var/www/python/flow_monitor.py
File "/var/www/python/flow_monitor.py", line 9
port = '/dev/ttyAMA0
^
SyntaxError: EOL while scanning string literal
ls -l /dev | grep serial
lrwxrwxrwx 1 root root 7 Aug 2 20:18 serial0 -> ttyAMA0
ls -l /dev | grep ttyS0
lrwxrwxrwx 1 root root 7 Aug 2 20:31 ttyS0 -> ttyAMA0
sudo /etc/init.d/flowmon start
[....] Starting flowmon (via systemctl): flowmon.serviceFailed to start flowmon.service: Unit flowmon.service failed to load: No such file or directory.
$ ls -l /dev | grep ttyAMA0
lrwxrwxrwx 1 root root 7 Sep 4 22:17 serial1 -> ttyAMA0
crw-rw---- 1 root dialout 204, 64 Sep 4 22:17 ttyAMA0
ls -l /dev | grep ttyS1
So I reinstalled from the beginning and followed the instructions and additions from the rollup post. I decided to keep the install dir as /var/www and changed the Apache2 config file. I get all the way to Step 9.
I copied flowmon to /etc/init.d and modified the permissions as stated. Then when I tried to start the service with
Code:sudo /etc/init.d/flowmon start
I get this
Code:[....] Starting flowmon (via systemctl): flowmon.serviceFailed to start flowmon.service: Unit flowmon.service failed to load: No such file or directory.
Any ideas this time around? I double checked that the file was copied and the permissions were changed.
August 02, 2016
FINALLY!
Edit /boot/config.txt
Change enable_uart=0
FER ****S SAKE!
pi@cpints:~ $ ls -l /dev | grep serial
lrwxrwxrwx 1 root root 7 Aug 2 20:18 serial0 -> ttyAMA0
pi@cpints:~ $
Now the serial port option shows up in the Arduino IDE - as ttyS0(?)
Was able to successfully upload the same sketch used on the rest of the fleet.
pi@cpints:~ $ ls -l /dev | grep serial
lrwxrwxrwx 1 root root 7 Aug 2 20:31 serial0 -> ttyAMA0
pi@cpints:~ $ ls -l /dev | grep ttyS0
lrwxrwxrwx 1 root root 7 Aug 2 20:31 ttyS0 -> ttyAMA0
pi@cpints:~ $
Interesting. Looks like ttyAMA0 is synonymous with ttyS0.
Wired up a flow meter and LED to UNO pins D2 and D13, respectively (LED cathode to GND pin)
- LED lights at end of pour!
Next: turn on flow monitor
Copy /var/www/python/flowmon to /etc/init.d
Set privs:
$ sudo chmod a+x /etc/init.d/flowmon
Install to run at startup:
$ sudo update-rc.d flowmon defaults
Rebooted
WORKS! YAY!
Enter your email address to join: