New USB-Loconet interface

Moderator: Moderators

Re: New USB-Loconet interface

Postby Liviu M » 03.03.2014, 22:04

Hello, me again.
It seems I've fixed my interface enough to can use it with Pi (there are some timeouts during programming of the LocoIO, but I can live with them). :-A
Lets see what can I do with them. :)

Regards,
Liviu

PS Should someone be interested in testing the interface, I can post the last firmware.
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: New USB-Loconet interface

Postby Liviu M » 11.02.2015, 18:13

Hello again,
planning to rebuild my layout, I've decided to use a separate (Loconet) bus for the sensors and not more hanging them on the same bus with locs & turnouts. For that reason, I need a new Loconet interface which can not only insure the communication, but can also generate the Loconet idle (12V) voltage (I'm supplying the sensor boards with 5V).
I've combined my existing interface (the PIC18F14K50 version) with a DCDC converter (based on the well known MC34063) and a 10 mA current source, resulting a "stand alone" interface.
Right now I'm posting just a picture of the prototype (my interface, actually). Should someone be interested *), I can post the schematic/firmware/whatever...

Regards,
Liviu
*) As always, this interface is almost untested (I've ported the code from Microchip's C18 to the XC8 also), but seems to work good, even on Raspi (as the old one, it gives some echo errors from time to time).
You do not have the required permissions to view the files attached to this post.
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: New USB-Loconet interface

Postby Liviu M » 11.04.2015, 13:34

Hi all,

The today's version of firmware allowed me to use the raspberry & my interfaces almost without any lost message in some short tests - increasing and decreasing the speed of a loc by keeping the up/down arrows on the keyboard pressed and by repeatedly reading/programming an 8In2Ln input interface (similar to MGV50).
Odroid c1 & same interfaces loose no messages at all.
For that reason, I'm uploading the new schematic (for the interface in the picture above, with integrated current source) and the new firmwares for all three controllers (the above one and the old schematics with PIC18F4550 & PIC18F2550 posted in this topic).
Because the microchip stopped the support for the PIC18F4550/2550, I'm continuing the development/"support" for the PIC18F14F50 or newer controllers (supported by microchip in the mla libraries). Should someone be interested in the interface, I recommend the use of the attached schematic (with or without the current source part).
One feature I've implemented in the new interface and not in the old ones is the serial number, which allows me to use the udev rules to differentiate two or more interfaces connected to the same linux computer.

Best regards,
Liviu

LE The attached firmware for the PIC18F14K50 has the "00000" as ID.
You do not have the required permissions to view the files attached to this post.
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: New USB-Loconet interface

Postby Richard-TX » 12.04.2015, 05:12

What I have always wanted was a Loconet decoder/controller for the Raspberry Pi. Listening on a TCP port, it would take loconet commands and then translate that to Peter's I2C based accessories. Compared to the limited bandwidth of traditional Loconet serial communications, it should be much faster.
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: New USB-Loconet interface

Postby Liviu M » 12.04.2015, 06:11

I don't like to much the i2c approach because of the polling method. I don't have any reasonable motivation, it seems the Peter's accessories are working well, but...
In the same time, I have a quite small layout. :)
I was thinking about making some tests with my Loconet boards at faster baud rates, though. Unfortunately I forgot where I've put the time machine...
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: New USB-Loconet interface

Postby Richard-TX » 12.04.2015, 14:23

Interrupt processing is always possible but it would require making your own peripheral boards. Some I2C devices don't generate interrupts.

Polling works, is reliable and quick even when written in python.

Interrupts just aren't possible with things like ADCs. There are things like hysteresis and threshold to take into consideration.

I was initially opposed to polling but Rob proved me wrong. :D

I have several Rpi and BBB computers scattered around my layout. I use SRCP as the communications protocol between the SBCs (single board computers) and Rocrail.
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: New USB-Loconet interface

Postby cvalder » 13.04.2015, 07:49

Richard-TX wrote:What I have always wanted was a Loconet decoder/controller for the Raspberry Pi. Listening on a TCP port, it would take loconet commands and then translate that to Peter's I2C based accessories. Compared to the limited bandwidth of traditional Loconet serial communications, it should be much faster.


Hello Richard,
isn't GCA101 what you are looking for? It can be used as a Loconet controller for Raspi. I've done it successfully and can control locos with Freds connected via Loconet to MGV101, connected via Ethernet to Raspi (running Rocrail and Rocnet), connected via USB + serial adapter ORD-5 to booster ORD-3 (DCC232), connected with the layout.

Kind regards
Christian.
Viele Grüße
Christian
[Rocrail - RocNet] [MGV Hardware - Flüsterantriebe - Digital-Bahn] [Windows - Raspian - Ubuntu - OS X] [FREMO H0fine]
cvalder
 

Re: New USB-Loconet interface

Postby Richard-TX » 13.04.2015, 14:48

No, the gca101 is not what I am looking for. What I am looking for is some software that runs on the Rpi.
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: New USB-Loconet interface

Postby rjversluis » 13.04.2015, 15:44

Hi Richard,
Richard-TX wrote:What I have always wanted was a Loconet decoder/controller for the Raspberry Pi. Listening on a TCP port, it would take loconet commands and then translate that to Peter's I2C based accessories. Compared to the limited bandwidth of traditional Loconet serial communications, it should be much faster.

Thats not a big deal, but why using LocoNet instead of RocNet?
The protocol is from Digitrax which already wrote me emails to push me to licence LocoNet... :(
And LocoNet over LAN with UDP does not make sense because you do not need an 8bit start byte and 7bit data bytes. For a serial connection this is one of the best ways to detect the start of a packet but useless with UDP.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: New USB-Loconet interface

Postby Richard-TX » 13.04.2015, 15:53

It was just one of those things that I thought would be interesting to play with.

7 bit data doesn't bother me.

Rocnet is good protocol. It just isn't used outside of Rocrail.
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: New USB-Loconet interface

Postby rjversluis » 13.04.2015, 15:56

Hi Richard,

I could add this LocoNet Protocol to RocNetNode as secondary communication option on another UDP broadcast port.
But for configuring the I/O RocNet is also needed.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: New USB-Loconet interface

Postby rjversluis » 13.04.2015, 16:01

LocoNet is too restricted in commands so you can only use a small set of RocNetNode possibilities.
But why using other software? You already have Rocrail.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: New USB-Loconet interface

Postby Richard-TX » 13.04.2015, 16:10

I wouldn't add loconet to rocnetnode Rob. It really serves no useful purpose.

A standalone daemon is all I need with some basic decoding. A write to a syslog that a given message has been received and decoded is good enough. Once I have a working listener, then I can figure out what else is needed.
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: New USB-Loconet interface

Postby Richard-TX » 14.04.2015, 12:35

Now that I have had a chance to think about Loconet for a while I think that I am going to remove Loconet from my layout and replace it with Rocnet or Rocpi. I see no advantage to it over Rocnet. I went with Loconet at the time as Rocnet and Rocpi was not even thought of. Rocnet or Rocpi does everything that I need.

Can anyone think of any reason to keep Loconet?
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: New USB-Loconet interface

Postby rjversluis » 14.04.2015, 12:39

Richard-TX wrote:Can anyone think of any reason to keep Loconet?

If you have lots of existing LocoNet equipment?
LocoNet communicates serial with a speed of 16K which was OK 20 years ago. Digitrax did not upgrade there concept...
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

PreviousNext

Return to DIY Hardware