LSC Rotary switch WB3S Replace with ESP-12F

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
d41u5
New user
Posts: 2
Joined: 20 Apr 2022, 14:51

LSC Rotary switch WB3S Replace with ESP-12F

#1 Post by d41u5 » 20 Apr 2022, 18:03

Hi Mates,

I embarked on a project to convert an LSC device to an ESP-12F module. This device is a rotary button (simple just right left) and a push button.

This one communicates nominally by an integrated circuit without reference and the WB3S module by the standard pins RX TX.

With a signal analyzer, I identified the communication frames that are quite simple and repetitive for each type of command: turn right, turn left and pulse. They usually start with 22 bytes from the IC, then an identical double 7-byte response from the WB3S. The response is the same regardless of the command.

Everything was looking pretty good for me to do this hack, but unfortunately I'm running into a problem right now.

So I flashed my ESP with the release Easy_mega_20220328_normal_ESP8266_4M1M configured its connection, declared a controller (Home Assistant MQTT), prepared a mosquitto broker, declared a Generic-System info device and published some tags and found that everything works fine so far via Mqtt to explore.

But when I wanted to capture the uplink packets from the serial interface via Serial Server nothing happens. I thinking be able to create rules on events on this device to feed a dummy device and/or directly publish the captured frame and after just respond to the IC to simulate a correct reception.

I can't. I use GPIO3 (RX) and GPIO4 (TX) pins with Serial server, event processing is Generic.
I tested HW0, Software Serial (the parameters are the same as my signal analyzer which works well) and yet nothing in the log.

When I deactivate Serial Server and I activate Tools/Advanced/Serial I have a few chars that appear after the prompt "unknow command".

I don't understand what I'm missing.

Am I right to use Serial server? (I also tested Serial Proxy with Test_C firmware)

Can we capture events from the integrated serial standard?

Here are some rule syntaxes I used:

On !Serial# do
TaskValueSet,1,1,%eventvalue%
publish home/Serial,%eventvalue%
end

I don't understand why I'm not getting anything through the Serial server.
I somebody can help me please.

Br,

Viandou

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: LSC Rotary switch WB3S Replace with ESP-12F

#2 Post by TD-er » 20 Apr 2022, 18:18

You're using GPIO-3, which is normally used by hardware serial 0.
So I assume you're now using software serial since you're now using GPIO-4?

Anyway, since you are using a pin from HW serial, you must uncheck "Use serial" on the tools->Advanced page.

Another idea...
Maybe, you can add a pulse counter task (and disable the other task for now) on the intended RX pin of the ESP and see if you get roughly the expected number of pulses per second, so you can check it is electrically correct.
Maybe you need to invert the signal?
Is the level high and low enough for the ESP to detect a level change?

d41u5
New user
Posts: 2
Joined: 20 Apr 2022, 14:51

Re: LSC Rotary switch WB3S Replace with ESP-12F

#3 Post by d41u5 » 21 Apr 2022, 00:52

Thank you for your reply,

I actually tested the GPIO-3 (HW) and GPIO-4 (SW) outputs. I had also noticed the need to stop the function in the Tools>Advanced menu.

However, what I find strange is precisely that this one receives a few characters when it is the only one to be active.

I receive frames few ascii chars in the log console, during the wheel rotations.

I will continu to investigate tomorow and continue to feed this post.

Viandou

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: LSC Rotary switch WB3S Replace with ESP-12F

#4 Post by TD-er » 21 Apr 2022, 09:44

If you have some NodeMCU or Wemos available, you could try to connect it to the pins of Serial0 (thus GPIO 1 & 3).
Then you have HW serial, but also an USB to serial adapter on it so you can look via your computer using some terminal program set to the correct baud rate.

Only make sure that the connected device is potential free or grounded compared to your computer, or else you may fry at least one piece of equipment.

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests