[prev in list] [next in list] [prev in thread] [next in thread] 

List:       snap
Subject:    RE: [SNAP] Problem running from statup
From:       "Christian Blixt" <christian.blixt () imsystech ! com>
Date:       2006-03-06 16:28:25
Message-ID: NCBBIMLDODFMMFCFADJBMELNFCAA.christian.blixt () imsystech ! com
[Download RAW message or body]

Hi!

Thanks for testing. So let's hope that the only error is the lack of timeout
in open(). This will be fixed to the next release.

Regards,

Christian Blixt
Tel: +46 (0)8 594 110 82
christian.blixt@imsystech.com

Imsys Technologies AB
Tel: +46 (0)8 594 110 70
Fax: +46 (0)8 594 110 89
www.imsystech.com



-----Original Message-----
From: snap-bounces@listserver.songnetworks.se
[mailto:snap-bounces@listserver.songnetworks.se]On Behalf Of Rebollo
Fernández
Sent: den 6 mars 2006 17:10
To: snap@listserver.songnetworks.se
Subject: RE: [SNAP] Problem running from statup


Hi Christian,

I've just tested your code on the SNAP 1.0.2 and it runs ok for me too.
I don't know why my application doesn't run this code when is launched from
the startup.ini file, I supose this must be produced by the startup class
loading wich introduce a delay for the serialServer stops before to open the
serial port, and this present the problem on the timeout for the serial open
methode.

Regards.

Jorge Rebollo

INDRA

Avda. Diagonal 218 - 3ª Planta
08018 - Barcelona (ESPAÑA)
Tel.: +34-93-400.58.00
Fax.: +34-93-400.54.00
jrebollo@indra.es
www.indra.es




-----Mensaje original-----
De: snap-bounces@listserver.songnetworks.se
[mailto:snap-bounces@listserver.songnetworks.se]En nombre de Rebollo
Fernández, Jordi
Enviado el: miércoles, 22 de febrero de 2006 15:23
Para: snap@listserver.songnetworks.se
Asunto: RE: [SNAP] Problem running from statup
Importancia: Alta


I understand,

When I have a bit of time I'll try your test program to look if I get some
error or it goes well like you, and I'll say something.

Refering to the delay before to open the port, I think this is not a good
solution because the startup time for the application on the SNAP is very
slow and the best option is disable the serial server on the snap.ini file.

Regards.

Jorge Rebollo

INDRA

Avda. Diagonal 218 - 3ª Planta
08018 - Barcelona (ESPAÑA)
Tel.: +34-93-400.58.00
Fax.: +34-93-400.54.00
jrebollo@indra.es
www.indra.es




-----Mensaje original-----
De: snap-bounces@listserver.songnetworks.se
[mailto:snap-bounces@listserver.songnetworks.se]En nombre de Christian
Blixt
Enviado el: miércoles, 22 de febrero de 2006 14:04
Para: snap@imsystech.com
Asunto: RE: [SNAP] Problem running from statup


Hi,

I did not say there was an error in the serial server. I just said that your
problem with opening the serial0 port _might_ be that the serial server did
not have time to release the port - and that this was because of the error
in the open() method (doesn't wait the timeout time), not because of some
error in the serial server.

I say "might" above beacuse I was unable to produce the problem here. I
wrote the test program - which I sent to you - in order to do this, but the
problem doesn't occur. I am always able to open the port, even when starting
from startup.ini.

You don't have to run my test program if you don't want to. I just thought
it might provide some more information on the otherwise unexplained fact
that you have the problem with your application, while I don't have it with
my test program. Otherwise there is nothing more I can do about this than to
hope that your problem will go away with the next firmware release, when the
timeout in open() is fixed.

You could also try to insert a delay between closing the serial server and
trying to open the port, to see if that helps.

Regards,

Christian Blixt
Tel: +46 (0)8 594 110 82
christian.blixt@imsystech.com

Imsys Technologies AB
Tel: +46 (0)8 594 110 70
Fax: +46 (0)8 594 110 89
www.imsystech.com



-----Original Message-----
From: snap-bounces@listserver.songnetworks.se
[mailto:snap-bounces@listserver.songnetworks.se]On Behalf Of Rebollo
Fernández
Sent: den 22 februari 2006 11:10
To: snap@listserver.songnetworks.se
Subject: RE: [SNAP] Problem running from statup
Importance: High


Ok Christian,

You say the second problem I have is because an error when the serial server
doesn't have enough time to release the serial port before the open()
methode fails, and the differences on starting the program from startup.ini
and a telnet session make it doesn't or do work.

All this explanation is right for me, but I don't understand because I have
to test your code to look if I get the same error like my application.
Because you say there is an error on the serial server and the process to
start from startup.ini is different to start from Java on a telnet session.

I think this test won't give me any usefull information because it looks
like the problem is on the firmware, the startup.ini execution and the
serial server.

Give me some response if I'm in error.

Jorge Rebollo

INDRA

Avda. Diagonal 218 - 3ª Planta
08018 - Barcelona (ESPAÑA)
Tel.: +34-93-400.58.00
Fax.: +34-93-400.54.00
jrebollo@indra.es
www.indra.es



-----Mensaje original-----
De: snap-bounces@listserver.songnetworks.se
[mailto:snap-bounces@listserver.songnetworks.se]En nombre de Christian
Blixt
Enviado el: martes, 21 de febrero de 2006 18:28
Para: snap@imsystech.com
Asunto: RE: [SNAP] Problem running from statup


Hi,

You are absoulutely right. The timeout to the open() method has no effect.
I've added this to the bug list.

Your other problem could perhaps be explained by this, if the serial server
for some reason doesn't have time enough to release the serial port before
the open() method fails. The differnece between starting the application
from Telnet and from startup.ini would then be small timing differences that
made it work in one case and not work in the other.

However, I've tested this using this program:

import java.lang.*;
import java.io.*;
import javax.comm.*;
import se.imsys.system.*;

public class test3
{
    static  CommPortIdentifier  m_portIdSerial;
    static  SerialPort          m_serialPort;
    static  OutputStream        m_outSerial;
    static  InputStream         m_inSerial;

    static private void ConfigurarSerialPort(int id)
    {
       /*TRACE*/ System.out.println("CTablaCOM: ConfigurarSerialPort(" + id
+ ')');

       switch (id)
       {
          case 0 :
          case 1 :
             try
             {
                String tmp = "serial" + id;

                /*TRACE*/
System.out.println("T_INI1:"+System.currentTimeMillis());

                if (id == 0)
                {
                   Ish.execute("stopserver -s");
                }

                /*TRACE*/
System.out.println("T_INI2:"+System.currentTimeMillis());

                m_portIdSerial = CommPortIdentifier.getPortIdentifier(tmp);

                /*TRACE*/
System.out.println("T_INI3:"+System.currentTimeMillis());

                if (m_portIdSerial != null)
                {
                   m_serialPort = (SerialPort) m_portIdSerial.open(tmp,
10000);

                   /*TRACE*/
System.out.println("T_END1:"+System.currentTimeMillis());
                }

                if (m_serialPort != null)
                {
                   m_serialPort.setSerialPortParams(9600,
                         SerialPort.DATABITS_8,
                         SerialPort.STOPBITS_1,
                         SerialPort.PARITY_NONE);

m_serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);

                   m_serialPort.enableReceiveTimeout(100);

                   m_inSerial = m_serialPort.getInputStream();
                   m_outSerial = m_serialPort.getOutputStream();
                }
             }
             catch (NoSuchPortException nspe)
             {
             }
             catch (PortInUseException piue)
             {
                /*TRACE*/ System.err.println("CTablaCOM:
ConfigurarSerialPort() [i] "
                /*TRACE*/  + piue.getMessage());

                System.out.println("T_END2:"+System.currentTimeMillis());
             }
             catch (UnsupportedCommOperationException ucoe)
             {
             }
             catch (IOException ioe)
             {
             }
          break;
       default :
          break;
       }
    }

    public static void main(String args[])
    {
        int     port = 0;
        byte    b;

        ConfigurarSerialPort(port);

        try {
            m_outSerial.write("Hello!\n\r".getBytes());

            //Echo incoming characters
            do {
                b = (byte)m_inSerial.read();
                if (b != -1)
                    m_outSerial.write(b);
            } while (b != 'q');

            m_inSerial.close();
            m_outSerial.close();
            m_serialPort.close();
        } catch(IOException ioe){
            System.out.println("IOException: "+ioe.getMessage());
        }
    }
}

As you can see this program is a mix between the code you supplied and our
CommEchoJavaX sample. This program works fine even if I start it from
startup.ini. I get the following output in my terminal when it's set to 9600
baud:

ü#ú7(Ò7:«#pF
è
þúV
ú°Eúú/
òúÔ þúFC~ÐVÛÿºþãÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿHello!
These characters are echoed...

The garbled characters in the beginning is the serial server outputting data
in the wrong baud rate. The last line is data that I typed in the terminal
and the program echoed. If I set the terminal to 115200 instead, I get this:

Imsys SNAP restarting @ Tue Feb 21 18:09:52 2006
Reading /system/ish.ini:     [OK]
Reading /system/snap.ini:    [OK]
Serial server:               [OK]
JVM startup:                 [OK]
Setting host name:           [OK]
TCP/IP startup:              [OK]
FTP server:                  [OK]
Telnet server:               [OK]
Setting timezone to:         GMT (DST)
Reading /system/startup.ini: [OK]


localhost.localdomain (SNAP 1.0.2, Nina)
Login: CTablaCOM: ConfigurarSerialPort(0)
T_INI1:1140541795000
<garbled characters>

..where of course the garbage at the end is output after the baudrate has
been changed by the program to 9600. If you still have problems with this,
could you try this program and see if that works?

Regards,

Christian Blixt
Tel: +46 (0)8 594 110 82
christian.blixt@imsystech.com

Imsys Technologies AB
Tel: +46 (0)8 594 110 70
Fax: +46 (0)8 594 110 89
www.imsystech.com


-----Original Message-----
From: snap-bounces@listserver.songnetworks.se
[mailto:snap-bounces@listserver.songnetworks.se]On Behalf Of Rebollo
Fernández
Sent: den 13 februari 2006 13:53
To: snap@listserver.songnetworks.se
Subject: RV: [SNAP] Problem running from statup
Importance: High


Hi again,

Doing more testing I've found the problem on the power up when is used the
startup.ini file.
It looks like the problem is because the serialServer execution, because
when I disable this server though the snap.ini file all the applications
runs ok.

I have the following methode to configure the serial0 and serial1.
static private void ConfigurarSerialPort(int id)
{
   /*TRACE*/ System.out.println("CTablaCOM: ConfigurarSerialPort(" + id +
')');

   switch (id)
   {
      case 0 :
      case 1 :
         try
         {
            String tmp = "serial" + id;

            /*TRACE*/
System.out.println("T_INI1:"+System.currentTimeMillis());

            if (id == 0)
            {
               Ish.execute("stopserver -s");
            }

            /*TRACE*/
System.out.println("T_INI2:"+System.currentTimeMillis());

            m_portIdSerial[id] = CommPortIdentifier.getPortIdentifier(tmp);

            /*TRACE*/
System.out.println("T_INI3:"+System.currentTimeMillis());

            if (m_portIdSerial[id] != null)
            {
               m_serialPort[id] = (SerialPort) m_portIdSerial[id].open(tmp,
10000);

               /*TRACE*/
System.out.println("T_END1:"+System.currentTimeMillis());
            }

            if (m_serialPort[id] != null)
            {
               m_serialPort[id].setSerialPortParams(9600,
                     SerialPort.DATABITS_8,
                     SerialPort.STOPBITS_1,
                     SerialPort.PARITY_NONE);

m_serialPort[id].setFlowControlMode(SerialPort.FLOWCONTROL_NONE);

               m_serialPort[id].enableReceiveTimeout(100);

               m_inSerial[id] = m_serialPort[id].getInputStream();
               m_outSerial[id] = m_serialPort[id].getOutputStream();
            }
         }
         catch (NoSuchPortException nspe)
         {
         }
         catch (PortInUseException piue)
         {
            /*TRACE*/ System.err.println("CTablaCOM: ConfigurarSerialPort()
[i] "
            /*TRACE*/  + piue.getMessage());

            System.out.println("T_END2:"+System.currentTimeMillis());
         }
         catch (UnsupportedCommOperationException ucoe)
         {
         }
         catch (IOException ioe)
         {
         }
      break;
   default :
      reak;
   }
}
And I've seen somthing extrange on the CommPortIdentifier.open() methode,
because if let start the serialServer from power-up and comment the line
Ish.execute("stopserver -s"); from the methode above I have the following
traces.
CTablaCOM: ConfigurarSerialPort(0)
t_ini2:1139837821564
t_ini3:1139837822972
CTablaCOM: ConfigurarSerialPort() [ii] serial port is already opened
t_fin:1139837824011
CTablaCOM: ConfigurarSerialPort(1)
t_ini2:1139837824266
t_ini3:1139837824340
t_fin:1139837824480
where you can see the methode CommPortIdentifier.open() doesn' wait the 10
seconds fixed by his parameter.

This is not right, isn't it ?
There is some problem whith the timeout for this methode ?

And what about the conflict with the serial0 configuration and the execution
from the startup.ini file ?

I'm using rigth now the SNAP 1.0.2 but when I was using the SNAP 1.0.0rc3
this code was runned ok.

Thanks.

Jorge Rebollo

Avda. Diagonal 218 - 3ª Planta
08018 - Barcelona (ESPAÑA)
Tel: +34-93-400.58.00
Fax: +34-93-400.54.00
jrebollo@indra.es
www.indra.es




-----Mensaje original-----
De: snap-bounces@listserver.songnetworks.se
[mailto:snap-bounces@listserver.songnetworks.se]En nombre de Rebollo
Fernández, Jordi
Enviado el: viernes, 10 de febrero de 2006 14:55
Para: snap@listserver.songnetworks.se
Asunto: [SNAP] Problem running from statup
Importancia: Alta


Hi,

I have an application divided on three smaller applications where the
running flow is like described
App1 - starts App2 with Ish.execute and autofinish App1
App2 - starts App3 with Ish.execute and autofinish App2
App3 - is the final application
The problem I have is when the App1 is runned from the Telnet all these are
executed ok, but when I start the App1 from the startup.ini it can't execute
the other ones and I don't now why.

How can I debug the execution to detect the problem ?
I haven't got the Imsys Developer and I can't use the debug port.

Regards.

Jorge Rebollo

Avda. Diagonal 218 - 3ª Planta
08018 - Barcelona (ESPAÑA)
Tel: +34-93-400.58.00
Fax: +34-93-400.54.00
jrebollo@indra.es
www.indra.es


----------------------------------------------------------------------------
---------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente. POR FAVOR, ANTES DE IMPRIMIR ESTE CORREO
ELECTRÓNICO CONSIDERE SU APORTACIÓN A LA CONSERVACIÓN DEL MEDIO AMBIENTE POR
LA REDUCCIÓN DE CONSUMO DE PAPEL.

The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail. PLEASE CONSIDER YOUR ENVIRONMENTAL RESPONSIBILITY BEFORE PRINTING
THIS
E-MAIL. --------------------------------------------------------------------
-----------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente. POR FAVOR, ANTES DE IMPRIMIR ESTE CORREO
ELECTRÓNICO CONSIDERE SU APORTACIÓN A LA CONSERVACIÓN DEL MEDIO AMBIENTE POR
LA REDUCCIÓN DE CONSUMO DE PAPEL.

The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail. PLEASE CONSIDER YOUR ENVIRONMENTAL RESPONSIBILITY BEFORE PRINTING
THIS E-MAIL.


_______________________________________________
Snap mailing list
snap@imsystech.com
http://www.imsystech.com/support/maillist.htm
_______________________________________________
Snap mailing list
snap@imsystech.com
http://www.imsystech.com/support/maillist.htm



_______________________________________________
Snap mailing list
snap@imsystech.com
http://www.imsystech.com/support/maillist.htm
----------------------------------------------------------------------------
---------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente. POR FAVOR, ANTES DE IMPRIMIR ESTE CORREO
ELECTRÓNICO CONSIDERE SU APORTACIÓN A LA CONSERVACIÓN DEL MEDIO AMBIENTE POR
LA REDUCCIÓN DE CONSUMO DE PAPEL.

The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail. PLEASE CONSIDER YOUR ENVIRONMENTAL RESPONSIBILITY BEFORE PRINTING
THIS E-MAIL.
_______________________________________________
Snap mailing list
snap@imsystech.com
http://www.imsystech.com/support/maillist.htm
_______________________________________________
Snap mailing list
snap@imsystech.com
http://www.imsystech.com/support/maillist.htm



_______________________________________________
Snap mailing list
snap@imsystech.com
http://www.imsystech.com/support/maillist.htm

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic