Skip to content
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

Loconet switch #11

Closed
conaito opened this issue Nov 8, 2021 · 18 comments
Closed

Loconet switch #11

conaito opened this issue Nov 8, 2021 · 18 comments

Comments

@conaito
Copy link

conaito commented Nov 8, 2021

I attached the Uhlenbrock IB Switch but it seems to not work. Looks like it wait for some switch settings from command station:

I][WiThrottle.cpp:91] begin(): WiThrottleServer::begin
*WM: [3] unloading
onPacket: SW_STATE(BC) 00 00 43
onPacket: SW_STATE(BC) 00 00 43
onPacket: SW_STATE(BC) 00 00 43

Any idea how i get it work?

@conaito
Copy link
Author

conaito commented Nov 8, 2021

if i use command station as sniffer (by use a Loconet command station) i get follow serial on pluging the IB Switch:

[I][WiThrottle.cpp:91] begin(): WiThrottleServer::begin
*WM: [3] unloading
onPacket: LONG_ACK(B4) 3C 50 27
onPacket: SW_STATE(BC) 01 00 42
onPacket: LONG_ACK(B4) 3C 30 47
onPacket: SW_STATE(BC) 07 00 44
onPacket: LONG_ACK(B4) 3C 30 47

@positron96
Copy link
Owner

Hi, thanks for the report and sniffer dump.

Please describe what your setup is. What loconet devices are connected to the bus apart from ESP32 and IB Switch? A switch decoder itself? Another command station?

@positron96
Copy link
Owner

Did it start to work after you fixed the hardware?

@conaito
Copy link
Author

conaito commented Nov 10, 2021 via email

@conaito
Copy link
Author

conaito commented Nov 10, 2021 via email

@positron96
Copy link
Owner

Well then, my question still stands. What is your setup? I actually don't know what command station needs to do when your switch controller talks to switch decoder. It is my understanding that it should do nothing, and it is implemented this way. Is your decoder connected via LocoNet or DCC?

@conaito
Copy link
Author

conaito commented Nov 15, 2021

The IB Switch is just a board from Uhlenbrock with buttons (to can use as switches for turnouts as example). Thats what you need to know?

@positron96
Copy link
Owner

Please describe what your setup is. What loconet devices are connected to the bus apart from ESP32 and IB Switch? A switch decoder itself? Another command station?

@conaito
Copy link
Author

conaito commented Nov 15, 2021 via email

@positron96
Copy link
Owner

So, are your turnout decoders connected via DCC? The command station does not forward switch commands from LocoNet to DCC. I have no DCC decoders and so have no way to test if such forwarding works. Also, without decoders I have no need for this feature.

@conaito
Copy link
Author

conaito commented Nov 15, 2021 via email

@positron96
Copy link
Owner

Yes, your other command station answers to LocoNet switch requests (on behalf of DCC decoders that can't talk back). This command station does not process switch commands in any way.

@conaito
Copy link
Author

conaito commented Nov 15, 2021 via email

@conaito
Copy link
Author

conaito commented Nov 15, 2021 via email

@positron96
Copy link
Owner

No, it's not that difficult. There is some work already done in the form of turnout roster.
The good thing about open-source is that you can always implement what you need yourself.

@conaito
Copy link
Author

conaito commented Nov 19, 2021 via email

@positron96
Copy link
Owner

Processing of LocoNet messages is done in LocoNetSlotManager in processMessage (there is a big switch on opcodes), you'd need to add case of the messages you need. As you have found, turnout roster is handled by CommandStation, Methods getTurnouts and turnoutToggle and turnoutAction would be needed to react of recieved LocoNet messages.

@positron96
Copy link
Owner

Closing in favor of #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants