Open tinwhisker opened 5 years ago
Hi, you made a great job.
I have tested your program, and it works good to get the Spa feedback.
Here a visualisation of the protocol. May be it can help.
I would like to be able to start the Spa, but also dont know how to do. Bests
I got the spa controller to recognize a simulated button press! I first tried like you did and switched data line from input to output, set it low for the duration of a latch high. No success. Then I looked at the pcb again and tried to reassemble what’s happening there: The data line is pulled low using a 1k resistor for the duration of a whole latch to latch cycle (16 clocks). This is what I did: I used another pin D1, configured it as output and connected it to the data pin with 1k resistor. D1 is default high and set to low from one latch high to the start of the next latch high. This is done only if the button bit is detected for the button press that like simulate. I do this 10 times in a row to simulate a single button press.
@Eddine97 - very nice visualisation, that'll come in very handy! Thank you.
@UlrichMai - fantastic sleuthing! So if I read right, I was close-ish with assuming my pulling high was too weak? (Or probably mangling the pin state). How would your timing explanation look as a diagram?
@UlrichMai could you please post your changes in your software code?
Sorry that it took so long. Now I published my project that has the working solution for the button push. It has a dedicated chapter in the readme for that problem The button press problem. The simulateButtonPress() function is showing the relevant code. @tinwhisker, thanks that you published your code. Your interrupt driven solution was what I was missing, when I analyzed the protocol last year, and tried to capture the signal via SPI interface, which did not work.
Will need to take traces of button presses.
Theory: At 'button press' read, 7 patterns are clocked through. If a button is pressed, then the data line is pulled LOW during a latch HIGH. For X 'button reads' this must repeat, for spa controller to recognise it as a press and not environmental glitch.
C: |¯| |¯| |¯| |¯| |¯| |¯| |¯| |¯| |¯| |¯| D: ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ | | ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯||¯¯ L: |¯|
Reality: No response from SPA.
Possible reasons: