visualapproach / WiFi-remote-for-Bestway-Lay-Z-SPA

Hack - ESP8266 as WiFi remote control for Bestway Lay-Z spa Helsinki
GNU General Public License v3.0
305 stars 74 forks source link

Display works, nothing else #330

Closed menime8 closed 2 years ago

menime8 commented 2 years ago

Hi there, i have a Dreamstream SPA, which has exact the same electronics like Lay Z Spa. Both selled from Bestway. My Pump looks like the newer 2021 model.

IMG_20220710_172051 IMG_20220710_132059 IMG_20220710_154049 IMG_20220710_172102

I started with PCB V2, NodeMCUV3 and the TXS0108E. First try, nothing happend. Second try with 10K resistor, it Starts, DSP starts flashing. Third try: 560 ohm resistors between DSP and ESP. Display works fine, melody and IP shown.

But i can't get any connection to the CIO. Wires and connections are all checked with my meter.

I hope anyone can give me a hint 🤔

Thanks

menime8 commented 2 years ago

/hwtestinfo.html

DSP input pin 2 0 errors of 1000 DSP input pin 3 0 errors of 1000 DSP input pin 4 0 errors of 1000 CIO input pin 2 0 errors of 1000 CIO input pin 3 0 errors of 1000 CIO input pin 4 0 errors of 1000

If i start the test with disconnected plugs i get:

DSP input pin 2 500 errors of 1000 DSP input pin 3 500 errors of 1000 DSP input pin 4 500 errors of 1000 CIO input pin 2 500 errors of 1000 CIO input pin 3 500 errors of 1000 CIO input pin 4 500 errors of 1000

AND: with PCBV2 you don´t need 5V, because you´ll get it from your USB-Port. It is easier for the most people.

visualapproach commented 2 years ago

Nice. 500 is = no contact.

menime8 commented 2 years ago

Nice. 500 is = no contact.

Also test with single broken contacts, works fine. Thank you.

Lets see what my CIO says

SigmaPic commented 2 years ago

I think one of them is for the on board LED. How much do they affect the signal?

You're right, the LED is on D0. Maybe D11 and D12 is better.

We could also use D11 and D12, isn't it ?

What is that? I'm only aware of D0-D8

D11 and D12 is located on the other side of the esp. Look on the schematic [https://github.com/nodemcu/nodemcu-devkit-v1.0/blob/master/NODEMCU_DEVKIT_V1.0.PDF]()

Do you have an idea why the DSP is flashing at boot and why adding serial resistor helps ?

Not really. Obviously random but errors would case things to behave weird. There is 'enable-bits' that would flash the display if toggled, but the strange thing is that it works during start up sequence.

Sorry, I didn't catch you. What are the 'enable-bits' you talked about? Can you explain ?

I think it's a nice idea. Would need some mods on the pcb to make it pretty and easy. I wonder if it would work on all other models as well.

Yep it depends on the microcontroller of the other models. But it should work I think. I will check again that point.

Possibly the audio will be more silent but it's no good on the 2021 models anyway from what I have heard.

What is no good on 2021 model ? I am interested because I have a 2021.

What was your setup again @SigmaPic ? Is it working for you?

I have ordered a PCB V2 customized by me with SMD resistors and a jumper to root the audio directly from CIO to DSP. I can share it once it will be tested. I have a model 2021.

SigmaPic commented 2 years ago

/hwtestinfo.html

DSP input pin 2 0 errors of 1000 DSP input pin 3 0 errors of 1000 DSP input pin 4 0 errors of 1000 CIO input pin 2 0 errors of 1000 CIO input pin 3 0 errors of 1000 CIO input pin 4 0 errors of 1000

If i start the test with disconnected plugs i get:

DSP input pin 2 500 errors of 1000 DSP input pin 3 500 errors of 1000 DSP input pin 4 500 errors of 1000 CIO input pin 2 500 errors of 1000 CIO input pin 3 500 errors of 1000 CIO input pin 4 500 errors of 1000

AND: with PCBV2 you don´t need 5V, because you´ll get it from your USB-Port. It is easier for the most people.

Dis you try with the old esp ?

SigmaPic commented 2 years ago

I deleted the 2 resistors, another idiot idea :-) LED is working.

If you use a MOSFET LLC, you can remove it because there are some pull ups on the LLC.

menime8 commented 2 years ago

Dis you try with the old esp ?

With old and new, same the same results. So now the new one also won't work.

Here i have a few shots with the osci. Attention, different time dividers. IMG_20220716_192332 IMG_20220716_192302 IMG_20220716_192237

RatAttack83 commented 2 years ago

Interesting news in this topic... So I have disconnectet my spa and tried to get it to work again... with Powerbank and with laptop... it wont work... :( I ordered some othe NodeMCU and tried it... same result... so i can measure with a mobile scope, but my contact is on holiday for the next three weeks and my 230V scope is not the best idea. But i have read a bit in this topic and think you are on the right way. :) i hope you will get the Model 2021/22 to work :)

If someone give me shematics to test, i can etch it at work and check it at home :) so perhaps i can contribute a little.

SigmaPic commented 2 years ago

Dis you try with the old esp ?

With old and new, same the same results. So now the new one also won't work.

Here i have a few shots with the osci. Attention, different time dividers. IMG_20220716_192332 IMG_20220716_192302 IMG_20220716_192237

I think it's chip select, clock and last one data. Isn't it ? Clearly the last signal is not correct. Edges are too smooth. Too much filtered. What was your setup? Which LLC ? Resistors ?

menime8 commented 2 years ago

I think it's chip select, clock and last one data. Isn't it ? Clearly the last signal is not correct. Edges are too smooth. Too much filtered. What was your setup? Which LLC ? Resistors ?

Scoped with original DSP on it, nothing else.

SigmaPic commented 2 years ago

I think it's chip select, clock and last one data. Isn't it ? Clearly the last signal is not correct. Edges are too smooth. Too much filtered. What was your setup? Which LLC ? Resistors ?

Scoped with original DSP on it, nothing else.

😳 That's really strange. It's the first time you look at the signal ?

menime8 commented 2 years ago

Yes. I will now disassemble the display again, to see what R or RL there is.

SigmaPic commented 2 years ago

I decoded the signal, it's a command 0x42 0x1B 0x1B

Maybe other people have already looked at the signal and know if the waveform is normal.

It's strange because some edges are Ok and some other edges are smooth.

menime8 commented 2 years ago

IMG_20220717_120402 Screenshot_2022-07-17-12-03-40-196_com android chrome

Shorten the wires, thanks for your hint with that Strange signal. I think the wire acts like a capacitance.

Now i can read the actual temp and thats it. No switch is working.

menime8 commented 2 years ago

Shorten the wires, thanks for your hint with that Strange signal. I think the wire acts like a capacitance.

Now i can read the actual temp and thats it. No switch is working.

I use now the pre2021. I get data from CIO, but can't send any back.

SigmaPic commented 2 years ago

@menime8 Can you monitor the signal on the input of the esp.

If you can do it with the LLC as well. I think we will understand why it doesn't work.

menime8 commented 2 years ago

@menime8 Can you monitor the signal on the input of the esp.

If you can do it with the LLC as well. I think we will understand why it doesn't work.

Lets see if i would do this next few days. Everytime disassemble everything and bring the pump inside, sometimes i would use the pool 😉 And it needs filtered every day.

SigmaPic commented 2 years ago

What change with pre2021 ?

It's the pinout ?

Can you tell us the correspondence between the scope screenshot and the pin number on the connector ?

visualapproach commented 2 years ago

Have you tried MIAMI2021? It's for the newer pumps. It uses different codes for the buttons etc. Or maybe the special version 54149E that uses two data lines and a clock.

visualapproach commented 2 years ago

I decoded the signal, it's a command 0x42 0x1B 0x1B

Maybe other people have already looked at the signal and know if the waveform is normal.

It's strange because some edges are Ok and some other edges are smooth.

that would be right. the 0x42 is the CIO asking the DSP for which button is pressed. 0x1b1b means no button.

menime8 commented 2 years ago

Have you tried MIAMI2021? It's for the newer pumps. It uses different codes for the buttons etc. Or maybe the special version 54149E that uses two data lines and a clock.

I tried all the time Miami, nothing. Today i tried Pre2021 and i see the temp in the display. But only after i shorten the cables again. Needs resistors between DSP and ESP. When i solder resistors between CIO and ESP the connection won't work again.

I try the other Software these days.

Here another pictures from DSP PCB

IMG_20220717_112607 IMG_20220717_112743

menime8 commented 2 years ago

What change with pre2021 ?

I'm interested, too.

What is the difference? Other Hex-Codes or other SPI config?

visualapproach commented 2 years ago

Same chip as in my display:

36

And yes, same SPI but different bitpatterns. It appears from your scope pics that it's clocking faster than mine. 40KHz vs 22?

menime8 commented 2 years ago

I'll have a closer look tomorrow, about the frequencies.

RatAttack83 commented 2 years ago

IMG_20220717_120402 Screenshot_2022-07-17-12-03-40-196_com android chrome

Shorten the wires, thanks for your hint with that Strange signal. I think the wire acts like a capacitance.

Now i can read the actual temp and thats it. No switch is working.

Same here... Temp is at MQTT, too but nothing else... Pushbutton makes a beep but takes no affect. Also via MQTT 😢 But the Webserver only starts safe if i connect a powerbank, without no connection.

menime8 commented 2 years ago

Same here... Temp is at MQTT, too but nothing else... Pushbutton makes a beep but takes no affect. Also via MQTT 😢 But the Webserver only starts safe if i connect a powerbank, without no connection.

Can you post a picture from your PCB? Tried the 54149E Version? Which pump model?

visualapproach commented 2 years ago

You could rightclick in the browser and find inspect/console. Then check "button codes" when you press different buttons on the display. Compare with the defines in libs/bwc/const.h (from the top of my head. Not at computer) Then you will be able to determine which model to use.

SigmaPic commented 2 years ago

Here another pictures from DSP PCB

IMG_20220717_112607 IMG_20220717_112743

I looked at the datasheet of the TM1628 and I found something very interesting. They explain that DIO pin is open drain pin which is plausible. And they recommend to put a pull up on that pin. On the recommended schematic, they put pull up on all signals.

Where are located these pull ups ? On CIO or on DSP board.

On the CIO, we can see some via that go somewhere but I don't know where.

@visualapproach are you aware about that ?

If there is no pull up on DSP side, it means that these pull up shall be on BWC. With an LLC, no problem because they are present on the LLC but with a direct connection it can be unstable.

visualapproach commented 2 years ago

@SigmaPic I'm not aware of where the pull up resistors are located. It would make more sense to put them on the CIO side as it's providing the 5V in the first place. But not necessary I guess. It is a while since I made this but I think I measured 5V on the data pins from the CIO. Now I have a 54189 (PRE2021) so things may have changed. I think it is strange that there is so many problems/solutions recently. New NodeMCU solved it for one, loosing the LLC for another, resistors for many other, using "the other" LLC for some. I like your way of attacking the problem though.

SigmaPic commented 2 years ago

It's because some people have trouble that I search why. I guess we miss something that will make it work for everybody :)

In #116 we can clerly see the pull up resistors. they are on the DSP board:

image

menime8 commented 2 years ago

You could rightclick in the browser and find inspect/console. Then check "button codes" when you press different buttons on the display. Compare with the defines in libs/bwc/const.h (from the top of my head. Not at computer) Then you will be able to determine which model to use.

I can´t get the MODEL54149E to work. It seems like a watchdog error.

the ESP reboots every 10 secs.

Serialmonitor says: wdt reset load 0x4010f000, len 3460, room 16 tail 4 chksum 0xcc load 0x3fff20b8, len 40, room 4 tail 4 chksum 0xc9 csum 0xc9 v000772c0 ~ld Failed to load settings.txt

I read the Button codes, say model pre2021.

Pin 1 is +5v Pin 2 is GND Pin3 IMG_20220718_134629

Pin 4 IMG_20220718_134647

Pin 5

IMG_20220718_134805

menime8 commented 2 years ago

They put the old eggshaped pcbs in the new square housings and sell them less cheaper under a other name. I payed 199€/~200$ for it 😅

SigmaPic commented 2 years ago

Your last scope screenshot have been taken without the esp ?

menime8 commented 2 years ago

Your last scope screenshot have been taken without the esp ?

No

SigmaPic commented 2 years ago

Your last scope screenshot have been taken without the esp ?

No

What setup ? What resistor ?

menime8 commented 2 years ago

Your last scope screenshot have been taken without the esp ?

No

What setup ? What resistor ?

Original with DSP. So now someone can say which is data and which clock. Last time i measured, but did not noticed which picture from which wire was.

And with ESP i tried to read the Browser

IMG_20220718_134236

With pressed buttons i get the codes from pre2021

visualapproach commented 2 years ago

if you have a PRE2021 and press UNIT(C/F) button on the display (may have to keep in pressed a few seconds) you will see code '1012'. If you see '0809' you have a MIAMI2021. If you see '0a09' you have a maldives2021 with hydrojets.

visualapproach commented 2 years ago

pin 3 is data, pin4 is clock, pin 5 is chip enable/CS

All signals look good except data which looks like a capacitance issue as @SigmaPic already said. Or what do you make of it @SigmaPic ?

menime8 commented 2 years ago

if you have a PRE2021 and press UNIT(C/F) button on the display (may have to keep in pressed a few seconds) you will see code '1012'. If you see '0809' you have a MIAMI2021. If you see '0a09' you have a maldives2021 with hydrojets.

I See 0200, 1312, 1112, 1212, 1012, 0300 and 0100, possible i tried the unit button NOT.

visualapproach commented 2 years ago

Did you try @160MHz @menime8 ?

menime8 commented 2 years ago

Did you try @160MHz @menime8 ?

No. Tomorrow the next and i think the last try 😅 I'll try 160mhz, i measure again my 22 or 40 kHz and i also do so some shots with ESP in data line

visualapproach commented 2 years ago

if you have a PRE2021 and press UNIT(C/F) button on the display (may have to keep in pressed a few seconds) you will see code '1012'. If you see '0809' you have a MIAMI2021. If you see '0a09' you have a maldives2021 with hydrojets.

I See 0200, 1312, 1112, 1212, 1012, 0300 and 0100, possible i tried the unit button NOT.

You need to check which button is what because those values are used in all models, just in a different order. The UNIT button would be the easiest check because it differs between the models.

menime8 commented 2 years ago

if you have a PRE2021 and press UNIT(C/F) button on the display (may have to keep in pressed a few seconds) you will see code '1012'. If you see '0809' you have a MIAMI2021. If you see '0a09' you have a maldives2021 with hydrojets.

I See 0200, 1312, 1112, 1212, 1012, 0300 and 0100, possible i tried the unit button NOT.

You need to check which button is what because those values are used in all models, just in a different order. The UNIT button would be the easiest check because it differs between the models.

I'll check it.

SigmaPic commented 2 years ago

Ok nice !

So, it's the same pinout that the one implemented in ESP code: Pin 1 is +5v Pin 2 is GND Pin 3 Data Pin 4 CLK Pin 5 CS

What is interesting for me is that it confirm was I discovered about the TM1628 that is an open drain on data pin. You screenshots confirm that point and let me think that CIO is in push pull because:

  1. When the CIO send data, the low level is not 0V but 0.8V and edges are sharp
  2. When the DSP send data the low level is 0V but edges are smooth

This is a very strange hardware design.

image

I will think about that and suggest a new way of voltage conversion.

SigmaPic commented 2 years ago

@menime8 @visualapproach Finally, what is the issue ?

The signal are not clean with the original setup.

Your display works with BWC, right ?

But you cannot control the CIO from the esp, right ?

According to you, the issue comes from the wrong button code or from a bad signal conversion?

SigmaPic commented 2 years ago

@visualapproach After several simulation, I come to the following conlusion.

The best solution is to use the mosfet LLC. Pin D3 and D4 that need to pull up for a proper boot of the ESP shall be used as ouput only only. When used on a pin that is an input the voltage level are not so good and there is a risk that the DSP or the CIO pull the pin to low at boot. The best solution is to use them for chip select and the clk of the DSP.

I suggest no serial resitors, they are not needed. And maybe a small cap but a low value, 50pf or 100pf max.

I suggest :

CIO_DATA : D1 (same as today) CIO_CLK : D2 (same as today) CIO_CS : D5 (new pinout)

DSP_DATA : D6 (new pinout) DSP_CLK : D4 (new pinout) DSP_CS : D3 (new pinout)

What is your opinion ?

Finally is easy to solder as today. I'm curious to know if with this new pinout, the display will still flash.

visualapproach commented 2 years ago

Awesome @SigmaPic ! I think it's worth a try. Your calculations has more chance of success than my guesses 😃 I can make a new PCB define in the code and then me or you make a drawing how to connect the cables. As I see it you need to make a braid almost, but that's cool. If it works we can do a new PCB later.

visualapproach commented 2 years ago

OK @menime8 @RatAttack83 @SigmaPic , so I uploaded new version (DEV BRANCH). Edit model.h and use PCB_V2B. Reconnect wires as described above and in the comments in model.h. Use red LLC.

SigmaPic commented 2 years ago

Awesome @SigmaPic ! I think it's worth a try. Your calculations has more chance of success than my guesses smiley I can make a new PCB define in the code and then me or you make a drawing how to connect the cables. As I see it you need to make a braid almost, but that's cool. If it works we can do a new PCB later.

OK @menime8 @RatAttack83 @SigmaPic , so I uploaded new version (DEV BRANCH). Edit model.h and use PCB_V2B. Reconnect wires as described above and in the comments in model.h. Use red LLC.

Nice !!

This is the temporary schematic. Once we know it work, I can update the easyEDA schematic and even the PCB if you want.

Do you confirm my schematic ?

Don't pay attention to colors

image

menime8 commented 2 years ago

@visualapproach @SigmaPic Thanks for the great work, i'll direct try this tomorrow morning.