Re: Mantis and MB86A16 (VP-1034) and DiseqC commands not working.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zoilo Gomez schreef:
Hi Michel,

Michel Verbraak wrote:
Zoilo Gomez schreef:
I am also at loss now ....

Michel: can you confirm that DiSEqC is working for you using the Mantis driver? Are you 100% that it is DiSEqC that is doing the work, and not some conventional compatibility function like 18/13V+22kHz etc (which initially fooled me to believe that DiSEqC was working)?

Manu: a couple of emails ago, you wrote that you were puzzled how the code could ever have worked, and came up with some changes ... ? What I made from this is that you had found some quirks in the register settings (but perhaps i completely misunderstood you).

Looks like I must go and borrow an oscilloscope somehow, so I can measure what is going on at the coax level ...


The driver does send diseqc commands. Because I control my rotor with DiseqC 1.2 gotox commands. Have a look at my gotox program. I posted a bit earlier about it. It uses the dvb api which is in dvb-apps at linuxtv.org

So I understand that what you are saying is that your driver is sending DiSEqC commands, *but you are not using them, so you cannot sure that they work*, correct?

Instead you are controlling your rotor with a separate program, that is not using the Mantis driver, correct?

No, my gotox program is using an API and the API is using the Mantis driver to send out the DiseqC message. I also have another program which does not use the API but talks directly to the Mantis driver. It talks to the /dev/dvb/adapter0/frontend0 device with ioctl calls. The following is an example:

int TDVBSDevice::SendRotorMoveCommand(float angle)
{
    int ret = 0;
    struct dvb_diseqc_master_cmd diseqc_message;
    int integer = (int) angle;
    uint8_t data[] = { 0xE0, 0x31, 0x6e, 0x00, 0x00};

    // transform the fraction into the correct representation
    int fraction = (int) (((angle - integer) * 16.0) + 0.9) & 0x0f;
    switch(fraction) {
    case 1:
    case 4:
    case 7:
    case 9:
    case 12:
    case 15:
        fraction--;
        break;
    }

    // generate the command
    if (integer < 0.0) {
        data[3] = 0xD0;  // West is a negative angle value
    } else if (integer >= 0.0) {
        data[3] = 0xE0;  // East is a positive angle value
    }
    integer = abs(integer);
    data[3] |= ((integer / 16) & 0x0f);
    integer = integer % 16;
    data[4] |= ((integer & 0x0f) << 4) | fraction;

    diseqc_message.msg_len = 5;
    memcpy(diseqc_message.msg, data, 5);

    ret = ioctl(vfrontendfd, FE_DISEQC_SEND_MASTER_CMD, &diseqc_message);
    if (ret == -1)
        syslog(LOG_ERR, "rotor_goto_bearing: IOCTL failed");
        else
      ret = 0;

    return ret;
}

I really use the Mantis driver and as you can see I specify the complete DiseqC command, see uint8_t data[] = { 0xE0, 0x31, 0x6e, 0x00, 0x00};,  to send not the driver. The example above is the same as used by the API internally.

Michel
Z.

_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux