• We have a new forum and it needs your help! Homebrewing Deals is a forum to post whatever deals and specials you find that other homebrewers might value! Includes coupon layering, Craigslist finds, eBay finds, Amazon specials, etc.

[Version 2 Release] RaspberryPints - Digital Taplist Solution

HomeBrewTalk.com - Beer, Wine, Mead, & Cider Brewing Discussion Community.

Help Support Homebrew Talk:

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
In the meantime would it be possible to make a circuit here
First I am by no means a wiring expert, I get a lot of help when it comes to that stuff, but based on your pictures and your first diagram, it looks like its wired where it will work, you just need to create 2 taps in the rpints admin page (enter the pi address into a broswer followed by /admin i.e. http://127.0.01/admin) and assign 1 to pin 8 and the other to pin 9
 

Attachments

Gengasi

Member
Joined
May 20, 2020
Messages
16
Reaction score
5
Did you see any errors in the first layout? There was no problem flashing the arduino. But still no response after pouring. Would it help with a log?
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
There was no problem flashing the arduino. But still no response after pouring. Would it help with a log
Flashing the Arduino is a good start.

Yes a log would be helpful.

Also make sure the flowmon service is running from the terminal
sudo /etc/init.d/flowmon restart
 

Gengasi

Member
Joined
May 20, 2020
Messages
16
Reaction score
5
Traceback (most recent call last):
File "/var/www/html/python/PintDispatch.py", line 17, in <module>
import MySQLdb as mdb
ImportError: No module named MySQLdb

This is the log as far as i can tell. The command didnt really have any effect as my pours dont register :(
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
import MySQLdb as mdb
ImportError: No module named MySQLdb
Ok that's a new one
Try from the terminal
sudo pip install mysql-python
sudo /etc/init.d/flowmon restart


then check the log again
 

Gengasi

Member
Joined
May 20, 2020
Messages
16
Reaction score
5
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-68YXFx/mysql-python/

after trying python install
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
after trying python install
I'm gasping at straws here, I haven't seen anyone with issues for python before, what version of Raspbian did you install?

try without sudo
pip install mysql-python
sudo /etc/init.d/flowmon restart
 

Gengasi

Member
Joined
May 20, 2020
Messages
16
Reaction score
5
I got the lines to register that a pour was occuring :) i did a fresh install of rpints and it worked. However it defaults to zero ml every time :)
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
i did a fresh install of rpints and it worked. However it defaults to zero ml every time
That's good news, not exactly sure what happed the first time.

If you look at the log it should say how many pulses it got and what it used to convert the pulses to ml or say that it wasn't configure so look for either
pours.php: No Count Per
or
pour on pin:
 

LBussy

A Cunning Linguist
HBT Sponsor HBT Supporter
Joined
Jan 19, 2013
Messages
2,447
Reaction score
815
Location
Kansas City
Ok, i will add some more photos of how he have wired things up. It looks like a mess to be honest and i dont know if its even possible to see how its drawn. I installed flowmeters and i picked usb. I can see on the breadboard that the resistors are very close to another, maybe even touching?
Yes, that's a bit of a mess. Attached is the wiring instructions for the Swissflow meters. The wire with the black paint is the ground, the opposite is the power, and the middle is for the pulses. While there is a pull-up resistor in the wiring diagram, I believe none is needed. You can hook up the 5VDC to the Arduino 5V power and the GND to the Arduino GND, and the pulses to the appropriate pins directly.
 

Attachments

Gengasi

Member
Joined
May 20, 2020
Messages
16
Reaction score
5
Hello and thank you for the help again.

Checked nthe log once again after making a pout and this was the output


2020-05-22 06:48:01 RPINTS: No such device - Sleeping to try again
2020-05-22 06:48:06 RPINTS: No such device - Sleeping to try again
2020-05-22 06:48:11 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2020-05-22 06:48:21 RPINTS: starting WS server
2020-05-22 06:48:21 RPINTS: starting device monitors...
2020-05-22 06:48:21 RPINTS: starting command server
2020-05-22 06:48:21 RPINTS: starting fan control
2020-05-22 06:48:21 RPINTS: Fan Control fanControl1 is Running
2020-05-22 06:48:21 RPINTS: Not Configured to run Fan
PourGallonpour on pin: 9, count: 1397, conversion: 0, amount: 0, amountUnit: ml, user: N/A
PourGallonpour on pin: 9, count: 1241, conversion: 0, amount: 0, amountUnit: ml, user: N/A
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
conversion: 0
in the admin taps page make sure you set up Count Per Gal/Liter

I assumed you did a full pour and estimate 3710 should be good to start and tweak with each pour then looking at the pours history to see how much RPints recorded. Of course if you did a half pour then you should double to 7420
 

Attachments

Gengasi

Member
Joined
May 20, 2020
Messages
16
Reaction score
5
in the admin taps page make sure you set up Count Per Gal/Liter

I assumed you did a full pour and estimate 3710 should be good to start and tweak with each pour then looking at the pours history to see how much RPints recorded. Of course if you did a half pour then you should double to 7420
Will do, come back with more info later
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
Anything I can do at my end let me know.
So looking at the logs the code runs into a communication issues, it does try to restart communication but that doesnt work (presumably until you reboot)

Sorry if I asked these already but
1. When this happens it sound like the only way to get it running is a reboot, but does restarting the python fix it (i.e. sudo /etc/init.d/flowmon restart)
2. When this happens can you try stopping the flowmon service and uploading the sketch
a. sudo /etc/init.d/flowmon stop
b. open the sketch like you were going to verify it, but instead of verifying hit upload (make sure that under Tools -> Serial Port -> /dev/ttyACM0 is selected)
 

esdill

Member
Joined
May 16, 2020
Messages
17
Reaction score
0
@RandR+ ... Could you please tell me where/how the % full for the temperature gauge is calculated? According to the page source, it's in the .temp-indicator .temp-full style. With my keezer at 38F, it calculates 3.25%, and the red coloration on the indicator is so small it doesn't even show up. I'd like to see if I can increase that percentage somewhat, otherwise there's no sense even showing the indicator.
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
full for the temperature gauge is calculated
it just takes the last temp and uses that as the percent
in file index.php ~line 236
<div class="temp-full" style="height:<?php echo $temp; ?>%; padding-right: 50px"></div>

I tested with 38 and it showed correctly on my test system
 

esdill

Member
Joined
May 16, 2020
Messages
17
Reaction score
0
it just takes the last temp and uses that as the percent
in file index.php ~line 236
<div class="temp-full" style="height:<?php echo $temp; ?>%; padding-right: 50px"></div>

I tested with 38 and it showed correctly on my test system
This is what 37.1 F looks like on mine ... for what it's worth ... 2.95 C = 37.3 F, and index.php shows 2.95% ... so it looks like the indicator is using "C" instead of "F".
 

Attachments

troyp42

Well-Known Member
Joined
May 12, 2012
Messages
368
Reaction score
38
Location
Melbourne
So looking at the logs the code runs into a communication issues, it does try to restart communication but that doesnt work (presumably until you reboot)

Sorry if I asked these already but
1. When this happens it sound like the only way to get it running is a reboot, but does restarting the python fix it (i.e. sudo /etc/init.d/flowmon restart)
2. When this happens can you try stopping the flowmon service and uploading the sketch
a. sudo /etc/init.d/flowmon stop
b. open the sketch like you were going to verify it, but instead of verifying hit upload (make sure that under Tools -> Serial Port -> /dev/ttyACM0 is selected)
1. restarting python didn't fix it and this is what the log said after I did a restart.

2020-05-23 21:34:30 RPINTS: valve update: RPU:VALVE:0=0
2020-05-23 21:34:33 RPINTS: valve update: RPU:VALVE:1=0
2020-05-23 21:34:33 RPINTS: valve update: RPU:VALVE:2=0
2020-05-23 21:34:33 RPINTS: valve update: RPU:VALVE:3=0
2020-05-23 21:34:33 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2020-05-23 21:34:36 RPINTS: starting setup...
2020-05-23 21:34:36 RPINTS: resetting alamode to try to force it to listen to us...
2020-05-23 21:34:38 RPINTS: giving it a short break to wake up again...
2020-05-23 21:34:40 RPINTS: reflashing Arduino via:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyACM0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i
RPINTS: reflashing Arduino failed, moving on anyways, error was: Command '/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyACM0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i' returned non-zero exit status 1
2020-05-23 21:34:41 RPINTS:
2020-05-23 21:34:41 RPINTS: starting WS server
2020-05-23 21:34:41 RPINTS: starting device monitors...
2020-05-23 21:34:41 RPINTS: starting command server
2020-05-23 21:34:41 RPINTS: resetting Arduino
2020-05-23 21:34:41 RPINTS: starting fan control
2020-05-23 21:34:41 RPINTS: Fan Control fanControl1 is Running
2020-05-23 21:34:41 RPINTS: Not Configured to run Fan
2020-05-23 21:34:42 RPINTS: serial connection stopped...
2020-05-23 21:34:42 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
2020-05-23 21:34:43 RPINTS: flowmonitor aborted, restarting...
2020-05-23 21:34:43 RPINTS: resetting Arduino
2020-05-23 21:34:44 RPINTS: serial connection stopped...
2020-05-23 21:34:44 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'

2. ACM1 is selected and I don't know how to change it?

Screen Shot 2020-05-23 at 9.43.30 pm.png


EDIT- So I changed the config.py file to this as you've told me to do it once before.

config['flowmon.port'] = '/dev/ttyACM1'

Uploaded the sketch and restarted flowmon. Now the log says this

2020-05-23 21:57:03 RPINTS: valve update: RPU:VALVE:0=0
2020-05-23 21:57:08 RPINTS: valve update: RPU:VALVE:1=0
2020-05-23 21:57:08 RPINTS: valve update: RPU:VALVE:2=0
2020-05-23 21:57:08 RPINTS: valve update: RPU:VALVE:3=0
2020-05-23 21:57:08 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2020-05-23 21:57:10 RPINTS: starting setup...
2020-05-23 21:57:10 RPINTS: resetting alamode to try to force it to listen to us...
2020-05-23 21:57:11 RPINTS: giving it a short break to wake up again...
2020-05-23 21:57:13 RPINTS: reflashing Arduino via:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyACM1 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i
2020-05-23 21:57:18 RPINTS:
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex"
avrdude: writing flash (11866 bytes):

Writing | ################################################## | 100% 2.29s

avrdude: 11866 bytes of flash written
avrdude: verifying flash memory against /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:
avrdude: load data flash data from input file /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:
avrdude: input file /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex contains 11866 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.68s

avrdude: verifying ...
avrdude: 11866 bytes of flash verified

avrdude done. Thank you.


2020-05-23 21:57:18 RPINTS: starting WS server
2020-05-23 21:57:18 RPINTS: starting device monitors...
2020-05-23 21:57:19 RPINTS: starting command server
2020-05-23 21:57:19 RPINTS: resetting Arduino
2020-05-23 21:57:19 RPINTS: starting fan control
2020-05-23 21:57:19 RPINTS: Fan Control fanControl1 is Running
2020-05-23 21:57:19 RPINTS: Not Configured to run Fan
2020-05-23 21:57:20 RPINTS: 1Wire Temperature Thread 1 is Running
2020-05-23 21:57:20 RPINTS: waiting for Arduino to come alive


But still doesn't work. So then I hit the reset button on the Arduino. And the log added this and finally it registered a pour.....Until next time.

2020-05-23 21:57:20 RPINTS: 1Wire Temperature Thread 1 is Running
2020-05-23 21:57:20 RPINTS: waiting for Arduino to come alive
2020-05-23 22:00:33 RPINTS: Arduino alive...
2020-05-23 22:00:33 RPINTS: getting config data for Arduino
2020-05-23 22:00:33 RPINTS: Arduino config, about to send: C:4:3:4:5:6:0:200:25:25:50:0:0:1|
2020-05-23 22:00:33 RPINTS: Waiting for Config Response
2020-05-23 22:00:33 RPINTS: Arduino says: C:4:3:4:5:6:0:200:25:25:50:0:0:1|

2020-05-23 22:00:33 RPINTS: listening to Arduino
2020-05-23 22:00:33 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
2020-05-23 22:01:38 RPINTS: got a update: U;-1;3;51
2020-05-23 22:01:38 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
2020-05-23 22:01:39 RPINTS: got a pour: P;-1;3;54
Pourpour on pin: 3, count: 54, conversion: 575, amount: 0.093913043478261, amountUnit: ml, user: N/A
2020-05-23 22:01:44 RPINTS: restarting fan timer after pour
2020-05-23 22:01:44 RPINTS: count update: RPU:FLOW:3=54:-1
2020-05-23 22:01:44 RPINTS: Reset Tap during loop Pin 3 0
2020-05-23 22:01:46 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
 
Last edited:

esdill

Member
Joined
May 16, 2020
Messages
17
Reaction score
0
it just takes the last temp and uses that as the percent
in file index.php ~line 236
<div class="temp-full" style="height:<?php echo $temp; ?>%; padding-right: 50px"></div>

I tested with 38 and it showed correctly on my test system
Until you can determine why the indicator is using the Celsius value for the indicator level, I fixed my version by ...

<div class="temp-full" style="height:<?php echo ($temp*9/5)+32; ?>%; padding-right: 50px"></div>
 

Attachments

Gengasi

Member
Joined
May 20, 2020
Messages
16
Reaction score
5
Thank you everyone for great help regarding my issues in setting up the flowmeters and rpints. I have now a rpints with flowmeters running, despite having no technical knowledge :)
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
Celsius value for the indicator level,
The temp probes log in Celsius, but the temp is changed to Fahrenheit for display. I don't have temp probes so I just made up the data and by default used Fahrenheit.

If I put in the test data as Celsius then I get the same thing, so thanks for pointing this out.

I put in a change to convert the temp to Fahrenheit like you did but to use the function that is used to change the temp for display:
So it become this:
<div class="temp-full" style="height:<?php echo convert_temperature($temp, $tempUnit, UnitsOfMeasure::TemperatureFahrenheight); ?>%; padding-right: 50px"></div>
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
ACM1 is selected and I don't know how to change it?
If the editor cant see the ttyACM0 then I doubt the python can, BUT that doesn't explain why its jumping ports like it is.
A really janky fix is to catch when it cant open ACM0 and try ACM1

Something like replacing Lines 223 through 226 of python/FlowMonitor.py with
Code:
        if flowMetersEnabld :
            if self.alaIsAlive is False:
                debug( "resetting Arduino" )
                self.dispatch.resetAlaMode()
                try:
                    self.arduino = serial.Serial(self.port,9600,timeout=.5)
                except:
                    if self.port == "/dev/ttyACM0":
                        self.arduino = serial.Serial("/dev/ttyACM1",9600,timeout=.5)
But still doesn't work. So then I hit the reset button on the Arduino. And the log added this and finally it registered a pour
Is the first time you had to hit the reset button?

I'm trying to see if there is a way to reset the Uno programmatically from the pytho, there is for the alamode board, but it might not work for UNO
Nothing pops up right now but I will keep looking, I might have to be a sketch change that if it doesn't get a response back in xx seconds then reset itself, but if the sketch isn't running until the reset button is pressed then even that wont fix this
 

esdill

Member
Joined
May 16, 2020
Messages
17
Reaction score
0
The temp probes log in Celsius, but the temp is changed to Fahrenheit for display. I don't have temp probes so I just made up the data and by default used Fahrenheit.

If I put in the test data as Celsius then I get the same thing, so thanks for pointing this out.

I put in a change to convert the temp to Fahrenheit like you did but to use the function that is used to change the temp for display:
So it become this:
<div class="temp-full" style="height:<?php echo convert_temperature($temp, $tempUnit, UnitsOfMeasure::TemperatureFahrenheight); ?>%; padding-right: 50px"></div>
Perfect ... thanks! I will adjust mine to be the same.

One more suggestion (not earth shattering but worth consideration) ... on the admin/temperature probe page for the lowest possible and maximum temp values, there's two typos:

Highest Temerature:
The highest temperature possibles

In addition, these values appear to be Celsius, so adding (C°) to each would be a good reminder to people entering values here.
 

troyp42

Well-Known Member
Joined
May 12, 2012
Messages
368
Reaction score
38
Location
Melbourne
If the editor cant see the ttyACM0 then I doubt the python can, BUT that doesn't explain why its jumping ports like it is.
A really janky fix is to catch when it cant open ACM0 and try ACM1

Something like replacing Lines 223 through 226 of python/FlowMonitor.py with
Code:
        if flowMetersEnabld :
            if self.alaIsAlive is False:
                debug( "resetting Arduino" )
                self.dispatch.resetAlaMode()
                try:
                    self.arduino = serial.Serial(self.port,9600,timeout=.5)
                except:
                    if self.port == "/dev/ttyACM0":
                        self.arduino = serial.Serial("/dev/ttyACM1",9600,timeout=.5)

Is the first time you had to hit the reset button?

I'm trying to see if there is a way to reset the Uno programmatically from the pytho, there is for the alamode board, but it might not work for UNO
Nothing pops up right now but I will keep looking, I might have to be a sketch change that if it doesn't get a response back in xx seconds then reset itself, but if the sketch isn't running until the reset button is pressed then even that wont fix this
This the the first time Ive actually just hit reset on the Arduino as before that I used to reboot the pi and power down the Arduino.I never thought to just reset the Arduino until last night so tried it and it worked.

Today its stopped again and this is the log file since last nights pour.

2020-05-23 22:01:39 RPINTS: got a pour: P;-1;3;54
Pourpour on pin: 3, count: 54, conversion: 575, amount: 0.093913043478261, amountUnit: ml, user: N/A
2020-05-23 22:01:44 RPINTS: restarting fan timer after pour
2020-05-23 22:01:44 RPINTS: count update: RPU:FLOW:3=54:-1
2020-05-23 22:01:44 RPINTS: Reset Tap during loop Pin 3 0
2020-05-23 22:01:46 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
2020-05-24 01:13:38 RPINTS: unknown message: k;
2020-05-24 01:13:38 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
('Unexpected error:', <class 'serial.serialutil.SerialException'>)
Traceback (most recent call last):
File "/var/www/html/python/FlowMonitor.py", line 269, in monitor
msg = self.readline_notimeout()
File "/var/www/html/python/FlowMonitor.py", line 74, in readline_notimeout
c = self.arduino.read(1)
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 501, in read
'device reports readiness to read but returned no data '
SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2020-05-24 01:14:49 RPINTS: flowmonitor aborted, restarting...
2020-05-24 01:14:49 RPINTS: NOT resetting Arduino
2020-05-24 01:14:49 RPINTS: waiting for Arduino to come alive
2020-05-24 01:14:50 RPINTS: serial connection stopped...
2020-05-24 01:14:50 RPINTS: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2020-05-24 01:14:51 RPINTS: flowmonitor aborted, restarting...
2020-05-24 01:14:51 RPINTS: resetting Arduino
2020-05-24 01:14:52 RPINTS: serial connection stopped...
2020-05-24 01:14:52 RPINTS: [Errno 2] could not open port /dev/ttyACM1: [Errno 2] No such file or directory: '/dev/ttyACM1'
2020-05-24 01:14:53 RPINTS: flowmonitor aborted, restarting...
2020-05-24 01:14:53 RPINTS: resetting Arduino

I tried resetting the Arduino with the reset button again but it didn't work. So I stopped the flowmon, tried to upload the Arduino and it now says Serial port /dev/ACM1 not found, did you select the right one from the tools.Serial port menu. However the serial port menu is greyed out.

I then typed dmesg in terminal and get this

[168557.339208] usb 1-1.1.3: new full-speed USB device number 60 using dwc_otg
[168557.493099] usb 1-1.1.3: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01
[168557.493111] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[168557.493115] usb 1-1.1.3: Manufacturer: Arduino (www.arduino.cc)
[168557.493120] usb 1-1.1.3: SerialNumber: 85730313836351805031
[168557.494204] cdc_acm 1-1.1.3:1.0: ttyACM1: USB ACM device
[192362.745119] usb 1-1.1.3: USB disconnect, device number 60
[192363.194778] usb 1-1.1.3: new full-speed USB device number 61 using dwc_otg
[192363.294785] usb 1-1.1.3: device descriptor read/64, error -32
[192363.514771] usb 1-1.1.3: device descriptor read/64, error -32
[192363.734843] usb 1-1.1.3: new full-speed USB device number 62 using dwc_otg
[192363.834854] usb 1-1.1.3: device descriptor read/64, error -32
[192364.054829] usb 1-1.1.3: device descriptor read/64, error -32
[192364.176864] usb 1-1.1-port3: attempt power cycle
[192364.834842] usb 1-1.1.3: new full-speed USB device number 63 using dwc_otg
[192365.274849] usb 1-1.1.3: device not accepting address 63, error -32
[192365.374860] usb 1-1.1.3: new full-speed USB device number 64 using dwc_otg
[192365.814847] usb 1-1.1.3: device not accepting address 64, error -32

EDIT- So after numerous reboots of the Arduino nothing happened and serial was still grey. So I unplugged the usb cable to the Arduino and plugged it back in and rebooted the pi and now ACM0 is showing again. (Does plugging the usb cable into different ports change this as I did try doing that?)

Stopped flowmon uploaded the sketch, and started flowmon again..but no pours. Then I reset the Arduino and it works. So it seems as if after I re upload the sketch I have to reset the Arduino before it works again. Heres the log from the upload then restart of the Arduino. (But it won't be working tomorrow no doubt)

2020-05-24 16:48:46 RPINTS: valve update: RPU:VALVE:0=0
2020-05-24 16:48:50 RPINTS: valve update: RPU:VALVE:1=0
2020-05-24 16:48:50 RPINTS: valve update: RPU:VALVE:2=0
2020-05-24 16:48:50 RPINTS: valve update: RPU:VALVE:3=0
2020-05-24 16:48:50 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2020-05-24 16:48:52 RPINTS: starting setup...
2020-05-24 16:48:52 RPINTS: resetting alamode to try to force it to listen to us...
2020-05-24 16:48:53 RPINTS: giving it a short break to wake up again...
2020-05-24 16:48:55 RPINTS: reflashing Arduino via:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyACM0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i
2020-05-24 16:49:00 RPINTS:
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex"
avrdude: writing flash (11866 bytes):

Writing | ################################################## | 100% 2.28s

avrdude: 11866 bytes of flash written
avrdude: verifying flash memory against /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:
avrdude: load data flash data from input file /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:
avrdude: input file /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex contains 11866 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.69s

avrdude: verifying ...
avrdude: 11866 bytes of flash verified

avrdude done. Thank you.


2020-05-24 16:49:00 RPINTS: starting WS server
2020-05-24 16:49:00 RPINTS: starting device monitors...
2020-05-24 16:49:00 RPINTS: starting command server
2020-05-24 16:49:00 RPINTS: starting fan control
2020-05-24 16:49:00 RPINTS: resetting Arduino
2020-05-24 16:49:00 RPINTS: Fan Control fanControl1 is Running
2020-05-24 16:49:00 RPINTS: Not Configured to run Fan
2020-05-24 16:49:01 RPINTS: 1Wire Temperature Thread 1 is Running
2020-05-24 16:49:01 RPINTS: waiting for Arduino to come alive
2020-05-24 16:54:24 RPINTS: Arduino alive...
2020-05-24 16:54:24 RPINTS: getting config data for Arduino
2020-05-24 16:54:24 RPINTS: Arduino config, about to send: C:4:3:4:5:6:0:200:25:25:50:0:0:1|
2020-05-24 16:54:24 RPINTS: Waiting for Config Response
2020-05-24 16:54:24 RPINTS: Arduino says: C:4:3:4:5:6:0:200:25:25:50:0:0:1|

2020-05-24 16:54:24 RPINTS: listening to Arduino
2020-05-24 16:54:24 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
2020-05-24 16:55:33 RPINTS: got a update: U;-1;3;51
2020-05-24 16:55:33 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
2020-05-24 16:55:36 RPINTS: got a pour: P;-1;3;98
Pourpour on pin: 3, count: 98, conversion: 575, amount: 0.1704347826087, amountUnit: ml, user: N/A
2020-05-24 16:55:37 RPINTS: restarting fan timer after pour
2020-05-24 16:55:37 RPINTS: count update: RPU:FLOW:3=98:-1
2020-05-24 16:55:37 RPINTS: Reset Tap during loop Pin 3 0
2020-05-24 16:55:39 RPINTS: Sending Status;NOTOK;-1;0;0;0;0;0;|
 
Last edited:

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
Does plugging the usb cable into different ports change this as I did try doing that?
different physical USB ports will have different logical port names, so yes switiching USB ports makes sense the port would change

So it seems as if after I re upload the sketch I have to reset the Arduino before it works again
It seems that way but I'm not sure why, because I would think that uploading would reset the Arduino, ill look into this.
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
It has stopped working yet again so appreciate you looking into this for me.
Does the log end with "waiting for Arduino to come alive"?
Does hitting the reset button (without doing anything else) get it to work?
From your previous logs the python was trying to handle the exception correctly, but the Arduino wasn't coming back up like it was supposed to. Either the Arduino didn't establish connection to the pi again or it didn't start the sketch after uploading.

Do you have a dedicate external power source for the Arduino? it seems like a lot of issues with them are caused by power issues.
 

troyp42

Well-Known Member
Joined
May 12, 2012
Messages
368
Reaction score
38
Location
Melbourne
Does the log end with "waiting for Arduino to come alive"?
Yes I think so, Ive seen that in most instances
Does hitting the reset button (without doing anything else) get it to work?
From what I can tell I have to re upload the sketch first then hit reset, but that could be due to moving the USb cable first. Will have to test this more and come back to you.
From your previous logs the python was trying to handle the exception correctly, but the Arduino wasn't coming back up like it was supposed to. Either the Arduino didn't establish connection to the pi again or it didn't start the sketch after uploading.

Do you have a dedicate external power source for the Arduino? it seems like a lot of issues with them are caused by power issues.

Yes I have a 9V 400ma power supply direct to the UNO.
 

day_trippr

COVID-19 Chum
Joined
May 31, 2011
Messages
31,698
Reaction score
12,697
Location
Stow, MA
fwiw, while 9V is ideal, 400ma is marginal. Not claiming that's the root cause issue here, but I use 9v 1a wall warts ($3 delivered via eBay - eventually ;)) for my Arduinos (Unos, Megas - even my one Nano) and have had zero issues over many years. If one wants to take power issues off the board (and hopefully resolve flakiness in the offing) that's one way to go...

Cheers!
 

troyp42

Well-Known Member
Joined
May 12, 2012
Messages
368
Reaction score
38
Location
Melbourne
fwiw, while 9V is ideal, 400ma is marginal. Not claiming that's the root cause issue here, but I use 9v 1a wall warts ($3 delivered via eBay - eventually ;)) for my Arduinos (Unos, Megas - even my one Nano) and have had zero issues over many years. If one wants to take power issues off the board (and hopefully resolve flakiness in the offing) that's one way to go...

Cheers!
I do have a 12v 4a power pack. Would that be too much?
 
Last edited:

troyp42

Well-Known Member
Joined
May 12, 2012
Messages
368
Reaction score
38
Location
Melbourne
Does the log end with "waiting for Arduino to come alive"?
Does hitting the reset button (without doing anything else) get it to work?
From your previous logs the python was trying to handle the exception correctly, but the Arduino wasn't coming back up like it was supposed to. Either the Arduino didn't establish connection to the pi again or it didn't start the sketch after uploading.

Do you have a dedicate external power source for the Arduino? it seems like a lot of issues with them are caused by power issues.
I just got home and Here is what I did in order.

1. Poured beer, - no pours registered.
2. Reset Arduino, - no pour registered.
3. Rebooted Pi, - no pour registered.
4. Stopped flowmon, went to uploaded sketch but serial port was greyed out so unplugged usb and plugged back in.
Uploaded sketch, restarted flowmon, -no pours registered.
5. Reset Arduino again, - no pours

This is the log file since the reboot of the pi and trying to upload the sketch.

2020-05-27 18:04:05 RPINTS: valve update: RPU:VALVE:0=0
2020-05-27 18:04:10 RPINTS: valve update: RPU:VALVE:1=0
2020-05-27 18:04:10 RPINTS: valve update: RPU:VALVE:2=0
2020-05-27 18:04:10 RPINTS: valve update: RPU:VALVE:3=0
2020-05-27 18:04:11 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2020-05-27 18:04:13 RPINTS: starting setup...
2020-05-27 18:04:14 RPINTS: resetting alamode to try to force it to listen to us...
2020-05-27 18:04:16 RPINTS: giving it a short break to wake up again...
2020-05-27 18:04:18 RPINTS: reflashing Arduino via:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyACM0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i
RPINTS: reflashing Arduino failed, moving on anyways, error was: Command '/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyACM0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i' returned non-zero exit status 1
2020-05-27 18:04:24 RPINTS:
2020-05-27 18:04:24 RPINTS: starting WS server
2020-05-27 18:04:24 RPINTS: starting device monitors...
2020-05-27 18:04:24 RPINTS: starting command server
2020-05-27 18:04:24 RPINTS: resetting Arduino
2020-05-27 18:04:24 RPINTS: starting fan control
2020-05-27 18:04:24 RPINTS: Fan Control fanControl1 is Running
2020-05-27 18:04:25 RPINTS: Not Configured to run Fan
2020-05-27 18:04:26 RPINTS: 1Wire Temperature Thread 1 is Running
2020-05-27 18:04:26 RPINTS: waiting for Arduino to come alive
2020-05-27 18:04:42 RPINTS: serial connection stopped...
2020-05-27 18:04:42 RPINTS: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2020-05-27 18:04:43 RPINTS: flowmonitor aborted, restarting...
2020-05-27 18:04:43 RPINTS: resetting Arduino
2020-05-27 18:04:44 RPINTS: serial connection stopped...
2020-05-27 18:04:44 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
2020-05-27 18:04:45 RPINTS: flowmonitor aborted, restarting...
2020-05-27 18:04:45 RPINTS: resetting Arduino
2020-05-27 18:04:47 RPINTS: serial connection stopped...
2020-05-27 18:04:47 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
2020-05-27 18:04:48 RPINTS: flowmonitor aborted, restarting...
2020-05-27 18:04:48 RPINTS: resetting Arduino
2020-05-27 18:04:49 RPINTS: serial connection stopped...
2020-05-27 18:04:49 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
2020-05-27 18:04:50 RPINTS: flowmonitor aborted, restarting...
2020-05-27 18:04:50 RPINTS: resetting Arduino
2020-05-27 18:04:51 RPINTS: serial connection stopped...
2020-05-27 18:04:51 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
2020-05-27 18:04:52 RPINTS: flowmonitor aborted, restarting...
2020-05-27 18:04:52 RPINTS: resetting Arduino
2020-05-27 18:04:54 RPINTS: serial connection stopped...
2020-05-27 18:04:54 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
2020-05-27 18:04:55 RPINTS: flowmonitor aborted, restarting...
2020-05-27 18:04:55 RPINTS: resetting Arduino
2020-05-27 18:04:56 RPINTS: serial connection stopped...
2020-05-27 18:04:56 RPINTS: [Errno 2] could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
2020-05-27 18:04:57 RPINTS: flowmonitor aborted, restarting...
2020-05-27 18:04:57 RPINTS: resetting Arduino
2020-05-27 18:04:58 RPINTS: serial connection stopped...

EDIT- I unplugged the usb cable to "Un-grey" the serial port connection, and I plugged it back into the same USB port on the PI. However it has now switched to ACM1 even though I didn't change ports. So I unplugged it and tried different ports resetting the Arduino until it showed ACM0 again (It even showed ACM2 on two usb ports) then uploaded the sketch.

Now the log says this

2020-05-27 18:50:29 RPINTS: valve update: RPU:VALVE:0=0
2020-05-27 18:50:34 RPINTS: valve update: RPU:VALVE:1=0
2020-05-27 18:50:34 RPINTS: valve update: RPU:VALVE:2=0
2020-05-27 18:50:34 RPINTS: valve update: RPU:VALVE:3=0
2020-05-27 18:50:35 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2020-05-27 18:50:37 RPINTS: starting setup...
2020-05-27 18:50:37 RPINTS: resetting alamode to try to force it to listen to us...
2020-05-27 18:50:38 RPINTS: giving it a short break to wake up again...
2020-05-27 18:50:40 RPINTS: reflashing Arduino via:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyACM0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i
2020-05-27 18:50:45 RPINTS:
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex"
avrdude: writing flash (11866 bytes):

Writing | ################################################## | 100% 2.29s

avrdude: 11866 bytes of flash written
avrdude: verifying flash memory against /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:
avrdude: load data flash data from input file /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:
avrdude: input file /var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex contains 11866 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.71s

avrdude: verifying ...
avrdude: 11866 bytes of flash verified

avrdude done. Thank you.


2020-05-27 18:50:45 RPINTS: starting WS server
2020-05-27 18:50:45 RPINTS: starting device monitors...
2020-05-27 18:50:45 RPINTS: starting command server
2020-05-27 18:50:45 RPINTS: resetting Arduino
2020-05-27 18:50:45 RPINTS: starting fan control
2020-05-27 18:50:46 RPINTS: Fan Control fanControl1 is Running
2020-05-27 18:50:46 RPINTS: Not Configured to run Fan
2020-05-27 18:50:47 RPINTS: 1Wire Temperature Thread 1 is Running
2020-05-27 18:50:47 RPINTS: waiting for Arduino to come alive

EDIT2- Switched to a 12v 4A pwr supply. Rebooted the pi and reset the arduion and pours started working again. Lets see what happens tomorrow night...
 
Last edited:

JAKL

Member
Joined
May 20, 2020
Messages
7
Reaction score
0
If using my version, Check /var/log/rpints.log or in the admin section under install there is a log page.
That might give you a hint as to why its not working
I checked /var/log/rpints.log and it shows:

blah blah... pintdispatch.py”, line 17, in <module>
import error: no module named MySQLdb

when I did the install it did ask for an admin user pw but it wouldn’t allow me to type one in so I left it blank (that was the only issue during installing it all)?
 

JAKL

Member
Joined
May 20, 2020
Messages
7
Reaction score
0
Traceback (most recent call last):
File "/var/www/html/python/PintDispatch.py", line 17, in <module>
import MySQLdb as mdb
ImportError: No module named MySQLdb

This is the log as far as i can tell. The command didnt really have any effect as my pours dont register :(
I have the exact same error, did you happen to find a solution to this one?
 

JAKL

Member
Joined
May 20, 2020
Messages
7
Reaction score
0
I'm gasping at straws here, I haven't seen anyone with issues for python before, what version of Raspbian did you install?

try without sudo
pip install mysql-python
sudo /etc/init.d/flowmon restart
I’m getting the same errors that Gengasi was having, ie try to reinstall python and get error:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-68YXFx/mysql-python/

do you know what he did to resolve his issue? was it a fresh rpints install?
 

RandR+

Well-Known Member
Joined
Oct 5, 2015
Messages
446
Reaction score
135
user pw but it wouldn’t allow me to type one in so I left it blank (that was the only issue during installing it all)?
The password isn't printed when you type it nor are asterisks indicating you typed something so you probably did enter in a password but couldn't tell

do you know what he did to resolve his issue? was it a fresh rpints install?
Yes reinstalling rpints again reportedly fixed the issue
 
2
Top