DCC LocoNet interface issues on transmit

FYI, personally I am not a fan of the 'get a lock' concept.
Do you see the message "Setup Complete"?

Not a very expensive breakout board, so was nice to get something prebuilt.

The maker of the board did a video of a simple usage.

Regarding the voltage, he says that the board was designed to work with 3.3V but that his experience is that it has worked with all 5V Uno and Nano processors.
There is one library modification that we needed to make which he goes over in the video which is the uncommenting of the library definitions for LN_SW_UART_RX_INVERTED and LN_SW_UART_TX_INVERTED.
Just to check I've also gone back and reversed the changes but still hit the same issues.

The "setup complete" message comes out ok.
And it then makes it into the loop() ok as well.
Even all of my work with the shift registers to read in and sample the sensors works ok and when I display to the serial monitor actually work perfectly.
Just then once it makes it past the logic of that a sensor has changed state for long enough and tries to transmit then it hangs.
I thought my sensor logic was going to be the part causing me problems not the transmit :slight_smile:

The interesting thing is that if the cable is unplugged it works.
Which is why I think maybe a conflict with something else going on in the network at the time or something about how the library has implemented the protocol to deal with existing traffic.

I am VERY suspicious of any statement that says designed to work with 3.3V but in HIS experience also works with 5V. That is where I would start. Either replace that device with a 5V device, or switch to one of the 3.3V boards like a member of the NANO 33 family. Maybe the NANO 33 IoT so eventually you can control from the cloud?

If you can try this code on a small as possible layout in order to reduce or eliminate the effects of (large) scale would be a plus.

1 Like

I want you to edit your libraries copy (it's local to you, no concerns, just do NOT allow any auto updates) to enable DEBUG. In your libraries/LocoNet/LocoNet.cpp make the following change, from this


to this
Screenshot 2025-02-11 at 13.38.15
that will help a lot, but if not conclusive there is also the following
from

to

If we can't figure it out after that, then I am probably stumped.
Have a go at looking at the serial output to see if it's obvious but if not, post everything you have in the serial log to a reply so I can look.

1 Like

Thanks for the info.
I'll try out those debug flags.
Any information to provide observations within the library will be good.

We've also got some email threads now going with the creator of the library and also the builder of the breakout board.
Working all angles :slight_smile:
Hopefully that should lead to something.
If we do get an answer I'll be sure to post it back here so that anyone else hitting similar issues will hopefully get some insight.

1 Like

The creator of the library ran some tests and for them everything was working ok using the identical breakout board.
We are going to try running our tests again going back and ensuring that everything is done the same way.
If that doesn't work then we are either dealing with an defect in our breakout board or something about our specific LocoNet layout that is interfering with it.
We'll try some tests with stripping down our LocoNet layout to just the minimal requirements (command station and our device) to see if that works and if it does then we'll start adding things back in one at a time.

Some good news for us.
We went back to basics using a simple test sketch that does receive and transmits.
This sketch was failing the same as our other ones (Could receive but not transmit).
We then decided to try and isolate things on the LocoNet to see if another device was maybe interfering.
The LocoNet has a command centre and two boosters.
We took one of the boosters off the LocoNet and then ran our test and it worked! (Receive and Transmit).
Then adding the booster back into the LocoNet we noticed that it had a loose ground wire.
Once we fixed the loose ground wire on the booster we ran our test and everything works.

So it looks like in the end our code was ok, the library was ok, the breakout board was ok but the LocoNet itself had an issue on it being caused by another device.

It appears that mystery is solved.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.