"Transmit short IDs" to MulitMaus using opendcc

Bug #524578 reported by gramels
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rocrail
Fix Released
Low
Unassigned

Bug Description

taken from forum discussion http://forum.rocrail.net/viewtopic.php?p=14080

last tested on 1324 (Linux) and 1313 (Windows)

>>>
20100215.091450.890 r9999c 00000D28 OOpenDCC 0339 send short IDs to the throttle
20100215.091450.890 r9999c 00000D28 OP50x 0285 bin command
20100215.091453.921 r9999E 00000D28 OSerial 0394 Timeout on serial read[COM3] 0 of 1 read.[rc=0] tries=3
20100215.091453.921 r9999E 00000D28 OP50x 0219 ERROR in transact!!! rc=0 state=RCVERR
<<<

Hello, Lothar sent me a log file and I see the communication is somehow strange:

WRITE VCP11 SUCCESS Length 2: 78 C9 = XEvtLok
READ VCP11 SUCCESS Length 1: 80 = none
SERIAL_GET_MODEMSTATUS VCP11 SUCCESS
WRITE VCP11 SUCCESS Length 2: 78 C8 = Xevent
READ VCP11 SUCCESS Length 1: 00 = none
SERIAL_GET_COMMSTATUS VCP11 SUCCESS
SERIAL_GET_MODEMSTATUS VCP11 SUCCESS
WRITE VCP11 SUCCESS Length 9: 00 00 0C 00 00 58 4D 54 0D ....XMT<cr>
READ VCP11 SUCCESS Length 1: 00
READ VCP11 SUCCESS Length 1: 00
READ VCP11 SUCCESS Length 1: 00
READ VCP11 SUCCESS Length 1: 00
READ VCP11 TIMEOUT Length 0:
READ VCP11 TIMEOUT Length 0:
READ VCP11 TIMEOUT Length 0:
WRITE VCP11 SUCCESS Length 2: 78 A2 = Xstatus
READ VCP11 SUCCESS Length 1: 00
WRITE VCP11 SUCCESS Length 2: 78 CA = Xevntrnt
READ VCP11 SUCCESS Length 1: 00
WRITE VCP11 SUCCESS Length 2: 78 C9
READ VCP11 SUCCESS Length 1: 00

The commands during data base transfer are broken / overwritten with some illegal stuff. No wonder, that opendcc command station doesn't understand this.

br Wolfgang

Revision history for this message
Rocrail (r.j.versluis) wrote :

Cannot use this trace.
Make a byte trace with Rocrail to compare.

Changed in rocrail:
status: New → Incomplete
Rocrail (r.j.versluis)
Changed in rocrail:
importance: Undecided → Low
Revision history for this message
gramels (lothar-gramelspacher) wrote :

just call me the bug trace maker :)

Revision history for this message
gramels (lothar-gramelspacher) wrote :
Revision history for this message
Rocrail (r.j.versluis) wrote :

Implemented code:

      /* send short ID to OpenDCC */
      if( StrOp.equals( wDigInt.p50x, data->sublibname ) ) {
        /* add the loco to the data bank, or overwrite the existing */
        iONode lccmd = NodeOp.inst( wBinCmd.name(), NULL, ELEMENT_NODE );
        char* byteStr = StrOp.fmt( "x LOCADD %d,%d,DCC,%s\r", wLoc.getaddr(cmd), wLoc.getspcnt(cmd), wLoc.getshortid(cmd) );
        wBinCmd.setoutlen( lccmd, StrOp.len(byteStr) );
        wBinCmd.setinlen( lccmd, 64 );
        wBinCmd.setinendbyte( lccmd, 0x0d );
        wBinCmd.setout( lccmd, byteStr );
        StrOp.free( byteStr );
        response = data->sublib->cmd((obj)data->sublib, lccmd);
      }

Revision history for this message
Rocrail (r.j.versluis) wrote :

Fix committed in revno 1329.
No response expected for LOCADD and LOCXMT.

Revision history for this message
gramels (lothar-gramelspacher) wrote :

still get READ time out in rocrail

Revision history for this message
Rocrail (r.j.versluis) wrote :

Yes, I know why.;-)
1331.

Changed in rocrail:
status: Incomplete → Fix Committed
Revision history for this message
gramels (lothar-gramelspacher) wrote :

unfortunately not working
But I will make my poor eeePC 100 compile it again for another test (just takes 10 minutes) :)

Revision history for this message
Rocrail (r.j.versluis) wrote :

I tested the issue with a ATMEGA32 OpenDCC.
The Command send looks OK, but OpenDCC reports with:
"Bad Parameter\r]"

Try revno 1333, and report with the byte trace please.

Revision history for this message
gramels (lothar-gramelspacher) wrote :

der trace hängt an.

Beim ersten Test ging mein opendcc auf gelb blink (Programmierfehler). Dies konnte ich dann aber nicht mehr reproduzieren.

So wie es scheint wird der Befehl LOCXMT ausgefürht und dadurch opendcc aufgefordert die Daten an das Thorttle zu senden

Allerdings werden vorgängig keine Lokdaten von rocrail nach opendcc erfolgreich übermittelt. So waren dann auf meiner Multimaus die default Lokdaten aus opendcc, nicht die aus der Lokdatenbank von rocrail.

Also die vorgängigen Befehle LOCCLEAR, LOCADD wurden nicht ausgeführt.

Revision history for this message
Rocrail (r.j.versluis) wrote :

http://wiki.rocrail.net/doku.php?id=1.3:loc-gen-en#short_id

First send the LocID's to the OpenDCC CS before sending it to the throttle.

Revision history for this message
gramels (lothar-gramelspacher) wrote :

ok, I expected different behaviour in rocrail (like the opendcc config tool) were all existing loco db entries get erased and overwritten.

Anyway, I tested it, and it seems like the loco names do dont make it into the opendcc db .

Revision history for this message
Rocrail (r.j.versluis) wrote :

Hi,

can you have a look at it Wolfgang?

20100220.151854.186 r9999I cmdr0100 OLoc 1695 cmd "shortid" for Köf.
20100220.151854.187 r9999c cmdr0100 OOpenDCC 0363 XLOCADD 4958,128,DCC,DB4958
20100220.151854.187 r9999c cmdr0100 OP50x 0293 bin command: outlen=28 inlen=256
20100220.151854.187 r9999B cmdr0100 OP50x 0150 outsize=28 insize=256 inendbyte=0x0D
20100220.151854.187 r0000B cmdr0100 (null) *trace dump( 0x013B4820: length=28 )
    offset: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |ASCII...........|
    --------------------------------------------------------- |----------------|
    00000000: 58 4C 4F 43 41 44 44 20 34 39 35 38 2C 31 32 38 |XLOCADD 4958,128|
    00000010: 2C 44 43 43 2C 44 42 34 39 35 38 0D |,DCC,DB4958. |
20100220.151854.189 r9999B cmdr0100 OP50x 0191 insize=256, inendbyte=0x0D
20100220.151854.220 r9999B cmdr0100 OP50x 0198 inendbyte detected at position 13
20100220.151854.224 r0000B cmdr0100 (null) *trace dump( 0x013B4620: length=14 )
    offset: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |ASCII...........|
    --------------------------------------------------------- |----------------|
    00000000: 42 61 64 20 50 61 72 61 6D 65 74 65 72 0D |Bad Parameter. |
20100220.151854.225 r0000B cmdr0100 (null) *trace dump( 0x013B4620: length=13 )
    offset: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |ASCII...........|
    --------------------------------------------------------- |----------------|
    00000000: 42 61 64 20 50 61 72 61 6D 65 74 65 72 |Bad Parameter |

Revision history for this message
gramels (lothar-gramelspacher) wrote :

I retried it, now my opendcc (XP v0.23) started flashing yellow again.

MIght it be field length? I heve seen, that rocrail allows 6 chars, while Multimaus only does 5?

Revision history for this message
Wolfgang Kufer (kufer) wrote : Re: [Bug 524578] Re: "Transmit short IDs" to MulitMaus using opendcc

Hallo,

nachdem railcom CV-Read jetzt geht, das nächste Thema:

> I retried it, now my opendcc (XP v0.23) started flashing yellow again.

Was blinkt da? Die Prog-LED?

>
> MIght it be field length? I heve seen, that rocrail allows 6 chars,
> while Multimaus only does 5?

Nein; OpenDCC kann 10 Zeichen, erst bei der Ausgabe zur Multimaus wird auf Seiten der MM auf 5 eingekürzt. Außerdem habe ich das schon Overflow-fest programmiert (nicht dass mir einer da einen Virus drauf schaufelt ;-)

Aus dem Logging werde ich noch nicht schlau, wo sehe ich da gesendet und empfangen?

Servus Wolfgang

--
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser

Revision history for this message
Rocrail (r.j.versluis) wrote :

Hi Wolfgang,

this line is send to OpenDCC:
"XLOCADD 4958,128,DCC,DB4958<cr>"

OpenDCC responds with:
"Bad Parameter<cr>]"
because I do not have OpenDCC-XT.

Revision history for this message
gramels (lothar-gramelspacher) wrote :

Guten morgen,

manchmal (nicht immer) blinkt die gelbe prog LED. Gerade kann ich es nicht nachvollziehen.

Den Bad Parameter bekomme ich auch, hab es gerade mit 1338 nochmals ausprobiert.

Rob:
Sollte es irgendwann grundsätzlich gehen würde ich gerne noch eine Aenderung des Ablaufes vorschlagen:
Alle Locos deren IDs an openDCC throttles gesendet werden sollen, werden in der Loktabelle mit einen Haken markiert.
"Submit short IDs" löscht dann die lokdb (LOCCLEAR), sended die neue (LOCADD) und macht dann einen LOCXMT

Revision history for this message
Wolfgang Kufer (kufer) wrote :

Hi Rob,

yes, that is true: this is a bad parameter:

SPEEDSTEPS: vaild: 14, 28, 126
128 is illegal.

br Wolfgang

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

Revision history for this message
gramels (lothar-gramelspacher) wrote :

mit 126 funktioniert es dann auch.

Danke für die Hilfe. Das macht einfach Spass, so ein Projekt.

Ich würde dennoch eine Aenderung der Nutzung der LocDB in vorschlagen wie oben schon beschrieben:

Wegfall des Kontextmenues "Set short ID"
Hinzufügen eines Parameters pro Lok "Set short ID" mit Checkbox im "Generell" Reiter der Loktabelle.
Aenderung des Verhaltens von "Transmit Short ID":
löschen der locDB in openDCC: LOCCLEAR
senden aller Locs mit "Set short ID" aktiviert: LOCADD
popup "bitte die Multimaus auf Empfang setzen"
übermitteln der LocDB von opendcc and die Multimaus: LOCXMT

als Beispiel kann gut der screenshot von openDcc_config dienen:
http://www.opendcc.org/elektronik/opendcc/lok_datenbank.html

Ich schreibe dann auch gerne die Anleitung in deutsch und in englisch im Wiki dazu.

Rob, kannst Du das als "Wishlist" aufnehmen?

Revision history for this message
Rocrail (r.j.versluis) wrote :

In revno 1340 the speed steps are normalized:

static int __normalizeSteps(int insteps ) {
  /* SPEEDSTEPS: vaild: 14, 28, 126 */
  if( insteps < 20 )
    return 14;
  if( insteps > 100 )
    return 126;
  return 28;
}

The other issue is a feature request.

Changed in rocrail:
status: Fix Committed → Fix Released
Changed in rocrail:
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.