From tony.p.lee at gmail.com Fri May 8 02:25:06 2009 From: tony.p.lee at gmail.com (Tony Lee) Date: Thu, 7 May 2009 17:25:06 -0700 Subject: [PythonCE] Is there a script that would let me do this? Message-ID: <470b63970905071725o333a62c2i53a241a7367ca141@mail.gmail.com> I installed pythonce on my WM6. It works good! I wonder if there is a simple script that can act as a console that takes input from the port (telnet) and output the data to the port also. Like a io redirection, so I can just telnet to the WM6 to do script development instead of typing on the tiny keyboard. From adam.walley at gmail.com Fri May 8 10:31:26 2009 From: adam.walley at gmail.com (Adam Walley) Date: Fri, 8 May 2009 09:31:26 +0100 Subject: [PythonCE] Is there a script that would let me do this? In-Reply-To: <470b63970905071725o333a62c2i53a241a7367ca141@mail.gmail.com> References: <470b63970905071725o333a62c2i53a241a7367ca141@mail.gmail.com> Message-ID: <518d94ee0905080131g58729adbg3d7be7d19200377a@mail.gmail.com> Hello, Tony. Glad to hear PythonCE works well on WM6. I think there is a Python telnetlib module, but have not used it myself - you may need to write something to get it to do what you want. Perhaps there is also an SSH module that works on PythonCE? Alternatively, you could use the CERDisp utility. It provides a remote display of your mobile device on a laptop or workstation, but it also provides remote control (i.e. what you type on your *large keyboard* appears on your mobile device's screen). This utility works reasonably well, but I have found it to be a little unstable (eventually it will fall over and you will need to reset the device). I personally use the FreeFloat FTP server to transfer files to my mobile device. I write my code so that each function contains Python and PythonCE variants (the sys.platform value tells Python which version of the code to use). Good luck and let us know what you find. Adam 2009/5/8 Tony Lee > I installed pythonce on my WM6. It works good! > > > I wonder if there is a simple script that can act as a console that > takes input from the port (telnet) and output the data to the port > also. > > Like a io redirection, so I can just telnet to the WM6 to do script > development instead of typing on the tiny keyboard. > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > -------------- next part -------------- An HTML attachment was scrubbed... URL: From theller at ctypes.org Fri May 8 12:01:52 2009 From: theller at ctypes.org (Thomas Heller) Date: Fri, 08 May 2009 12:01:52 +0200 Subject: [PythonCE] Is there a script that would let me do this? In-Reply-To: <470b63970905071725o333a62c2i53a241a7367ca141@mail.gmail.com> References: <470b63970905071725o333a62c2i53a241a7367ca141@mail.gmail.com> Message-ID: Tony Lee schrieb: > I installed pythonce on my WM6. It works good! > > > I wonder if there is a simple script that can act as a console that > takes input from the port (telnet) and output the data to the port > also. > > Like a io redirection, so I can just telnet to the WM6 to do script > development instead of typing on the tiny keyboard. I have developed a python 'remote-console' for windows ce. It requires that the device is connected via ActiveSync. http://code.google.com/p/ctypes-stuff/ Download the files from http://ctypes-stuff.googlecode.com/svn/trunk/wince/remote-console/ and start 'python console.py' on your PC. -- Thanks, Thomas From theller at ctypes.org Fri May 8 12:16:36 2009 From: theller at ctypes.org (Thomas Heller) Date: Fri, 08 May 2009 12:16:36 +0200 Subject: [PythonCE] Is there a script that would let me do this? In-Reply-To: References: <470b63970905071725o333a62c2i53a241a7367ca141@mail.gmail.com> Message-ID: Thomas Heller schrieb: > Tony Lee schrieb: >> I installed pythonce on my WM6. It works good! >> >> >> I wonder if there is a simple script that can act as a console that >> takes input from the port (telnet) and output the data to the port >> also. >> >> Like a io redirection, so I can just telnet to the WM6 to do script >> development instead of typing on the tiny keyboard. > > I have developed a python 'remote-console' for windows ce. It requires > that the device is connected via ActiveSync. > > http://code.google.com/p/ctypes-stuff/ > > Download the files from > http://ctypes-stuff.googlecode.com/svn/trunk/wince/remote-console/ > and start 'python console.py' on your PC. > Update: I posted a prebuilt binary here (no installation needed, simply run the exe): http://ctypes-stuff.googlecode.com/files/PythonConsole-1.0.exe -- Thanks, Thomas From tony.p.lee at gmail.com Fri May 8 18:59:29 2009 From: tony.p.lee at gmail.com (Tony Lee) Date: Fri, 8 May 2009 09:59:29 -0700 Subject: [PythonCE] PythonCE Digest, Vol 69, Issue 1 In-Reply-To: References: Message-ID: <470b63970905080959w68406c3raa50a6bd4183fda1@mail.gmail.com> Found this reference in http://markmail.org/message/cqi5g3b5ct3763fq Tried it and it worked beautifully. Love Python..... Now need to see if the bluetooth works. BTW, I am using Samsung's blackjack 2. > > Hello, Tony. > > Glad to hear PythonCE works well on WM6. I think there is a Python telnetlib > module, but have not used it myself - you may need to write something to get > it to do what you want. Perhaps there is also an SSH module that works on > PythonCE? > > Alternatively, you could use the CERDisp utility. It provides a remote > display of your mobile device on a laptop or workstation, but it also > provides remote control (i.e. what you type on your *large keyboard* appears > on your mobile device's screen). This utility works reasonably well, but I > have found it to be a little unstable (eventually it will fall over and you > will need to reset the device). I personally use the FreeFloat FTP server to > transfer files to my mobile device. I write my code so that each function > contains Python and PythonCE variants (the sys.platform value tells Python > which version of the code to use). > Good luck and let us know what you find. > > Adam > > > 2009/5/8 Tony Lee > >> I installed pythonce on my WM6. It works good! >> From adam.walley at gmail.com Sat May 9 11:00:55 2009 From: adam.walley at gmail.com (Adam Walley) Date: Sat, 9 May 2009 10:00:55 +0100 Subject: [PythonCE] PythonCE Digest, Vol 69, Issue 1 In-Reply-To: <470b63970905080959w68406c3raa50a6bd4183fda1@mail.gmail.com> References: <470b63970905080959w68406c3raa50a6bd4183fda1@mail.gmail.com> Message-ID: <518d94ee0905090200g468b24e3w8e62befc3a2b63f7@mail.gmail.com> Nice find. Will check it out. Adam 2009/5/8 Tony Lee > Found this reference in > > http://markmail.org/message/cqi5g3b5ct3763fq > > Tried it and it worked beautifully. Love Python..... > > Now need to see if the bluetooth works. > > BTW, I am using Samsung's blackjack 2. > > > > > Hello, Tony. > > > > Glad to hear PythonCE works well on WM6. I think there is a Python > telnetlib > > module, but have not used it myself - you may need to write something to > get > > it to do what you want. Perhaps there is also an SSH module that works on > > PythonCE? > > > > Alternatively, you could use the CERDisp utility. It provides a remote > > display of your mobile device on a laptop or workstation, but it also > > provides remote control (i.e. what you type on your *large keyboard* > appears > > on your mobile device's screen). This utility works reasonably well, but > I > > have found it to be a little unstable (eventually it will fall over and > you > > will need to reset the device). I personally use the FreeFloat FTP server > to > > transfer files to my mobile device. I write my code so that each function > > contains Python and PythonCE variants (the sys.platform value tells > Python > > which version of the code to use). > > Good luck and let us know what you find. > > > > Adam > > > > > > 2009/5/8 Tony Lee > > > >> I installed pythonce on my WM6. It works good! > >> > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rebirth at orcon.net.nz Sun May 17 22:43:46 2009 From: rebirth at orcon.net.nz (David McNab) Date: Mon, 18 May 2009 08:43:46 +1200 Subject: [PythonCE] very slow XMLRPCServer Message-ID: <1242593026.5651.11.camel@rebirth> Hi, I'm trying to run an XML-RPC server on my ipaq h4100, based on the python 'SimpleXMLRPCServer', but it's ridiculously slow to process requests. Turnaround for even the simplest client requests is around 30-40 seconds. Can anyone suggest a cause and maybe a remedy? (source code to test program below) Thanks if you can help Cheers David ----------------------- from SimpleXMLRPCServer import SimpleXMLRPCServer def add(x, y): """add(x, y): returns the result of adding x to y""" return x + y class MyXmlRpcServer(SimpleXMLRPCServer): def __init__(self, *args, **kw): SimpleXMLRPCServer.__init__(self, allow_none=1, *args, **kw) self.running = 1 def serve_forever(self): while self.running: self.handle_request() def stop(self): """stop(): stops the server""" self.running = 0 server = MyXmlRpcServer(("", 8000)) server.register_function(add) server.register_function(server.stop) server.register_introspection_functions() server.serve_forever() From theller at ctypes.org Mon May 18 21:06:47 2009 From: theller at ctypes.org (Thomas Heller) Date: Mon, 18 May 2009 21:06:47 +0200 Subject: [PythonCE] very slow XMLRPCServer In-Reply-To: <1242593026.5651.11.camel@rebirth> References: <1242593026.5651.11.camel@rebirth> Message-ID: David McNab schrieb: > Hi, > > I'm trying to run an XML-RPC server on my ipaq h4100, based on the > python 'SimpleXMLRPCServer', but it's ridiculously slow to process > requests. > > Turnaround for even the simplest client requests is around 30-40 > seconds. I don't know if this will help you or not: I tried to use XMLRPC betweem a small embedded ARM system runing linux and a Windows PC. The performance of a client on the PC and a server on the embedded system was acceptable (~10 requests per second), but the server on the PC called by a client running on the embedded system was unacceptable: 1 request took around 5 seconds to complete. I have since switched to jsonrpc instead of xmlrpc which has a much better performance: around 70 requests per second, in both directions. Thomas From warren.lindsey at gmail.com Mon May 18 23:17:31 2009 From: warren.lindsey at gmail.com (Warren Lindsey) Date: Mon, 18 May 2009 16:17:31 -0500 Subject: [PythonCE] very slow XMLRPCServer In-Reply-To: References: <1242593026.5651.11.camel@rebirth> Message-ID: <841e880a0905181417o43c184ebk4e331c504b9236fb@mail.gmail.com> Sounds like this might be dns related. If the server is doing reverse lookups (and subsequent timeouts) for every incoming connection it can be quite slow. You might want to add local entries the registry on the ipaq for hostname lookups. Windows mobile/ce doesn't have an /etc/hosts file, but it does support an equiv feature in the registry. There was a tool I used to have and I thought it was call ceHosts to update entries, but I'm not finding it in a quick google search. I did however find a link to a tip on updating the registry directly http://windowsmobilepro.blogspot.com/2006/04/etchosts-file-equivalent-in-windows.html Obviously, the same should be done on the server to ensure ip lookups on your ipaq device are fast as well. Even if you're connecting by ip address, the client or server in a tcpip environment may do a reverse lookup on connections. Cheers, Warren On Mon, May 18, 2009 at 2:06 PM, Thomas Heller wrote: > David McNab schrieb: >> Hi, >> >> I'm trying to run an XML-RPC server on my ipaq h4100, based on the >> python 'SimpleXMLRPCServer', but it's ridiculously slow to process >> requests. >> >> Turnaround for even the simplest client requests is around 30-40 >> seconds. > > I don't know if this will help you or not: > > I tried to use XMLRPC betweem a small embedded ARM system runing linux > and a Windows PC. ?The performance of a client on the PC and a server on > the embedded system was acceptable (~10 requests per second), but the > server on the PC called by a client running on the embedded system was unacceptable: > 1 request took around 5 seconds to complete. > > I have since switched to jsonrpc instead of xmlrpc which has a > much better performance: around 70 requests per second, in both > directions. > > Thomas > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > From rebirth at orcon.net.nz Tue May 19 13:06:20 2009 From: rebirth at orcon.net.nz (David McNab) Date: Tue, 19 May 2009 23:06:20 +1200 Subject: [PythonCE] very slow XMLRPCServer In-Reply-To: <841e880a0905181417o43c184ebk4e331c504b9236fb@mail.gmail.com> References: <1242593026.5651.11.camel@rebirth> <841e880a0905181417o43c184ebk4e331c504b9236fb@mail.gmail.com> Message-ID: <1242731180.7080.20.camel@rebirth> On Mon, 2009-05-18 at 16:17 -0500, Warren Lindsey wrote: > Sounds like this might be dns related. If the server is doing reverse > lookups (and subsequent timeouts) for every incoming connection it can > be quite slow. Thanks for the lead. Turns out that was exactly the problem. The address_string() method in BaseHTTPRequestHandler does a .getfqdn with each logging call. I worked around it by overriding .log_message(). Result is that my XML-RPC filesystem is now working, and I can now 'mount' my iPaq into my Linux filesystem via WLAN. Cheers David From rebirth at orcon.net.nz Wed May 20 12:41:48 2009 From: rebirth at orcon.net.nz (David McNab) Date: Wed, 20 May 2009 22:41:48 +1200 Subject: [PythonCE] Bluetooth examples? Message-ID: <1242816108.3980.19.camel@rebirth> Hi, Does anyone have any examples of Bluetooth programming for PocketPC in Python? Specifically I'm wanting to write a PocketPC python program to: - discover nearby bluetooth devices - connect to one of these - send and receive data - close the connection Cheers David From renesd at gmail.com Wed May 20 12:52:30 2009 From: renesd at gmail.com (=?ISO-8859-1?Q?Ren=E9_Dudfield?=) Date: Wed, 20 May 2009 20:52:30 +1000 Subject: [PythonCE] Bluetooth examples? In-Reply-To: <1242816108.3980.19.camel@rebirth> References: <1242816108.3980.19.camel@rebirth> Message-ID: <64ddb72c0905200352w52e8b581j121a76d56beafef4@mail.gmail.com> hello... After a little googling I found this... http://mail.python.org/pipermail/pythonce/2007-January/001747.html If you do figure out a way please let me know... I'd probably find this useful too :) cu, On Wed, May 20, 2009 at 8:41 PM, David McNab wrote: > Hi, > > Does anyone have any examples of Bluetooth programming for PocketPC in > Python? > > Specifically I'm wanting to write a PocketPC python program to: > - discover nearby bluetooth devices > - connect to one of these > - send and receive data > - close the connection > > Cheers > David > > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rebirth at orcon.net.nz Thu May 21 06:49:56 2009 From: rebirth at orcon.net.nz (David McNab) Date: Thu, 21 May 2009 16:49:56 +1200 Subject: [PythonCE] Bluetooth examples? In-Reply-To: <64ddb72c0905200352w52e8b581j121a76d56beafef4@mail.gmail.com> References: <1242816108.3980.19.camel@rebirth> <64ddb72c0905200352w52e8b581j121a76d56beafef4@mail.gmail.com> Message-ID: <1242881396.4404.0.camel@rebirth> On Wed, 2009-05-20 at 20:52 +1000, Ren? Dudfield wrote: > hello... > > After a little googling I found this... > http://mail.python.org/pipermail/pythonce/2007-January/001747.html > > If you do figure out a way please let me know... I'd probably find > this useful too :) FWICT the best approach would be to trawl through the bluetooth API docs in MSDN (maybe starting somewhere like http://msdn.microsoft.com/en-us/library/ms898944.aspx), then port a couple of the example programs from C/C++ to python using ctypes. This is a lot of work, to get past all the 'surprises' and come up with some robust working code. If anyone can help with a shortcut, please let us know. Cheers David From tech_dev at wildintellect.com Sun May 24 23:24:07 2009 From: tech_dev at wildintellect.com (Alex Mandel) Date: Sun, 24 May 2009 14:24:07 -0700 Subject: [PythonCE] [Fwd: Re: Bluetooth examples?] Message-ID: <4A19BAF7.6080403@wildintellect.com> Looks like I forgot to send to the list -------- Original Message -------- As far as I remember on PPC it's treated as a serial device, and if you trigger to open that device (Usually COM7) it will use the built-in discovery and connect tools. So this code should work, I'm pretty sure I used it with a bluetooth gps. http://www.siafoo.net/library/23 Alex Ren? Dudfield wrote: > hello... > > After a little googling I found this... > http://mail.python.org/pipermail/pythonce/2007-January/001747.html > > If you do figure out a way please let me know... I'd probably find this > useful too :) > > > cu, > > > On Wed, May 20, 2009 at 8:41 PM, David McNab wrote: > >> Hi, >> >> Does anyone have any examples of Bluetooth programming for PocketPC in >> Python? >> >> Specifically I'm wanting to write a PocketPC python program to: >> - discover nearby bluetooth devices >> - connect to one of these >> - send and receive data >> - close the connection >> >> Cheers >> David >> >> >> >> _______________________________________________ >> PythonCE mailing list >> PythonCE at python.org >> http://mail.python.org/mailman/listinfo/pythonce >> > > > ------------------------------------------------------------------------ > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce From marcg666 at gmail.com Wed May 27 18:56:07 2009 From: marcg666 at gmail.com (Marc Grondin) Date: Wed, 27 May 2009 13:56:07 -0300 Subject: [PythonCE] Issuing WM_COMMAND Message-ID: <66160ce50905270956j29ba38c9tdc41654fee9d9915@mail.gmail.com> Hello everyone, I'm fairly new to python and pythonce and i have a quaetion. Is it possibble to issue WM_COMMANDS on a WM device using pythonCE?(i have ver 2.5 from october) -- C-ya Later Take Care Marc Grondin -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.delattre at telecom-bretagne.eu Thu May 28 05:22:26 2009 From: alexandre.delattre at telecom-bretagne.eu (Alexandre Delattre) Date: Thu, 28 May 2009 05:22:26 +0200 Subject: [PythonCE] Issuing WM_COMMAND In-Reply-To: <66160ce50905270956j29ba38c9tdc41654fee9d9915@mail.gmail.com> References: <66160ce50905270956j29ba38c9tdc41654fee9d9915@mail.gmail.com> Message-ID: <000101c9df43$867e8050$937b80f0$@delattre@telecom-bretagne.eu> Hello Marc, It is possible to send WM_COMMAND messages with pythonce, using ctypes to interface native win32 Functions: from ctypes import * SendMessage = cdll.coredll.SendMessageW WM_COMMAND = 0x111 SendMessage(hwnd, WM_COMMAND, wparam, lparam) You can wrap other functions with ctypes to get the hwnd of the window you want. Hope it helps, Alex De : pythonce-bounces+alexandre.delattre=telecom-bretagne.eu at python.org [mailto:pythonce-bounces+alexandre.delattre=telecom-bretagne.eu at python.org] De la part de Marc Grondin Envoy? : mercredi 27 mai 2009 18:56 ? : pythonce at python.org Objet : [PythonCE] Issuing WM_COMMAND Hello everyone, I'm fairly new to python and pythonce and i have a quaetion. Is it possibble to issue WM_COMMANDS on a WM device using pythonCE?(i have ver 2.5 from october) -- C-ya Later Take Care Marc Grondin -------------- next part -------------- An HTML attachment was scrubbed... URL: From rebirth at orcon.net.nz Sun May 31 13:08:31 2009 From: rebirth at orcon.net.nz (David McNab) Date: Sun, 31 May 2009 23:08:31 +1200 Subject: [PythonCE] Using serial ports Message-ID: <1243768111.20583.2.camel@rebirth> Hi, I'm able to open COM1: serial port with the usual file() function, and write to it with the normal write() method. But how do I set the speed and other line parameters? If I try to import the 'tty' module it complains that there's no 'termios' module. Also, I tried the 'ceserial.py' module which has popped up on some discussions, but it crashes in its Serial.open() method with a most unhelpful exception string '50'. What's the best way to go about using serial ports in pythonce? Thanks in advance for your help Cheers David From MichaelWack at gmx.net Sun May 31 19:45:08 2009 From: MichaelWack at gmx.net (Michael Wack) Date: Sun, 31 May 2009 19:45:08 +0200 Subject: [PythonCE] ceserial switch off problem Message-ID: <4A22C224.2060300@gmx.net> Hi all, I'm using the ceserial module of Ben McBride. Everything is working great (Thanks to the author!) as long as I do not switch off my PDA (Pocket Loox N560, WM5). Switching off the device while my pythonce program is running causes the serial port to stop working. After restarting the program the serial port works as expected again. I tried to find a workaround. Tried to catch SerialException to close and reopen the serial port. I also integrated a manual function that allows to close the port before switching off. Even deleting and recreating the serial object doesn't help. Does anyone have an idea how to reestablish serial communication after reactivating the PDA without restarting the whole pythonce program? Thanks a lot for any answer! Sincerely, Michael From rebirth at orcon.net.nz Sun May 31 23:27:34 2009 From: rebirth at orcon.net.nz (David McNab) Date: Mon, 01 Jun 2009 09:27:34 +1200 Subject: [PythonCE] Using serial ports In-Reply-To: <1243768111.20583.2.camel@rebirth> References: <1243768111.20583.2.camel@rebirth> Message-ID: <1243805254.4198.12.camel@rebirth> On Sun, 2009-05-31 at 23:08 +1200, David McNab wrote: > Also, I tried the 'ceserial.py' module which has popped up on some > discussions, but it crashes in its Serial.open() method with a most > unhelpful exception string '50'. More info on that: Seems that Serial.open() gets a bad return code when it calls windll.coredll.SetupComm() to set the buffer sizes. If I comment out the exception, then self._configurePort crashes with the same exception. I'm trying to open COM1: on an h4350. Can anyone please shed some light. Thanks David