positron96 / LocoNetControlStation

An ultimate model railroading control station based on ESP32, with LocoNet, WiFi, WiThrottle, DCC
MIT License
19 stars 5 forks source link

Loconet switch #11

Closed conaito closed 2 years ago

conaito commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Did it start to work after you fixed the hardware?

conaito commented 2 years ago

no still not work. Am 10. Nov. 2021, 10:52 +0100 schrieb Paul Melnikov @.***>:

Did it start to work after you fixed the hardware? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

conaito commented 2 years ago

as i see you started turnout roster. it send to withrottle on connect with engine driver. does it also send out on loconet? may here is the issue? Am 10. Nov. 2021, 10:52 +0100 schrieb Paul Melnikov @.***>:

Did it start to work after you fixed the hardware? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

positron96 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

1) only command station and the IB Switch or 2) Command Station, Daisy 2 (Uhlenbrock) hand throttle and IB Switch (Uhlenbrock too)

both same..

Am Mo., 15. Nov. 2021 um 15:42 Uhr schrieb Paul Melnikov < @.***>:

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?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/positron96/LocoNetControlStation/issues/11#issuecomment-968977683, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRDILGWW3L3JOUXTZTBOG3UMEL3ZANCNFSM5HSKRWWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

positron96 commented 2 years ago

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 commented 2 years ago

No, at this moment i have no turnout decoders on DCC. The IB Switch is just for Loconet. There can Loconet addresses can set for switch anything as example turnouts. But it will get no answers on plug on the loconet interface as it does if i use a other loconet command station as you can see on top (dump).

Am Mo., 15. Nov. 2021 um 15:59 Uhr schrieb Paul Melnikov < @.***>:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/positron96/LocoNetControlStation/issues/11#issuecomment-968994506, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRDILCXTKKINRU32CEV3BTUMEN6NANCNFSM5HSKRWWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

positron96 commented 2 years ago

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 commented 2 years ago

ah now i understand. is there any way to implement it to get it near to a full support command station like that? Am 15. Nov. 2021, 16:37 +0100 schrieb Paul Melnikov @.***>:

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. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

conaito commented 2 years ago

just to make sure.. on the other command station setup also no DCC decoders attached Am 15. Nov. 2021, 16:37 +0100 schrieb Paul Melnikov @.***>:

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. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

positron96 commented 2 years ago

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 commented 2 years ago

Can you may give me a small start idea with code to know where i can go on ? This would really be great

Am Di., 16. Nov. 2021 um 04:17 Uhr schrieb Paul Melnikov < @.***>:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/positron96/LocoNetControlStation/issues/11#issuecomment-969775089, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRDILEW3PNVITBLOWNL66DUMHELLANCNFSM5HSKRWWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

positron96 commented 2 years ago

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 commented 2 years ago

Closing in favor of #16