• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

[Version 2 Release] RaspberryPints - Digital Taplist Solution

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I figured it out. RPints didn't like me using sql server 2008. I installed MySQL and had to use a different port for sql 2008 to get it to work as they both wanted to use 3306.

Makes sense, nice work, enjoy!

Cheers,

Kal
 
UPDATE: Kevin Osborn from Wyolum, replied that he'll "take a look at it" so I've sent him the dump files of both a successful Jessie upload and an unsuccessful Stretch upload to an Alamode.

Watch this space...

UPDATE: Just in from Kevin Osborn at Wyolum:

I'm travelling, but I happen to have a Raspi, but not an alamode, but I
think I've figured it out.
they changed the name of the serialport in cmdline.txt.
getty is now disabled by default, so I also commented that out.
download stretch-setup from
https://raw.githubusercontent.com/wyolum/alamode/master/alamode-setup/stretch-setup
(e.g.:
wget
https://raw.githubusercontent.com/wyolum/alamode/master/alamode-setup/stretch-setup

)
into the alamode-setup directory, and run it sudo:
cd alamode-setup
sudo ./stretch-setup
reboot.
Let me know if it works or not. I'll have access to an alamode this
weekend, so I can do more testing.

So I'll give it a crack tonight and all going well we'll have Stretch nailed down now too.
 
Thanks for pursuing this :mug:, I just don't have the cycles to deal with Stretch these days.
My pleasure, you've done more than your fair share over the years from the beginning until now long after the original devs abandoned the project. I just figure if I've got a spare SD card might as well give it a crack when I'm already up drinking beer and the rest of the house are in bed.

Btw, did Wyolum ever fix the jessie-setup script?

By the looks they haven't touched anything else in the last 2 years just added the Stretch executable:

2017-09-13_1124-68368.png
 
UPDATE: Just in from Kevin Osborn at Wyolum:



So I'll give it a crack tonight and all going well we'll have Stretch nailed down now too.

Getting closer (two way communication between the Pi and the Alamode), but failing before it finishes loading.

I've sent the log file to Kevin and will keep you all posted on the progress.

Cheers,

Kal
 
Kal or day_tripper.

I've got things set up through step 5 and am working with day_trippers following info.

"To get an AlaMode working with RaspberryPints (Jessie) do the following:

$ sudo apt-get update
$ sudo apt-get install dos2unix

- Disable Serial Port messaging:

Sudo Nano /boot/config.txt
Change enable_uart=0


- Now, fetch the Alamode setup kit:
wget https://github.com/wyolum/alamode/ra...e-setup.tar.gz


I've included an image of the /boot/config.txt file when it's opened. Also, opening it with edit doesn't allow me to make any changes to it. So should I be typing the command:

sudo nano /boot/config.txt.

Assistance appreciated.

IMG_0731.jpg
 
Could I do this:

Sudo nano /boot/config.txt

And then at the bottom add

Enable_uart=0

And then save the boot file?

That is if I'm in the right file to begin with.
 
Could I do this:

Sudo nano /boot/config.txt

And then at the bottom add

Enable_uart=0

And then save the boot file?

That is if I'm in the right file to begin with.

Actually what you want to add is:
Code:
enable_uart=1

The instructions to change enable_uart=0 rely on that already being there, so you are supposed to change 0 to 1, if you don't have it add enable_uart=1 to your boot file, save then reboot.

Cheers,

Kal
 
Oh man, I hadn't considered that interpretation :D

No, you really do want to set Enable_uart=0 to keep Jessie from streaming console messages to the serial port.

I may have to do a fresh re-post with a few edits for clarity's sake...

Cheers!
 
Interesting. Setting enable_uart=0 literally was the step that got me over the Jessie hurdle using an Alamode on an RPi2B.
That line in my system log has a big "Fer F@ck Sake!" next to it :D

If you're using an RPi3 you're not using the same port as I do.
That may make a difference, I can't be sure...

Cheers!
 
Interesting. Setting enable_uart=0 literally was the step that got me over the Jessie hurdle using an Alamode on an RPi2B.
That line in my system log has a big "Fer F@ck Sake!" next to it :D

If you're using an RPi3 you're not using the same port as I do.
That may make a difference, I can't be sure...

Cheers!

Okay, then definitely the solution for G-MAN is to set enable_uart=0, it does get me to thinking though: the original poster of enable_uart=1 was on a RPi B, you needed enable_uart=0 on an RPi2 B and mine's working for Jessie but not Stretch with enable_uart=1 on an RPi3 B, you were definitely right when you said "Fer F@ck Sake!"!?!

I had a look at this: https://www.raspberrypi.org/documentation/configuration/uart.md so maybe I need to do some further Stretch experimenting on the weekend while I wait to hear back from Kevin @ Wyolum.
 
Ok, I modified the /boot/config.txt file to enable_uart=0 and saved it and rebooted. then I executed the following from day_trippers roll-up

"wget https://github.com/wyolum/alamode/raw/master/bundles/alamode-setup.tar.gz

- Unpack it from your /home/pi folder:
pi@raspberrypi ~ $ tar -xvzf alamode-setup.tar.gz

- Change focus into the kit you just unpacked:
pi@raspberrypi ~ $ cd alamode-setup

- Run DOS2UNIX against the setup file for Jessie:

$ sudo dos2unix jessie-setup

- Execute the converted script:

$ sudo jessie-setup"

While in the /alamode-setup directory, I executed the command
$ sudo jessie-setup

and it gave me the following response

sudo: jessie-setup: command not found

In order to execute jessie-setup, I had to type

$ sudo ./jessie-setup

Not sure what it did, but it looks like it executed the setup command. I attached a photo. to show the terminal screen. Am I ok to continue with installing raspberry pints 2.0.1, or am I going to have to start the install over again?

Thanks in advance.

Note: the first time i ran dos2unix against jessie-setup, typed it wrong, so I ran dos2unix again and it shows it converted the file jessie-setup to Unix format.

IMG_0733.jpg
 
To be fair I figured I would share my findings after setting up a new Raspberry pi 3 running stretch with an alaMode. And to be really fair this with help from this forum (DrunkleJon, day_trippr, ...):

Here is how to get the alamode working
Start Menu > Preferences > Raspberry Pi Configuration ->Enable Serial on Interfaces tap

Run the following through terminal
sudo rpi-update
sudo apt-get update
sudo apt-get upgrade
wget https://github.com/wyolum/alamode/raw/master/bundles/alamode-setup.tar.gz
tar -xvzf alamode-setup.tar.gz
cd alamode-setup
wget https://github.com/wyolum/alamode/raw/master/alamode-setup/stretch-setup
sudo dos2unix ./*
sudo ./stretch-setup

Also Im working on updating the actual code to run on Stretch, needed to update how it connects to the database. Im also going to look at all the versions on github and merge in the best parts of them. Im through CaptnDelta's version, I thought it was a much simpler solution to setup. Will post when I got something on github
 
To be fair I figured I would share my findings after setting up a new Raspberry pi 3 running stretch with an alaMode. And to be really fair this with help from this forum (DrunkleJon, day_trippr, ...):

Here is how to get the alamode working
Start Menu > Preferences > Raspberry Pi Configuration ->Enable Serial on Interfaces tap

Run the following through terminal
sudo rpi-update
sudo apt-get update
sudo apt-get upgrade
wget https://github.com/wyolum/alamode/raw/master/bundles/alamode-setup.tar.gz
tar -xvzf alamode-setup.tar.gz
cd alamode-setup
wget https://github.com/wyolum/alamode/raw/master/alamode-setup/stretch-setup
sudo dos2unix ./*
sudo ./stretch-setup

Also Im working on updating the actual code to run on Stretch, needed to update how it connects to the database. Im also going to look at all the versions on github and merge in the best parts of them. Im through CaptnDelta's version, I thought it was a much simpler solution to setup. Will post when I got something on github

Holy carp. People are still using my directions from way back then? I put my stream of consciousness set of directions together for my personal use and thought they could be useful. So some of it is still relevant with stretch? Sweet.

I have been out of pocket for a while but am at a point where I am going to start playing with mine again soon. I will start following this thread again and provide what help I can when I can though I am no expert.
 
Just thought I'd share the 3D models from an enclosure I did for my Raspberry Pints system. This is a headless design using a RaspberryPi Zero W and Arduino UNO and it mounts at the top of a 3" faucet tower.

Here's a list of parts I used for power and to connect the Arduino to the Pi:

USB OTG Adapter
USB A-A Cable
USB A-MicroB Cable
USB A-B adapter

The 3D models are HERE.

Let me know if you have any questions.

-Mack

RasPints.JPG
 
Ok, I have rpints up and running, but can't get past configuring the alamode board. I have went into the /boot/config.txt and added enable_uart=1 and I've also tried it with enable_uart=0

however, when I go into the gui and made the necessary changes to the raspberrypints.ino file and chose tools/board/alamode, but the serial port is still grayed out so I can't select com1. I've sent a pic of the gui tool. What do I need to do to get the serial port activated.

Any assistance is appreciated.

Note: on the raspberrypints.ino file in the bottom right it shows alamode on com1, but when I go to upload it says can't find the com port. did you select the correct port.

IMG_0734.jpg
 
I had to do a couple things to get the serial port active:

- I had to modify the boot/config.txt and add the following

enable_uart=0

- I had to disable the console

$ sudo systemctl stop [email protected]e
$ sudo systemctl disable [email protected]


- i also had to remove the console from the cmdline.txt

$ sudo nano /boot/cmdline.txt

- and delete "console=serial0,15200"

The thing I don't understand is now when I go into the GUI program and go to tools, the serial port is no longer grayed out, but my only choice for the serial port is /dev/ttyS0. I can't figure out how to get it to /dev/ttyAMA0. When I have the raspberrypints.ino file open on the bottom right corner it does show AlaMode on /dev/ttyS0.

From what I've read at the following link https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/ ttyS0 is the port that the gpio pins 14 and 15 are. So is it find to leave the serial port set to ttyS0, or do I need to change it to ttyAMA0?

When I use the command

$ ls -l /dev, It shows lrwxrwxrwx 1 root root 7 Sep 14 15:20 serial0 -> ttyAMA0

So it shows serial0 = ttyAMA0, but in the getty it shows my only choice for the serial port is ttyS0.

As I've said, I'm not a programmer, so I don't really understand all of what I'm reading and doing.

I guess the big question is am I good to go to start working on registering the flow meters as outlined in step 9 and run the python script?

Assistance appreciated.
 
I'm building some confidence, so I went ahead and ran the following:

At this point you should be ready to run the python script.

Copy the flowmon file from the python (/var/www/python) directory to /etc/init.d
$ sudo cp flowmon /etc/init.d

Then give it the proper permissions:
$ sudo chmod a+x /etc/init.d/flowmon


I modified everything initially so my install is in /var/www

**IF YOUR INSTALL IS IN /var/www you should be good to go forward. if not, you need to edit the 14th line and set the root dir for your install.
You can test the program by running:
$ sudo /etc/init.d/flowmon start
$ ps aux | grep flow_monitor.py

Should return:
pi 3508 0.0 0.9 8796 4112 ? S 15:35 0:00 /usr/bin/python /home/pi/raspberrypints/python/flow_monitor.py pi 3558 0.0 0.1 3548 808 pts/0 S+ 15:43 0:00 grep –color=auto flow_monitor.py


But it didn't return the /home/pi/raspberrypints/python/flow_monitor.py etc...

I've attached another image of what I got. Did I do something wrong for it not to return the /home/pi/raspberrypints line?

Any help is greatly appreciated.

Thanks.

IMG_0738.jpg
 
This is just part of why I was never in a hurry to get an RPi3 :)

Anyway...if you can upload the Arduino sketch via ttyS0, use it!
You'll need to make sure the Python listener flow_monitor.py is specifying ttyS0. eg:

Code:
#The following line is for serial over GPIO
port = '/dev/ttyS0'

The only way an Alamode can communicate with an RPi is via the same GPIO 14 & 15, so one has to do whatever it takes to get those pins to "speak"...

Cheers!
 
day_trippr,

I looked at the flow_monitor.py file and it is showing
#The following line is for serial over GPIO
port = '/dev/ttyS0'

Is the info displayed when I ran the ps aux command ok? it says I should see:

pi 3508 0.0 0.9 8796 4112 ? S 15:35 0:00 /usr/bin/python /home/pi/raspberrypints/python/flow_monitor.py pi 3558 0.0 0.1 3548 808 pts/0 S+ 15:43 0:00 grep –color=auto flow_monitor.py

but by the pic I uploaded you can see it's not pointing to /home/pi/raspberrypints/python/flow. I'm seeing something totally different.

Is there something I have to do to get it to refer to the /home/pi/etc... directory?

also, I ran
sudo python /var/www/python/flow_monitor.py

and then blew into the adafruit flow meters, but I don't see anything happen, nor do I see any blinking on the alamode.

When I went into the getty>programming>arduino IDE I chose alamode, set serial port to /dev/ttyS0 I didn't have to make any changes to the pins as my meters are on pins 8, 9, 10, and 11. Once all was done, I compiled the sketch and then uploaded the file, it uploaded with no problem.

before doing any of that, I ensured flowmon was stopped.

Apologize in advance for all these posts, but I've read through the entire string, and followed all the steps, did all the checks, but I can't get the flow meters to register. I'm not sure the alamode is even working except that I'm running the power on it and it's able to upload the data.

any ideas on what to try next?
 
I'm building some confidence, so I went ahead and ran the following:

At this point you should be ready to run the python script.

Copy the flowmon file from the python (/var/www/python) directory to /etc/init.d
$ sudo cp flowmon /etc/init.d

Then give it the proper permissions:
$ sudo chmod a+x /etc/init.d/flowmon


I modified everything initially so my install is in /var/www

**IF YOUR INSTALL IS IN /var/www you should be good to go forward. if not, you need to edit the 14th line and set the root dir for your install.
You can test the program by running:
$ sudo /etc/init.d/flowmon start
$ ps aux | grep flow_monitor.py

Should return:
pi 3508 0.0 0.9 8796 4112 ? S 15:35 0:00 /usr/bin/python /home/pi/raspberrypints/python/flow_monitor.py pi 3558 0.0 0.1 3548 808 pts/0 S+ 15:43 0:00 grep –color=auto flow_monitor.py


But it didn't return the /home/pi/raspberrypints/python/flow_monitor.py etc...

I've attached another image of what I got. Did I do something wrong for it not to return the /home/pi/raspberrypints line?

Any help is greatly appreciated.

Thanks.

Looks like you missed this bit:
Code:
cd /var/www/python
Before this bit:
Code:
sudo cp flowmon /etc/init.d

Easy to do as the instructions seem to just lightly skim over that bit
 
To be fair I figured I would share my findings after setting up a new Raspberry pi 3 running stretch with an alaMode. And to be really fair this with help from this forum (DrunkleJon, day_trippr, ...):

Here is how to get the alamode working
Start Menu > Preferences > Raspberry Pi Configuration ->Enable Serial on Interfaces tap

Run the following through terminal
sudo rpi-update
sudo apt-get update
sudo apt-get upgrade
wget https://github.com/wyolum/alamode/raw/master/bundles/alamode-setup.tar.gz
tar -xvzf alamode-setup.tar.gz
cd alamode-setup
wget https://github.com/wyolum/alamode/raw/master/alamode-setup/stretch-setup
sudo dos2unix ./*
sudo ./stretch-setup

Also Im working on updating the actual code to run on Stretch, needed to update how it connects to the database. Im also going to look at all the versions on github and merge in the best parts of them. Im through CaptnDelta's version, I thought it was a much simpler solution to setup. Will post when I got something on github

That's very interesting! I couldn't get mine to register pours so I tried reuploading the sketch in verbose mode and it appears to silently fail.

I'll have another look on the weekend, but you have given me hope that it can be done.

Cheers,

Kal
 
Kal,
I did execute cd /var/www/python
and then
sudo cp flowman /etc/init.d

then I executed the permissions command. Just to be sure I did it again, and I confirmed that flowmon is in the /etc/init.d directory. Then I executed the sudo /etc/init.d/flowmon start
flowmon started
then I executed ps aux | grep flow_monitor.py
and still get the line ... /usr/bin/python /var/www/python/flow_monitor.py
vs. the ... /usr/bin/python /home/pi/raspberrypints/python/flow_monitor.py

Why would it be pointing to /var/www/python ... vs. /home/pi/raspberrypints/python ...

is that why I'm unable to see the data when I execute the flow_monitor.py command to watch the pours?
 
Kal,
I did execute cd /var/www/python
and then
sudo cp flowman /etc/init.d

then I executed the permissions command. Just to be sure I did it again, and I confirmed that flowmon is in the /etc/init.d directory. Then I executed the sudo /etc/init.d/flowmon start
flowmon started
then I executed ps aux | grep flow_monitor.py
and still get the line ... /usr/bin/python /var/www/python/flow_monitor.py
vs. the ... /usr/bin/python /home/pi/raspberrypints/python/flow_monitor.py

Why would it be pointing to /var/www/python ... vs. /home/pi/raspberrypints/python ...

is that why I'm unable to see the data when I execute the flow_monitor.py command to watch the pours?

Actually I just checked mine out of curiosity and it's the same:

pi@raspberrypi:~ $ ps aux | grep flow_monitor.py
pi 645 0.0 0.7 13856 7148 ? S 10:44 0:00 /usr/bin/python /var/www/python/flow_monitor.py
pi 10592 0.0 0.1 4276 1852 pts/0 S+ 11:28 0:00 grep --color=auto flow_monitor.py

So I don't think you have any issues there, what's the trouble you are having exactly?
 
2 things, but one of them is very stupid.

In the getty screen, I uploaded the example blink sketch to make sure my alamode was working. So now the led light associated with pin 13 is blinking and I don't know how to make it stop.

The other problem is I don't I'm not recognizing pours.

One of day_trippr's tests was to run the following:

- Manually run the listener script:
Code:
________________________________________
$ sudo python /var/www/python/flow_monitor.py
________________________________________
- Pour a few ounces (I lightly blew in the adafruit flowmeter)

A three line (iirc) blurb of text should appear in the terminal window.
One of those is the pin number (it'll be obvious which).

- Try the other faucet and see if you get anything at all.

Let us know what you see...


I have done that, but nothing happens which leads me to believe it's not recognizing my pours.

I did make sure that i ran "sudo /etc/init.d/flowmon stop" and then ... status to make sure the flowmon isn't active.
 
2 things, but one of them is very stupid.

In the getty screen, I uploaded the example blink sketch to make sure my alamode was working. So now the led light associated with pin 13 is blinking and I don't know how to make it stop.

The other problem is I don't I'm not recognizing pours.

One of day_trippr's tests was to run the following:

- Manually run the listener script:
Code:
________________________________________
$ sudo python /var/www/python/flow_monitor.py
________________________________________
- Pour a few ounces (I lightly blew in the adafruit flowmeter)

A three line (iirc) blurb of text should appear in the terminal window.
One of those is the pin number (it'll be obvious which).

- Try the other faucet and see if you get anything at all.

Let us know what you see...


I have done that, but nothing happens which leads me to believe it's not recognizing my pours.

I did make sure that i ran "sudo /etc/init.d/flowmon stop" and then ... status to make sure the flowmon isn't active.

If the blink sketch is still running on your Alamode, then I suggest you reupload the raspberrypints.ino as a first port of call, then reboot and try again.
 
Kal,

I reuploaded the raspberrypints.ino and rebooted. the blink sketch has stopped. I did not start flowmon, and I ran the sudo python /var/www/python/flow_monitor.py and gently blew into all 4 of my flow meters. Nothing happens.
 
Kal,
Here's what I see:

pi@raspberrypi:~ $ sudo python /var/www/python/flow_monitor.py
^CExiting
Traceback (most recent call last):
File "/var/www/python/flow_monitor.py", line 23, in <module>
msg = arduino.readline()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 446, in read
ready,_,_ = select.select([self.fd],[],[], self._timeout)
KeyboardInterrupt
pi@raspberrypi:~ $
 
Kal,
Here's what I see:

pi@raspberrypi:~ $ sudo python /var/www/python/flow_monitor.py
^CExiting
Traceback (most recent call last):
File "/var/www/python/flow_monitor.py", line 23, in <module>
msg = arduino.readline()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 446, in read
ready,_,_ = select.select([self.fd],[],[], self._timeout)
KeyboardInterrupt
pi@raspberrypi:~ $

Doesn't look like your Alamode is "hearing" the pours, maybe recheck the wiring on your flowmeters, but I'm only guessing at this point?
 
Running the listener in a terminal session on Jessie does not work like it did on Wheezy. I've mentioned this here a few times now.
You no longer get the nice clean three line pour message, now you get a "crapload of fail" messages. But if you get the "crapload of fail" it at least indicates the listener "heard" something. No crapload, nothing heard.

To at least try to break the problem in half (ie: was the the Arduino not picking up the meter, or was it the listener not hearing a sent message?) you can use this lightly modified raspberrypints.ino sketch. It lights up the Alamode's "Blink" LED (which is hardwired to GPIO13) for a few seconds when the Arduino sends a pour message. Down near the bottom of the sketch you'll see these three lines right after the pour message gets sent:

Code:
        digitalWrite(13, HIGH);
        delay(3 * 1000);
        digitalWrite(13, LOW);

The sketch has to have the same site-specific edits (meter count and pin numbers) but otherwise it's a drop-in replacement. Once it's resident you can do the meter test. If the LED doesn't light the Arduino isn't seeing the meter. If the LED lights, the Arduino saw the meter and sent a pour message to the RPi...

Cheers!
==============================================

Code:
//This line is the number of flow sensors connected.
const uint8_t numSensors = 6;
//This line initializes an array with the pins connected to the flow sensors
uint8_t pulsePin[] = {2,5,6,7,8,9};
//number of milliseconds to wait after pour before sending message
unsigned int pourMsgDelay = 300;

unsigned int pulseCount[numSensors];
unsigned int kickedCount[numSensors];
unsigned long nowTime;
unsigned long lastPourTime = 0;
unsigned long lastPinStateChangeTime[numSensors];
int lastPinState[numSensors];

unsigned long lastSend = 0;

void setup() {
  pinMode(13, OUTPUT);
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  Serial.flush();
  for( int i = 0; i < numSensors; i++ ) {
    pinMode(pulsePin[i], INPUT);
    digitalWrite(pulsePin[i], HIGH);
    kickedCount[i] = 0;
    lastPinState[i] = digitalRead(pulsePin[i]);
  }
}

void loop() {
  nowTime = millis();
  pollPins();
  if ( (nowTime - lastPourTime) > pourMsgDelay && lastPourTime > 0) {
    //only send pour messages after all taps have stopped pulsing for a short period
    //use lastPourTime=0 to ensure this code doesn't get run constantly
    lastPourTime = 0;
    checkPours();
    checkKicks();
  }
}

void pollPins() {
  for ( int i = 0; i < numSensors; i++ ) {
    int pinState = digitalRead(pulsePin[i]);
    if ( pinState != lastPinState[i] ) {
      if ( pinState == HIGH ) {
        //separate high speed pulses to detect kicked kegs
        if( nowTime - lastPinStateChangeTime[i] > 0 ){
          pulseCount[i] ++;
        }
        else{
          kickedCount[i] ++;
        }
        lastPinStateChangeTime[i] = nowTime;
        lastPourTime = nowTime;
      }
      lastPinState[i] = pinState;
    }
  }
}

void checkPours() {
  for( int i = 0; i < numSensors; i++ ) {
    if ( pulseCount[i] > 0 ) {
      if ( pulseCount[i] > 100 ) {
      //filter out tiny bursts
        sendPulseCount(0, pulsePin[i], pulseCount[i]);
        digitalWrite(13, HIGH);
        delay(3 * 1000);
        digitalWrite(13, LOW);
      }
      pulseCount[i] = 0;
    }
  }
}

void checkKicks() {
  for( int i = 0; i < numSensors; i++ ) {
    if ( kickedCount[i] > 0 ) {
      if ( kickedCount[i] > 30 ) {
        //if there are enough high speed pulses, send a kicked message
        sendKickedMsg(0, pulsePin[i]);
      }
      //reset the counter if any high speed pulses exist
      kickedCount[i] = 0;
    }
  }
}
 
I have 4 meters and I have all 4 of the ground wires going to one gnd pin and all 4 of the power wires going to one power pin, and the middle wire is going to pin 8,9,10 &11. Could it be too much to power all 4 meters?


Does it sound like the alamode is working. Bathe I should edit the raspberrypints.ino file to just 1 meter and see if I can get just 1 to work and then worry about the other 3.
 
The meters draw very little current, about what it takes to turn on an LED.
Use my sketch with your particulars. It should shed some light....

Cheers! (unintentional pun there ;))
 
Running the listener in a terminal session on Jessie does not work like it did on Wheezy. I've mentioned this here a few times now.
You no longer get the nice clean three line pour message, now you get a "crapload of fail" messages. But if you get the "crapload of fail" it at least indicates the listener "heard" something. No crapload, nothing heard.

To at least try to break the problem in half (ie: was the the Arduino not picking up the meter, or was it the listener not hearing a sent message?) you can use this lightly modified raspberrypints.ino sketch. It lights up the Alamode's "Blink" LED (which is hardwired to GPIO13) for a few seconds when the Arduino sends a pour message. Down near the bottom of the sketch you'll see these three lines right after the pour message gets sent:

Code:
        digitalWrite(13, HIGH);
        delay(3 * 1000);
        digitalWrite(13, LOW);

The sketch has to have the same site-specific edits (meter count and pin numbers) but otherwise it's a drop-in replacement. Once it's resident you can do the meter test. If the LED doesn't light the Arduino isn't seeing the meter. If the LED lights, the Arduino saw the meter and sent a pour message to the RPi...

Cheers!
==============================================

Code:
//This line is the number of flow sensors connected.
const uint8_t numSensors = 6;
//This line initializes an array with the pins connected to the flow sensors
uint8_t pulsePin[] = {2,5,6,7,8,9};
//number of milliseconds to wait after pour before sending message
unsigned int pourMsgDelay = 300;

unsigned int pulseCount[numSensors];
unsigned int kickedCount[numSensors];
unsigned long nowTime;
unsigned long lastPourTime = 0;
unsigned long lastPinStateChangeTime[numSensors];
int lastPinState[numSensors];

unsigned long lastSend = 0;

void setup() {
  pinMode(13, OUTPUT);
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  Serial.flush();
  for( int i = 0; i < numSensors; i++ ) {
    pinMode(pulsePin[i], INPUT);
    digitalWrite(pulsePin[i], HIGH);
    kickedCount[i] = 0;
    lastPinState[i] = digitalRead(pulsePin[i]);
  }
}

void loop() {
  nowTime = millis();
  pollPins();
  if ( (nowTime - lastPourTime) > pourMsgDelay && lastPourTime > 0) {
    //only send pour messages after all taps have stopped pulsing for a short period
    //use lastPourTime=0 to ensure this code doesn't get run constantly
    lastPourTime = 0;
    checkPours();
    checkKicks();
  }
}

void pollPins() {
  for ( int i = 0; i < numSensors; i++ ) {
    int pinState = digitalRead(pulsePin[i]);
    if ( pinState != lastPinState[i] ) {
      if ( pinState == HIGH ) {
        //separate high speed pulses to detect kicked kegs
        if( nowTime - lastPinStateChangeTime[i] > 0 ){
          pulseCount[i] ++;
        }
        else{
          kickedCount[i] ++;
        }
        lastPinStateChangeTime[i] = nowTime;
        lastPourTime = nowTime;
      }
      lastPinState[i] = pinState;
    }
  }
}

void checkPours() {
  for( int i = 0; i < numSensors; i++ ) {
    if ( pulseCount[i] > 0 ) {
      if ( pulseCount[i] > 100 ) {
      //filter out tiny bursts
        sendPulseCount(0, pulsePin[i], pulseCount[i]);
        digitalWrite(13, HIGH);
        delay(3 * 1000);
        digitalWrite(13, LOW);
      }
      pulseCount[i] = 0;
    }
  }
}

void checkKicks() {
  for( int i = 0; i < numSensors; i++ ) {
    if ( kickedCount[i] > 0 ) {
      if ( kickedCount[i] > 30 ) {
        //if there are enough high speed pulses, send a kicked message
        sendKickedMsg(0, pulsePin[i]);
      }
      //reset the counter if any high speed pulses exist
      kickedCount[i] = 0;
    }
  }
}

Sweet sketch! You never cease to impress day_trippr!
 
In the rpints installation instructions it says to connect the flow meter to the alamode:

Pin1(red) -> Ground
Pin2 (middle)-> Any digital pin 2-13. Be sure to set this at the top of the Arduino code
Pin3 -> VIN

So that's how I connected my meters. However, I just looked at the adafruit flow meter description and on those meters, the red wire is power, the black wire is ground, and the yellow wire is the pulse output.

So here's the dumb question. Should I be hooking the red wire to VIN, the black wire to GND, and the yellow wire to pin 8, 9, 10, or 11 for my adafruit meters? I've had it set where the red wire is on GND and the black wire is on VIN.

Don't laugh too hard. I was just following instructions and not thinking about what I was doing until Kal said to recheck my wiring.
 
The instructions assume sf800 meters, so, yes, you need to make appropriate adjustments for your meters.

Should I be hooking the red wire to VIN, the black wire to GND, and the yellow wire to pin 8, 9, 10, or 11 for my adafruit meters?

Yes, that would be correct. Hopefully the LEDs inside those meters have strong reverse voltage breakdown ratings.

Your signal pin assignments should be fine. I found avoiding io 3 & 4 was necessary, and use 2 and 5 through 9. Others have used 10 and 11 successfully...

Cheers!
 
In the rpints installation instructions it says to connect the flow meter to the alamode:

Pin1(red) -> Ground
Pin2 (middle)-> Any digital pin 2-13. Be sure to set this at the top of the Arduino code
Pin3 -> VIN

So that's how I connected my meters. However, I just looked at the adafruit flow meter description and on those meters, the red wire is power, the black wire is ground, and the yellow wire is the pulse output.

So here's the dumb question. Should I be hooking the red wire to VIN, the black wire to GND, and the yellow wire to pin 8, 9, 10, or 11 for my adafruit meters? I've had it set where the red wire is on GND and the black wire is on VIN.

Don't laugh too hard. I was just following instructions and not thinking about what I was doing until Kal said to recheck my wiring.

Also if you're using Adafruit meters, be sure to adjust your pours.php file for the different flow rate.
 
Also if you're using Adafruit meters, be sure to adjust your pours.php file for the different flow rate.

Especially if you drill out the smaller side... I found I had to do some testing to find the proper number.
 
day_trippr, Kal,

Thanks for all the assistance with this. I switched the wires around and now everything works with blowing into the flow meters. Now I just have to plum everything into the Keezer.

day_trippr,

The extra code you built into the rpints.ino file that makes the alamode blink is a great help. You can actually see the meters and the python listener are working.

Regards,

Gary
 
Pleased to see this, and always happy to help. :mug:

fwiw, when I built my keezer system I wired Alamode GPIO13 to an LED on the controller IO panel to help for debugging any issues that crop up.
Haven't needed to actually use it for that in a couple of years, but recently it helped me out when I was trying to get the Alamode working on Jessie...

Cheers!

[edit] PS: once you get everything running we need to figure out what was actually needed to get you going :)
Anything that I can add or change to my roll-up will help the next fellow.
 
Back
Top