Installation on Raspberry (ERROR wrong value )

Moderator: Moderators

Installation on Raspberry (ERROR wrong value )

Postby pbierhuizen » 18.01.2015, 19:47

Hello,
I have recently installed SRCPD and Rocrail server on a Raspberry Pi. Both servers seem to run properly on the Pi now.
When I start Rocrail as a client on my Macmini or on a Macbook, I can control a locdecoder with the standard address 3.
The lights and the motor do react, the response might be a bit slow.
However when I try to run a decoder with a long address ( 1800 ) nothing happens.
In the lower screen in Rocrail ( Zentrale ) I can see that some error messages are coming back from the srcpd server as soon as I activate the decoder with the long address for the first time :

Code: Select all
19:19:41 srcp response: 1421605181.084 200 OK
19:19:41 command written: SET 1 GL 1800 1 0 28 1 0 0 0 0
19:19:34 srcp response: 1421605174.904 200 OK
19:19:34 command written: SET 1 GL 1800 1 0 28 0 0 0 0 0
19:19:34 srcp response: 1421605174.876 200 OK
19:19:34 command written: SET 1 GL 1800 1 0 28 0 0 0 0 0
19:19:34 srcp response: 1421605174.738 200 OK
19:19:34 command written: SET 1 GL 1800 1 0 28 0 0 0 0 0
19:19:34 srcp response: 1421605174.710 416 ERROR no data                        <==
19:19:34 command written: GET 1 GL 1800
19:19:34 srcp response: 1421605174.691 412 ERROR wrong value                 <==
19:19:34 command written: INIT 1 GL 1800 N 1 28 5
19:19:34 srcp response: 1421605174.680 416 ERROR no data                        <==
19:19:34 command written: GET 1 GL 1800
19:14:58 srcp response: 1421604898.818 200 OK
19:14:58 command written: SET 1 GL 3 1 0 28 0 0 0 0 0

Can someone here help me find out what I am doing wrong ? I have tried modifying the variables enable_nmradcc, number_gl and nmradcc_translation_routine, in the srcpd.conf file on te Raspberry, but nothing seems to help.

Many Thanks for helpful information !
Regards,

Paul Bierhuizen
pbierhuizen
 

Re: Installation on Raspberry

Postby Richard-TX » 19.01.2015, 04:33

What do you have the number_gl set to in your srcpd.conf file? number_gl defaults to 80.

Please attach your srcpd.conf file.
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: Installation on Raspberry (ERROR wrong value )

Postby pbierhuizen » 19.01.2015, 09:43

Hello Richard,
The number_gl is currently set to 2048. I have also tried 9999, but that seems to have no effect.
Attached is my scrpd.conf file. My locomotive decoders have addresses between 1 and 8200.
Thank you for your help.
Paul Bierhuizen
You do not have the required permissions to view the files attached to this post.
pbierhuizen
 

Re: Installation on Raspberry (ERROR wrong value )

Postby Richard-TX » 19.01.2015, 16:38

your number_gl has to be set to 8201 or more

There may be some hard limits set in the source code. Try setting it to 9999 and if you then get a wrong value error, then you will have to modify the source code and recompile.
Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: Installation on Raspberry (ERROR wrong value )

Postby pbierhuizen » 19.01.2015, 19:41

Hi Richard,
I already did set number_gl in srcpd.conf on 9999 before, with the same error messages.
When I look in the source files I can see that in 'ddl.c' the variable number_gl is set to '81' ( probably the default value ).
I changed it into 9999 and recompiled everything, but the error messages remain the same.
So that was probably the wrong thing to change. My knowledge of C is not that good to understand C-programs.
Do you know what should be changed in order to get the long DCC addresses accepted ?
Regards,
Paul Bierhuizen
pbierhuizen
 

Re: Installation on Raspberry (ERROR wrong value )

Postby Richard-TX » 19.01.2015, 20:56

in ddl.c it seems that the highest number allowed is 255.

here is an excerpt and it would be where I would start. If it were me I would change the 255 to 65534.


Code: Select all
static int init_gl_DDL(gl_state_t * gl)
{
    switch (gl->protocol) {
        case 'M':              /* Motorola Codes */
            if (gl->n_func < 0 || gl->n_func > 5) return SRCP_WRONGVALUE;
            switch (gl->protocolversion) {

               // SRCP only knows 2 types of protocol versions, so the
               // ddl section was corrected, Torsten 2012-11-10

               // M1: 80 addresses, 14 drive steps, 1 function, relative
               //     drive direction
               case 1: return (gl->id >= 0 && gl->id < 80 &&
                               gl->n_fs == 14 && gl->n_func == 1) ?
                               SRCP_OK : SRCP_WRONGVALUE;

               // M2: 80 or 255 addresses, up to 28 drive steps, 5 function,
               //     absolute drive direction
               case 2: return (gl->id >= 0 && gl->id <= 255 &&
                              (gl->n_fs == 14 || gl->n_fs == 28) &&
                               gl->n_func >= 0 && gl->n_func <= 5 ) ?
                               SRCP_OK : SRCP_WRONGVALUE;

               // no support of the wikinger decoder, from now on

/* old code, can be deleted sometimes
               case 1: return (gl->id >= 0 && gl->id < 80 &&
                               gl->n_fs == 14) ?
                               SRCP_OK : SRCP_WRONGVALUE;
               case 2: return (gl->id >= 0 && gl->id <= 80 &&
                               gl->n_fs == 14) ?
                               SRCP_OK : SRCP_WRONGVALUE;
               case 3: return (gl->id >= 0 && gl->id <= 255 &&
                               gl->n_fs == 28) ?
                               SRCP_OK : SRCP_WRONGVALUE;
               case 4: return (gl->id >= 0 && gl->id <= 255 &&
                               gl->n_fs == 14) ?
                               SRCP_OK : SRCP_WRONGVALUE;
               case 5: return (gl->id >= 0 && gl->id <= 255 &&
                               gl->n_fs == 28) ?
                               SRCP_OK : SRCP_WRONGVALUE;
 end of deletable old code */

Richard
Dallas/Fort Worth
Texas USA
Richard-TX
 

Re: Installation on Raspberry (ERROR wrong value )

Postby pbierhuizen » 27.01.2015, 11:44

The problem is solved, it appeared not to be in the srcp software, but in Rocrail.
The protocol for the locdecoder was not filled in. Using protocol = 2 ( nmra dcc long ) did the job.
pbierhuizen
 


Return to srcp