-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pours drinks 2 times #1
Comments
Sounds like you have a hardware issue -- the button GPIO pins are probably grounding out while the drink is being pour (which calls the button interrupt). You could try switching interrupts so they trigger on a high input, but it would take some rewiring. |
That wouldn't be a problem. Could you explain me what to do exectly? That would be a huge help. Also it always two times, after that I'm able to control it again until I pour the next drink than it will pour two times again. |
No problem. I used this guide when I originally programmed it. You'll want to make the changes so the button is similar to the button on pin #24 (we implemented the ones on 23/17 in our code). http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio-part-3 |
Thanks, I will try that. |
Changed the selection Button to an rising edge detection but when I tried it the Oled was Converted, so everything black was white and vice verca. Also it detected the button push but it fell into a loop, not only was it doing it two times as before but it didn't want to stop. Now gone back to original code and wiring and somehow the Oled is still converted... (Oled was just a bad connection, but rest stays the same) |
I also didn't install the LED strip, don't know if thats connected to this? |
Weird. Sounds like the OLED library might be conflicting with the button pins somehow. I would try either switching the pins for the buttons or commenting out all calls to the OLED screen (menu prints in the terminal). |
I deconnected the grounded pins of the buttons and strangly he randomly started to pour a drink right now. Is that even possible? |
It's possible. Sounds like your buttons are misconfigured. |
OK, I didn't used excectly the same ones as you but also momentary switches so I thoght that would be alright or are there diferences which could cause these problem? |
I don't think the buttons are causing an issue. It's probably because the interrupts for the buttons are misconfigured. |
How am I able to adapt the interrupts for my buttons? |
Take a look at that link I sent. They can trigger on either high or low, but make sure they're wired like that guide depending on what you do. Also try using different GPIO pins for the buttons and commenting out calls that turn on the screen. |
Changed the GPIO pins, after rebooting everything worked fine but when I took the Pi from the power ( not letting him shut down - that shouldn't cause this right?) the same pattern started again. Wondering why it worked and then suddenly not anymore. |
Also commented out everything that turned on the sreen but after that he didn't recognise any button push anymore. |
Changed both buttons so they are connected to 3.3V and changed the code. First when I got only the select button connected everything worked fine even after multiple restarts but after I connected the second one it's in its loop again, without ending but when I deconnected the one again it didn't stop to loop. Even when I got all deconnected it starts randomly pouring drinks one after one. Last time I changed the buttons to trigger on high I connected them to the 3.3V pin of the disply, this time I took the one of the relais and the display worked fine. |
When I now press to pour a drink it gets into a loop without end where it also randomly switches drinks between each pour. Don't understand the part in the code where the event detection for the pins is stopped, wouldn't that cause problems detecting button presses? Really need help over here. |
I can't make sense of this at all but when I decreased the milliliter amount of what the pumps draw from 100+ down to 50, the system does not pour multiple drinks. |
Do u mean the flowrate or the actual amount for the drink? Because I already put the amount down and that didn't change anything. |
The actual amount for a drink. It was 150 oj, 50 vodka. I decreased oj to 50 and it only poured once. I repeated 3 times for other drinks. As soon as I bumped it back to 150ml it doubled or tripled up on drinks again |
I already had amounts below that and for me it sadly din't change anything... |
I decided to start over and reinstall Raspbian. Right out of the box, it made one drink. As soon as I edited the pump_config.json file and added 2 more pumps it went back to the multiple pours again. Thinking this might be the case I saved the original pump_config file and reloaded it. Everything worked fine again. Since my OLED screen is still not working I'm watching the drink selection in the terminal. Something I noticed was as soon as the drink was done being made it would list the drink again about 2 seconds later, and then a 3rd time but the bartender still only made one drink. I went back to the pumps_config file and only edited the liquid: pump 1= vodka, pump 2=rum (the order I prefer to have it). I ran the Bartender.py as normal and after the drink was done it triplicated the name of the drink again but this time it did make a second drink... and third... and then I rebooted. Back to square one, I deleted the new pumps_config file, reloaded old one, ran another gin&tonic and almost the same thing happened. After the drink was made, 2 seconds later, it listed the drink in the terminal again, 2 seconds later it listed it a third time but this time it listed Configure and then Pump 1. I was about to say there is something in the coding that doesn't like the pumps_config file messed with but when this new issue happened, it's basically telling us there are random firings of buttons. Ugh! Only if I had a way to make an alcoholic beverage to lessen the tension I am feeling from the build process of this technological paperweight. :-D |
That's the same I'm experiencing. The second drink you see in the terminal is just the display showing the drinks after it has finished making a drink but after that it starts randomly receiving button presses. I already tried manually debouncing and avoiding the problem of a floating condition of the pin which would cause this problem. Sadly no effect could even be seen. Also changed the buttons but the same again. The problem - for me - also only happens right after the drink has finished, so it's not completly random but rather somehow connetected to the sript, because I already changed the code in such a way that it changes the pins for the buttons into an output during the time of pouring so it shouldn't even be able to receive any new inputs but right at the moment the mode of the pins change back into inputs it missfires again... I can only think that after the sript for pouring a drink has finshed there's something in the code, which influences the script that it thinks there are still presses left to process. |
Just an interesting note: I actually edited the bartender.py file to accept commands over ssh for the left and right buttons (just to make testing stuff easier), which called |
That was the next thing I wanted to test. So know we need a competent developer who is able to find that loop or bug in the sript, sadly I'm not able to do that :( |
I make no claims to being a competent developer, but I had a crack anyway :p , see #6 |
Just tested your code and until know it seems to be working! Can't be completly sure but this weekend it's going to be tested throughout ;D |
Finally sat down with the Bartender, removed the original Smart-Bartender folder. Then cloned https://github.com/Danzibob/Smart-Bartender ~/Smart-Bartender $ sudo python bartender.py I copied the contents from the lib_oled96 folder directly into the Smart-Bartender folder and got then the following happened: ~/Smart-Bartender $ sudo python bartender.py What am I doing wrong? |
Are you using a pi 3b? If not, it's possible you need to use SMBus(0) instead |
I am operating with a 3Bb. My apologies, I could have sworn I had the i2C functionality already enabled through raspi-config. I am feeling quite annoyed that what seemingly should be simple is now getting complicated. After I took care of the i2c functionality I now get this message when running the bartender.py: |
Just tested it again with a drink with all 6 pumps pouring and suddenly I get the same problems as before... Also the program crashes after some pours because of a segmentation fault... I just changed the original code with the doubledrink fix would there be anything different? I don't use the i2c display so couldn't use your code. |
Well the Problem of multiple pours seems to only happen one time and not anymore but I'm still getting that segmentation fault, not everytime but for some drinks it happens and for some not... |
The bartender pours one drink than finishes the progress but without any extra input it pours a second drink. It's not possible to do anything between those two processes. On some boots of the Pi it does only pour one at a time but that's gone on the next restart.
The text was updated successfully, but these errors were encountered: