ThomDietrich / SenseoWifi

Wifi'ify the Senseo coffee maker. Circuit and firmware for an internal Senseo hack to monitor and control the daily coffee brew (via MQTT) โ˜•๏ธ๐Ÿ“ถ
GNU General Public License v3.0
90 stars 23 forks source link

current on the buttons #13

Closed VinceMasuka closed 5 years ago

VinceMasuka commented 6 years ago

Hi...

I tried to get this project finally done and everything is now build in the Senseo:

But:

By any chance you can't push me in the right direction what to check first?

Thanks!

Regards Vince

VinceMasuka commented 6 years ago

Stupid me. Of course TP, T1 and T2 have to have 5.08 volts for the optocoupler to trigger the Senseo.

BUT, I measured everything trough and recognized that on D1, D2 and D5 (triggered or not) is no current at all (even if measured directly on the Wemos - I guess it should be like the triggering current of like 3.2 volts). Only D7 (that's the LED pin of the Wemos) comes with 3.20 volts to the optocoupler. grafik

I'm still not getting the picture what went wrong...

Suggestions? Anyone?

Regards Vince

ThomDietrich commented 5 years ago

Hey Vince! Sorry for the late reply. Did you solve the issue?

VinceMasuka commented 5 years ago

Hi

Unfortunately not. I connected the thing over FHEM via MQTT (as OpenHAB was too troublesome of sorts). So when I trigger these (like POWER for example) MQTT reports back that the state has changed, but still there is no current measurable on the ESP8266 pins.

I even flashed a second board: Same outcome. Makes me think it's a software issue.

This is driving me nuts...

Just to be sure: What would be the MQTT command to power this thing on?

ThomDietrich commented 5 years ago

Hey there ๐Ÿ‘‹

  1. You receive MQTT messages from the board and therefore are certain that the firmware flash worked.
  2. More precisely, you receive "ON" via .../power and "SENSEO_HEATING" via .../opState if you press the power button manually?
  3. You publish a message with payload "ON" to the topic .../power/set and then "MQTT reports back" - what do you mean by that? As you can see here there is no optimistic response. The response should be what's described under (2.). For testing please send an invalid payload and check for the "power: malformed message content." debugging message.

To rule out hardware issues you could modify the source code to trigger a power press, e.g., when the firmware has booted.

ThomDietrich commented 5 years ago

FYI: Try to get it working with MQTT first. That is best for troubleshooting. For later use you might be happy to find my openHAB configuration here: https://github.com/ThomDietrich/openhab-config/blob/master/items/senseoWifi.items Don't torture yourself with FHEM ๐Ÿ˜…

VinceMasuka commented 5 years ago
  1. I really like to belive that.
  2. Yes, that works as expected. If I manually push the button physically on the Senseo, my mosquitto_sub tells me "_opState SENSEOHEATING", "power ON", "outOfWater false", "brew false" and "_opState SENSEOREADY".
  3. Oh, I just meant if I publish something, that the mosquitto subscription immediately tells me so (as expected). So when I send a invalid content like _mosquittopub -t homie/Senseo/machine/power/set -m toggle I receive: debug power: malformed message content. Allowed: [ON,OFF]

That brings us to the assumed valid version: _mosquittopub -t homie/Senseo/machine/power/set -m ON ...but "opState" stays on "_SENSEOOFF".

ThomDietrich commented 5 years ago

So far so good. Now I'm afraid you need to modify the source code to figure out where the issue lies exactly.

VinceMasuka commented 5 years ago

OK, for the sake of progress, I'll have to do so...

So this suggestion implies that you think this is not hardware, but software related?

ThomDietrich commented 5 years ago

To the contrary. As the firmware seems to work and interact with your machine (it's able to detect "power ON") this is most probably an issue with your hardware setup. You need to follow along the route, make sure the optocoupler is switched and check why it doesn't trigger a Senseo button press. One thing you could do: Increase the milliseconds of virtual button press, then measure the optocoupler on output side. Whatever you do please be careful with high voltage.

VinceMasuka commented 5 years ago

Nice hint. I modified the virtual button press to 1000 an voila: Senseo is powering up.

Thanks!

ThomDietrich commented 5 years ago

Wonderful. Would you invest a few extra minutes to figure out which lowest value would work for you? I'd like to update the source code here accordingly but one full second is quite a lot. How about e.g. 150 or 200?

VinceMasuka commented 5 years ago

As to your pictures and decriptions, having your project as example for mine, I directly added an external micro usb access to my 7820 Senseo, too. This makes flashing pretty easy now and I'll do some more flashes (see my open TCRT issue). With this upcoming flashing, I'll alter the virtual press button and report back within this thread.

By the way: Is there some documentation regarding OTA procedure on your fingertips?

ThomDietrich commented 5 years ago

Thanks! Your help will make a rebuild easier for the next guy.

I need to update documentation. I know that it does not at all cover all aspects of the project. Regarding OTA I can tell you that you need to follow the OTA mechanism of homie-esp8266:

If the script doesn't work for you check out this bash script: https://github.com/marvinroger/homie-esp8266/issues/308

Btw did you flash the UI bundle? Makes things way easier. Find all needed steps here: https://github.com/marvinroger/homie-esp8266/tree/develop/data/homie

VinceMasuka commented 5 years ago

I don't know what went wrong in first place, but it now seems that my setup accepts much lower ms for the virtual button press than before (I'm starting to suspect a faulty copper wire in there...).

As for your question, it looks like that static const int pressDuration = 36; is the lowest working value to turn on/off the Senseo 7820.

I'm curious if this value is applicatable to all situations and buttons..?

EDIT: No, it's not. Looks like this value is nice indeed for turning on/of the machine, but it has it's issues with the recipe (it just won't start then...). For testing purposes I reverted back to 100 as suggested by your original sketch.

mboremski commented 5 years ago

Not sure if this still is open.. I also had some issues to get the buttons "pressed" via OP. For me 110ms have been the lowest value it was working with. I would recommend to change it to:

// Duration of button "press" (in milliseconds)
static const int pressDuration = 150;
ThomDietrich commented 5 years ago

It is probably safe to assume that this change will not have any side effects. I would be most curious to know why this is an issue for you guys. Do you own an older/newer Senseo model or did you use different optocouplers?

mboremski commented 5 years ago

From my knowledge of ยตC coding it might be possible that Senseo changed the time a button needs to be pressed. Maybe for better antibeat performance. I think the 100ms has been a bit to tight to fit for all devices.

Did you once try to shorten your pressDuration to find the minimum pressing-time for your Senseo? Could be that 90ms already is to short. In this case the 100ms are to tight to adress also manufacturing-tolerances.

ThomDietrich commented 5 years ago

I probably did. My initial tests to understand the behavior of the machine were pretty thorough. Can't remember though and your 90ms argument could just as well be true. 150 is a worthy improvement ๐Ÿ‘