gnupic: Thread: Re: [gnupic] GPSim Socket Interface


[<<] [<] Page 1 of 2 [>] [>>]
Subject: Re: [gnupic] GPSim Socket Interface
From: "Scott Dattalo" ####@####.####
Date: 24 Jul 2006 04:04:06 +0100
Message-Id: <60252.71.139.5.150.1153710114.squirrel@ruckus.brouhaha.com>

> Hi every body,
>
> Does anyone know a project that is using GPSim using its Socket interface
> ?
> I have not found any project on the WEB. SCOTT confirmed that the socket
> interface is working correctly, and I tried to get it working in JAVA but
> without success (I tried under Win32) :-(
>
> Any help arround that or any info about any wrapper for GPSim (in any prog
> language) will be very helpful.
>
> Please, help :-|

Sometime back in January of this year I disabled the socket interface. The
reason was that gpsim caused Windows to emit a warning about a malicious
or suspicious program or something along those lines. I think the proper
way to fix this warning is to inhibit the socket interface by undefining
'HAVE_SOCKETS' in the makefile.mingw (or defining it if you want it
built).

Anyway, once you build gpsim with the socket interface enabled, then you
should be able to run the Python examples in the examples/scripts/
directory. Read the README there. Let me know if you have anymore
questions and I'll try to respond in less than 4 days this time!


Scott
Subject: Re: [gnupic] GPSim Socket Interface
From: "Scott Dattalo" ####@####.####
Date: 24 Jul 2006 04:11:05 +0100
Message-Id: <60276.71.139.5.150.1153710365.squirrel@ruckus.brouhaha.com>

I wrote:

> Anyway, once you build gpsim with the socket interface enabled, then you
> should be able to run the Python examples in the examples/scripts/
> directory. Read the README there. Let me know if you have anymore
> questions and I'll try to respond in less than 4 days this time!

I should've also pointed out that I did check some code into SVN that
allows the socket stuff to work. I only tested the code on Linux though.
If you're using Linux, then you have to build gpsim with sockets enabled:

 ./configure --enable-sockets

Scott
Subject: RE: [gnupic] GPSim Socket Interface
From: "octal works" ####@####.####
Date: 24 Jul 2006 05:51:34 +0100
Message-Id: <20060724045126.9F15C251D0@smtp5-g19.free.fr>

Thank you Scott, I'll try that and keep you informed about the result.
Best regards
Octal

-----Message d'origine-----
De : Scott Dattalo ####@####.#### 
Envoyé : lundi 24 juillet 2006 05:06
À : ####@####.####
Objet : Re: [gnupic] GPSim Socket Interface


I wrote:

> Anyway, once you build gpsim with the socket interface enabled, then you
> should be able to run the Python examples in the examples/scripts/
> directory. Read the README there. Let me know if you have anymore
> questions and I'll try to respond in less than 4 days this time!

I should've also pointed out that I did check some code into SVN that
allows the socket stuff to work. I only tested the code on Linux though.
If you're using Linux, then you have to build gpsim with sockets enabled:

 ./configure --enable-sockets

Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####

Subject: Re: [gnupic] GPSim Socket Interface
From: Borut Razem ####@####.####
Date: 24 Jul 2006 11:06:58 +0100
Message-Id: <44C49BC0.7030102@siol.net>

gpsimWin32 snapshot builds are from now on built with sockets enabled.
http://gpsim.sourceforge.net/snapshots/win32/gpsim-0.21.12-pre-20060724-setup.exe

Borut


octal works wrote:
> Thank you Scott, I'll try that and keep you informed about the result.
> Best regards
> Octal
>
> -----Message d'origine-----
> De : Scott Dattalo ####@####.#### 
> Envoyé : lundi 24 juillet 2006 05:06
> À : ####@####.####
> Objet : Re: [gnupic] GPSim Socket Interface
>
>
> I wrote:
>
>   
>> Anyway, once you build gpsim with the socket interface enabled, then you
>> should be able to run the Python examples in the examples/scripts/
>> directory. Read the README there. Let me know if you have anymore
>> questions and I'll try to respond in less than 4 days this time!
>>     
>
> I should've also pointed out that I did check some code into SVN that
> allows the socket stuff to work. I only tested the code on Linux though.
> If you're using Linux, then you have to build gpsim with sockets enabled:
>
>  ./configure --enable-sockets
>
> Scott
>   
Subject: Re: [gnupic] GPSim Socket Interface
From: "octaloctal" ####@####.####
Date: 24 Jul 2006 12:16:31 +0100
Message-Id: <011201c6af12$97a71720$5701000a@sidexa.blr>

Thank you very much Borut,
I have had success in connecting to GPSIM. Now I have to write a JavaWrapper 
arround some classes (in files Protocol.xxx and Client_Interface;xxx).
Once finished I think I'll have a fully working wrapper that will let me 
connect and do simulations (step by step) to GPSim correctly.
oufffffffffff....; lot of work :(   ...; :)
Best regards and thank you again.
Octal

----- Original Message ----- 
From: "Borut Razem" ####@####.####
To: ####@####.####
Sent: Monday, July 24, 2006 12:06 PM
Subject: Re: [gnupic] GPSim Socket Interface


> gpsimWin32 snapshot builds are from now on built with sockets enabled.
> http://gpsim.sourceforge.net/snapshots/win32/gpsim-0.21.12-pre-20060724-setup.exe
>
> Borut
>
>
> octal works wrote:
>> Thank you Scott, I'll try that and keep you informed about the result.
>> Best regards
>> Octal
>>
>> -----Message d'origine-----
>> De : Scott Dattalo ####@####.#### Envoyé : lundi 24 juillet 
>> 2006 05:06
>> À : ####@####.####
>> Objet : Re: [gnupic] GPSim Socket Interface
>>
>>
>> I wrote:
>>
>>
>>> Anyway, once you build gpsim with the socket interface enabled, then you
>>> should be able to run the Python examples in the examples/scripts/
>>> directory. Read the README there. Let me know if you have anymore
>>> questions and I'll try to respond in less than 4 days this time!
>>>
>>
>> I should've also pointed out that I did check some code into SVN that
>> allows the socket stuff to work. I only tested the code on Linux though.
>> If you're using Linux, then you have to build gpsim with sockets enabled:
>>
>>  ./configure --enable-sockets
>>
>> Scott
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
> 

Subject: Re: [gnupic] GPSim Socket Interface
From: "octaloctal" ####@####.####
Date: 27 Jul 2006 09:36:56 +0100
Message-Id: <008a01c6b157$cd987670$5701000a@sidexa.blr>

Hi Scott,
I tried the socket interface but it seems that GPSim response is always 
"+ACK+ACK"  ....
is the Socket interface really working ?
I have found this comment in the Script folder :

/*
  Scripting

  client.cc - a program to demonstrate gpsim scripting.

  The purpose of this program is to demonstrate how one might write a
  script to perform regression testing on an algorithm. In this
  example, the algorithm is one that squares an 8-bit number. It is
  implemented in the PIC source code gensquares.asm.

  The scripting mechanism is implemented on top of a socket
  interface. When gpsim is started, it will act as a server and began
  listening to clients. This client will initiate the communication
  link. It probably goes with out saying, but gpsim needs to be
  running before this client script will even work!

  Once this client establishs a communication link, it will proceed to
  set up the simulation environment and perform a regression test.

  Technical details:

  The scripting interface is implemented with a gpsim specific
  protocol. This protocol is somewhat analogous to gdb's
  protocol. gpsim's protocol operates in two modes. In one mode,
  character strings are sent across the socket interface and sent
  through the command line parser. Thus, it's possible to issue any
  gpsim command through a socket that can be typed at the command
  line. As of this writing, this interface is only uni-directional
  though. In other words, the client can only issue commands, but
  can't see the response. However, the other mode of the protocol
  allows bi-directional communication. This other mode ties directly
  into gpsim symbols and attributes.

  In the attribute mode of the protocol, there are two ways to
  interface to the symbols. The first is by symbol name and the second
  is by a 'handle'. For either one of these, it's possible to read and
  write symbols. Handles are more efficient since they only have to be
  processed only one. Accessing by name on the other hand, requires
  string processing and symbol table accesses.

*/


and this one in the readme file there :
"NOTE: As of this writing, the Python scripts are not working!"

Are the Python scripts really working or not ?
can I use the socket interface Bidirectionnaly to issue command or must I 
rewrite a wrapper arround the classes in files Protocol.xxx and 
Client_Interface;xxx ???
best regards
Octal  ####@####.####
http://www.pocketmt.com the mcuStudio home :)



----- Original Message ----- 
From: "octaloctal" ####@####.####
To: ####@####.####
Sent: Monday, July 24, 2006 1:16 PM
Subject: Re: [gnupic] GPSim Socket Interface


> Thank you very much Borut,
> I have had success in connecting to GPSIM. Now I have to write a 
> JavaWrapper arround some classes (in files Protocol.xxx and 
> Client_Interface;xxx).
> Once finished I think I'll have a fully working wrapper that will let me 
> connect and do simulations (step by step) to GPSim correctly.
> oufffffffffff....; lot of work :(   ...; :)
> Best regards and thank you again.
> Octal
>
> ----- Original Message ----- 
> From: "Borut Razem" ####@####.####
> To: ####@####.####
> Sent: Monday, July 24, 2006 12:06 PM
> Subject: Re: [gnupic] GPSim Socket Interface
>
>
>> gpsimWin32 snapshot builds are from now on built with sockets enabled.
>> http://gpsim.sourceforge.net/snapshots/win32/gpsim-0.21.12-pre-20060724-setup.exe
>>
>> Borut
>>
>>
>> octal works wrote:
>>> Thank you Scott, I'll try that and keep you informed about the result.
>>> Best regards
>>> Octal
>>>
>>> -----Message d'origine-----
>>> De : Scott Dattalo ####@####.#### Envoyé : lundi 24 juillet 
>>> 2006 05:06
>>> À : ####@####.####
>>> Objet : Re: [gnupic] GPSim Socket Interface
>>>
>>>
>>> I wrote:
>>>
>>>
>>>> Anyway, once you build gpsim with the socket interface enabled, then 
>>>> you
>>>> should be able to run the Python examples in the examples/scripts/
>>>> directory. Read the README there. Let me know if you have anymore
>>>> questions and I'll try to respond in less than 4 days this time!
>>>>
>>>
>>> I should've also pointed out that I did check some code into SVN that
>>> allows the socket stuff to work. I only tested the code on Linux though.
>>> If you're using Linux, then you have to build gpsim with sockets 
>>> enabled:
>>>
>>>  ./configure --enable-sockets
>>>
>>> Scott
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ####@####.####
>> For additional commands, e-mail: ####@####.####
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
> 

Subject: Re: [gnupic] GPSim Socket Interface
From: "Scott Dattalo" ####@####.####
Date: 27 Jul 2006 15:37:01 +0100
Message-Id: <60185.71.139.0.13.1154009808.squirrel@ruckus.brouhaha.com>

On Thu, 2006-07-27 at 10:36 +0200, octaloctal wrote:
Hi Scott,
> I tried the socket interface but it seems that GPSim response is always
> "+ACK+ACK"  ....
> is the Socket interface really working ?
> I have found this comment in the Script folder :

Open up two terminal windows and have them pointing to the same
directory. In one window, run gpsim:

 $ gpsim -i

The '-i' means interactive, as in 'no gui'.

In the other window run the executable created from client.cc:

 $ ./client


Now, in the first window you'll see something like:


**gpsim>  SourceSink accepting new client connect
FIXME:  HLL files are not supported at the moment
**gpsim> 0: 16f84 Execution at start(0x0)
remove socket link command
 closing link with handle 0x10000
remove socket link command
 closing link with handle 0x20001
remove socket link command
 closing link with handle 0x30002


And in the other you'll see:


$ ./client
connected with socket 3
Send sock=3 data:$F5020Dsim.verbosity0300000000
Send sock=3 rx data:$
Send sock=3 data:$F00205counterbosity0300000000
Send sock=3 rx data:$0300010000
Send sock=3 data:$F00204x_loterbosity0300000000
Send sock=3 rx data:$0300020001
<snip>
Send sock=3 rx data:$
Send sock=3 data:$F5020Dsim.verbosity0300000001
Send sock=3 rx data:$
The simulation passed!

(and looking at this output I see there's a null terminated string
issue).

It's important that gpsim and the script are in the same
directory. You may be able to get around this by either telling gpsim
the path to use for loading files or by giving a full path name to the
load command.

Scott
Subject: RE: [gnupic] GPSim Socket Interface
From: "octal works" ####@####.####
Date: 29 Jul 2006 12:42:17 +0100
Message-Id: <20060729114213.7C82153B71@smtp4-g19.free.fr>

Hi Scott,
Thanks, but what I was saying is that to use GPSim we MUST reimplement all
the functions that are in Protocole.xxx and Client_Interface.xxx
Client.cc example relays on these files.
Best regards

-----Message d'origine-----
De : Scott Dattalo ####@####.#### 
Envoyé : jeudi 27 juillet 2006 16:17
À : ####@####.####
Objet : Re: [gnupic] GPSim Socket Interface

On Thu, 2006-07-27 at 10:36 +0200, octaloctal wrote:
Hi Scott,
> I tried the socket interface but it seems that GPSim response is always
> "+ACK+ACK"  ....
> is the Socket interface really working ?
> I have found this comment in the Script folder :

Open up two terminal windows and have them pointing to the same
directory. In one window, run gpsim:

 $ gpsim -i

The '-i' means interactive, as in 'no gui'.

In the other window run the executable created from client.cc:

 $ ./client


Now, in the first window you'll see something like:


**gpsim>  SourceSink accepting new client connect
FIXME:  HLL files are not supported at the moment
**gpsim> 0: 16f84 Execution at start(0x0)
remove socket link command
 closing link with handle 0x10000
remove socket link command
 closing link with handle 0x20001
remove socket link command
 closing link with handle 0x30002


And in the other you'll see:


$ ./client
connected with socket 3
Send sock=3 data:$F5020Dsim.verbosity0300000000
Send sock=3 rx data:$
Send sock=3 data:$F00205counterbosity0300000000
Send sock=3 rx data:$0300010000
Send sock=3 data:$F00204x_loterbosity0300000000
Send sock=3 rx data:$0300020001
<snip>
Send sock=3 rx data:$
Send sock=3 data:$F5020Dsim.verbosity0300000001
Send sock=3 rx data:$
The simulation passed!

(and looking at this output I see there's a null terminated string
issue).

It's important that gpsim and the script are in the same
directory. You may be able to get around this by either telling gpsim
the path to use for loading files or by giving a full path name to the
load command.

Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####


Subject: RE: [gnupic] GPSim Socket Interface
From: "Scott Dattalo" ####@####.####
Date: 30 Jul 2006 03:09:39 +0100
Message-Id: <60041.71.139.1.184.1154225183.squirrel@ruckus.brouhaha.com>

> Hi Scott,
> Thanks, but what I was saying is that to use GPSim we MUST reimplement all
> the functions that are in Protocole.xxx and Client_Interface.xxx
> Client.cc example relays on these files.

This is true; if you're planning on implementing a client-side interface
then your client must know how to speak the language, i.e. the protocol.
If you choose to use a language other than the one provided, then you're
going to have to write the protocol layer. I see two options; 1)
reimplement the code  or 2) write a SWIG wrapper. Since we're only talking
about a small amount of code I'd opt for option 1.

BTW, what is it that you're trying to accomplish?

Scott
Subject: RE: [gnupic] GPSim Socket Interface
From: "octal works" ####@####.####
Date: 30 Jul 2006 08:03:18 +0100
Message-Id: <20060730070231.7FFD622575@smtp6-g19.free.fr>

Thank you Scott. I'll reimplement the code manually because learning SWIG
needs time and I have to much to do. I just managed some hours by week to
enhance my dev environment and I would like to integrate GPSim to have
simulation and source level debugging.
Best regards
Ahmed

-----Message d'origine-----
De : Scott Dattalo ####@####.#### 
Envoyé : dimanche 30 juillet 2006 04:06
À : ####@####.####
Objet : RE: [gnupic] GPSim Socket Interface

> Hi Scott,
> Thanks, but what I was saying is that to use GPSim we MUST reimplement all
> the functions that are in Protocole.xxx and Client_Interface.xxx
> Client.cc example relays on these files.

This is true; if you're planning on implementing a client-side interface
then your client must know how to speak the language, i.e. the protocol.
If you choose to use a language other than the one provided, then you're
going to have to write the protocol layer. I see two options; 1)
reimplement the code  or 2) write a SWIG wrapper. Since we're only talking
about a small amount of code I'd opt for option 1.

BTW, what is it that you're trying to accomplish?

Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####

[<<] [<] Page 1 of 2 [>] [>>]


Powered by ezmlm-browse 0.20.