Menu

C# error "KO_RADIO_TRANSMISSION_FAILURE"

olivSdg
2013-04-19
2013-04-19
  • olivSdg

    olivSdg - 2013-04-19

    I'm using sample provided in C# with these librairies updated (files get from forum) :
    Com.Coronis.Sdk.Domain.dll, Com.Coronis.Sdk.Protocol.Api.dll, Com.Coronis.Sdk.Protocol.Waveport.dll

    I'm not able to communicate with WaveFlow water meter, communication throw Bluetooth WapePort seems to be Ok (blue led flashing).
    You can see my actual trace :

    19/04/2013 - 15:53:28: process local node service: start
    15:53: process local service status: OK_PROTOCOL_SUCCESS
    19/04/2013 - 15:53:28: process local node service response: 510013634B304627;STACK_SERVICE
    19/04/2013 - 15:53:28: process send request: start
    19/04/2013 - 15:53:33 - 15:53:33: process send request exception: Unknown protocol error occured with code (61) : KO_RADIO_TRANSMISSION_FAILURE
    19/04/2013 - 15:53:33: process send message: start
    19/04/2013 - 15:53:36: process send message exception: Unknown protocol error occured with code (61) : KO_RADIO_TRANSMISSION_FAILURE
    Pres <enter> to quit</enter>

    What I'm using in code to connect to WaveFlow "00534-07-03200724" :

    private static IRadioAddress destinationAddress = new RadioAddress("21607A30D6D4");
    ...
    private static IPayload payload = new Payload("01");

    .
    Do you know why I get this error ?

    PS : I didn't read anywhere that libpthread-2.dll is needed for driver to work correctly. I downloaded it because driver was not working. Maybe it can be usefull to inform user about this library.

    Thanks.

     
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2013-04-19

    Thanks for the libpthread-2.dll. It's mention in serialdriver, but not in protocol.

    Concerning your problem, can you add a serialdriver spy listener and return me the trace:
    Your error means that the radio transmission between your radio modem and your waveflow fails. Your communication with your Waveport is OK because the local node service request test is OK.

    Serial driver spy listener Class definition

    public class SerialDriverSpyListener : ISerialDriverSpyListener
    {
        private String tag = "";
    
        public SerialDriverSpyListener() { }
    
        public SerialDriverSpyListener(String tag)
            : base()
        {
            this.tag = tag;
        }
    
        public void ReceivedFrame(ISerialFrame receivedFrame)
        {
            StringBuilder sb = new StringBuilder(tag + " - Received Spy frame: ");
            sb.Append(receivedFrame.ToString());
            Console.Out.WriteLine(TestsGeneric.printCurrentDate() + sb.ToString());
        }
    
        public void SentFrame(ISerialFrame sentFrame)
        {
            StringBuilder sb = new StringBuilder(tag + " - Spy send frame: ");
            sb.Append(sentFrame.ToString());
            Console.Out.WriteLine(TestsGeneric.printCurrentDate() + sb.ToString());
        }
    }
    

    Serial driver spy usage

    RS232Driver sd = new RS232Driver();
    sd.AddSerialDriverSpyListener(new SerialDriverSpyListener());
    ...
    Waveport wp = new Waveport();
    wp.SetSerialDriverInstance(sd);
    ...
    
     

    Last edit: Thierry CHOMAUD 2013-04-19
  • olivSdg

    olivSdg - 2013-04-19

    Trace :

    19/04/2013 - 16:48:13: - Received Spy frame: 400600
    19/04/2013 - 16:48:13: - Spy send frame: 4100
    19/04/2013 - 16:48:14: - Received Spy frame: 400700
    19/04/2013 - 16:48:14: - Spy send frame: 4100
    19/04/2013 - 16:48:14: - Received Spy frame: 400E03
    19/04/2013 - 16:48:14: - Spy send frame: 4100
    19/04/2013 - 16:48:14: process local node service: start
    19/04/2013 - 16:48:14: - Received Spy frame: 5005
    19/04/2013 - 16:48:14: - Spy send frame: 510013634B304627
    16:48: process local service status: OK_PROTOCOL_SUCCESS
    19/04/2013 - 16:48:14: process local node service response: 510013634B304627;STACK_SERVICE
    19/04/2013 - 16:48:14: process send request: start
    19/04/2013 - 16:48:14: - Received Spy frame: 400600
    19/04/2013 - 16:48:14: - Spy send frame: 4100
    19/04/2013 - 16:48:14: - Received Spy frame: 400700
    19/04/2013 - 16:48:14: - Spy send frame: 4100
    19/04/2013 - 16:48:15: - Received Spy frame: 400900
    19/04/2013 - 16:48:15: - Spy send frame: 4100
    19/04/2013 - 16:48:15: - Spy send frame: 2100
    19/04/2013 - 16:48:15: - Received Spy frame: 2021607A30D6D401
    19/04/2013 - 16:48:19: - Spy send frame: 310101
    19/04/2013 - 16:48:19 - 16:48:19: process send request exception: Unknown protocol error occured with code (61) : KO_RADIO_TRANSMISSION_FAILURE
    19/04/2013 - 16:48:19: process send message: start
    19/04/2013 - 16:48:19: - Received Spy frame: 400600
    19/04/2013 - 16:48:19: - Spy send frame: 4100
    19/04/2013 - 16:48:19: - Received Spy frame: 400700
    19/04/2013 - 16:48:19: - Spy send frame: 4100
    19/04/2013 - 16:48:19: - Received Spy frame: 400900
    19/04/2013 - 16:48:19: - Spy send frame: 4100
    19/04/2013 - 16:48:19: - Spy send frame: 2100
    19/04/2013 - 16:48:19: - Received Spy frame: 2221607A30D6D401
    19/04/2013 - 16:48:22: process send message exception: Unknown protocol error occured with code (61) : KO_RADIO_TRANSMISSION_FAILURE
    19/04/2013 - 16:48:24: - Spy send frame: 310101
    Pres <enter> to quit</enter>

     
  • Thierry CHOMAUD

    Thierry CHOMAUD - 2013-04-19

    After the send of 2021607A30D6D401, you receive 310101, that confirm that the device @21607A30D6D4 has not been found.
    But I think you have a error in your hexadecimal conversion of radio address. "00534-07-03200724" -> "02160730D6D4".

    Here a java code for radio@ translation:

    long decimalAddress = xxxx;
    String decimalRadioAdressAll = new Long(decimalAddress).toString();
    String hexaAddress = null;
    if (decimalRadioAdressAll.length()<=15) {
    decimalRadioAdressAll = String.format("%15s", decimalRadioAdressAll);
    decimalRadioAdressAll = decimalRadioAdressAll.replace(" ", "0");
    try {
        long decimalFirstPart = Long.parseLong(decimalRadioAdressAll.substring(0, 5));
        long decimalSecondPart = Long.parseLong(decimalRadioAdressAll.substring(5, 7));
        long decimalThirdPart = Long.parseLong(decimalRadioAdressAll.substring(7, 15));
    
        String hexaFirstPart = String.format("%4s", Long.toHexString(decimalFirstPart));
        hexaFirstPart = hexaFirstPart.replace(" ", "0");
        String hexaSecondPart = String.format("%2s", Long.toHexString(decimalSecondPart));
        hexaSecondPart = hexaSecondPart.replace(" ", "0");
        String hexaThirdPart = String.format("%6s", Long.toHexString(decimalThirdPart));
        hexaThirdPart = hexaThirdPart.replace(" ", "0");
        hexaAddress = hexaFirstPart + hexaSecondPart + hexaThirdPart;
    } catch (Exception e) {
        throw new IllegalArgumentException("format exception (15 decimal characters)");
    
    }
    } else {
    throw new IllegalArgumentException("format exception (15 decimal characters)");
    }
    

    Another possibility is directly to use following constructor for radioAddress:

    RadioAddress(long decimalAddress)
    
     

    Last edit: Thierry CHOMAUD 2013-04-19
  • olivSdg

    olivSdg - 2013-04-19

    Thanks a lot, I made a mistake
    I didn't understand correctly radio adress conversion.
    It's now working good, I got response from WaveFlow.

    C# radio conversion :

    private static String getHexAdress(long decimalAddress)
    {
        String decimalRadioAdressAll = decimalAddress.ToString();
        String hexaAddress = null;
        if (decimalRadioAdressAll.Length <= 15)
        {
            decimalRadioAdressAll = decimalRadioAdressAll.PadLeft(15,'0');
            try
            {
                long decimalFirstPart = long.Parse(decimalRadioAdressAll.Substring(0, 5));
                long decimalSecondPart = long.Parse(decimalRadioAdressAll.Substring(5, 2));
                long decimalThirdPart = long.Parse(decimalRadioAdressAll.Substring(7, 8));
    
                String hexaFirstPart = decimalFirstPart.ToString("X4");
                String hexaSecondPart = decimalSecondPart.ToString("X2");
                String hexaThirdPart = decimalThirdPart.ToString("X6");
                hexaAddress = hexaFirstPart + hexaSecondPart + hexaThirdPart;
    
                Console.Out.WriteLine(DateTime.Now.ToShortDateString() + " - " + DateTime.Now.ToLongTimeString() + ": " + "Adress : " + hexaAddress);
            }
            catch (Exception e)
            {
                Console.Out.WriteLine(DateTime.Now.ToShortDateString() + " - " + DateTime.Now.ToLongTimeString() + ": " + "format exception (15 decimal characters)");
            }
        }
        else
        {
            Console.Out.WriteLine(DateTime.Now.ToShortDateString() + " - " + DateTime.Now.ToLongTimeString() + ": " + "format exception (15 decimal characters)");
        }
    
        return hexaAddress;
    }
    
     

Log in to post a comment.

MongoDB Logo MongoDB