Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Error after get_freq

Help
2007-08-19
2013-01-15
  • Petr Hlozek
    Petr Hlozek
    2007-08-19

    Hello,

    I use you component for Kylix in Lazarus. I must made some changes but, it
    compiles without problems.
    But I have a problem with get_freq or something other function.
    Here is the source:

    var
      ri : PRig;
      freq : freq_t;
      retval : Integer;
    begin
       rig_set_debug(RIG_DEBUG_VERBOSE);
       ri := rig_init(120); //ft-817
       ri^.state.rigport.pathname  := PChar('/dev/ttyUSB0');
       ri^.state.rigport.parm.serial.rate      := 9600;
       ri^.state.rigport.parm.serial.parity    := RIG_PARITY_NONE;
       ri^.state.rigport.parm.serial.data_bits := 8;
       ri^.state.rigport.parm.serial.stop_bits := 1;
       ri^.state.rigport.parm.serial.handshake := RIG_HANDSHAKE_NONE;
       retval := rig_open(ri);
       if retval = RIG_OK then
         Writeln('Riginit: ','OK')
       else
         Writeln('Riginit: ',retval);
       retval := rig_set_vfo(ri,RIG_VFO_A);
       Writeln('Retval set_vfo: ',retval);
       retval := rig_get_freq(ri,RIG_VFO_CURR,freq);
       if retval = RIG_OK then
       begin
         WriteLn('Freq ',freq);
         Writeln('Freq OK')
       end
       else
         Writeln('Retval freq: ',retval);
       rig_close(ri);
    end;

    rig_ini and rig_open is OK, but if I try rig_set_vfo return value is -11.
    Why? Could you help me? I developing new station log for Linux in
    Lazarus/Freepascal.

    Console output:

    rig_register (1601)
    rig_register (1607)
    rig_register (1608)
    rig_register (1602)
    rig_register (1603)
    rig_register (1604)
    rig_register (1605)
    rig: loading backend alinco
    alinco: _init called
    rig_register (1701)
    rig: loading backend kachina
    kachina: _init called
    rig_register (1801)
    rig: loading backend rpcrig
    rpcrig: _init called
    rig_register (1901)
    rig: loading backend gnuradio
    rig:  lt_dlopen("hamlib-gnuradio") failed (hamlib-gnuradio.so: cannot open shared object file: No such file or directory), trying static symbols...
    rig: dlsym(initrigs2_gnuradio) failed (./hamlib: undefined symbol: initrigs2_gnuradio)
    rig: loading backend microtune
    microtune: _init called
    rig_register (2101)
    rig_register (2102)
    rig: loading backend tapr
    tapr: _init called
    rig_register (2201)
    rig: loading backend flexradio
    initrigs2_flexradio called
    rig_register (2301)
    rig: loading backend rft
    rft: _init called
    rig_register (2401)
    rig: loading backend kit
    kit: _init called
    rig_register (2501)
    rig_register (2502)
    rig: loading backend tuner
    tuner: _init called
    rig_register (2601)
    rig:rig_open called
    ft817: ft817_open called
    Riginit: OK

    Retval set_vfo: -11
    Retval freq: -11
    rig:rig_close called
    ft817: ft817_close called

    Thanks for help!

    Petr

     
    • Error -11 appears to be RIG_ENAVAIL. This is strange.

      Can you increase the debug level from Kylix and post the result? This should be a call something like rig_set_debug(RIG_DEBUG_TRACE).

      By the way, does your rig works okay with rigctl for set_vfo and get_freq? Some USB cables sometimes need special options to work. See FAQ section at http://hamlib.org.

      --
      Stéphane

      PS: I'm pretty sure other people will love to use your changes for Kylix, and once your log application is working, we can put a link to it in the "Applications/ Screenshots" section of hamlib.org