Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2008

    Sending Screenshots over USB


    So far this board has been a great help for me in starting pys60 even without having to post any questions myself!
    I hope you might also have an idea for a solution of the problem I'm having now.

    I'm simple trying to take Screenshots on my S60 (3rd Ed.) phone and then sending them to my PC over USB.

    Here is what I do now:
    1. Send a command from the PC to the phone to take a Screenshot
    2. Create a Screenshot with the help of the graphics module and save it to the phone
    3. Open that file and send it's content to the PC over USB (with pys60usb) splitted in several packages of equal (small) size.

    That's working fine so far. I'm getting good quality Screenshots in a reasonable amount of time.

    Here is my problem:
    When I start trying to take Screenshots from outside the Python shell (meaning: putting the shell to the background and then triggering the phone to take the screen) the script constantly crashes giving an error message quoting a line where I send my data and an KErrCancel.

    Here is what I tried so far:
    1. Delaying/Slowing down the whole transfer - not working
    2. Reducing/Increasing the size of the packages I send - not working
    3. Tried putting the whole thing in a Daemon process like in the example on the wiki here - not working

    It's for several reasons not possible for me to simply switch to Bluetooth transfer.
    So I'm actually stuck with pys60usb.

    Is there any difference in the connection handling depending on the current status of the app (foreground or background)?

    Is there any other point I might be missing?

    Does anyone have any idea how to solve this?

    If any more information is needed please let me know!

    Thanks in advance!


  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Ahmedabad, Gujarat, India

    Re: Sending Screenshots over USB

    Hi sven
    welcome to the pys60 community of forum nokia.
    i feel you havent gone through the envy module to put your application in the background or foreground please have a look at this article for the same.

    Enjoy Pythoning

  3. #3
    Registered User
    Join Date
    Jul 2008
    Bhavnagar (India)

    Re: Sending Screenshots over USB

    hi yourdarkside,
    i thing Gragi is right. once you impliment envy module then the problem should not persist.
    Envy is mainly used to prevent closing/exiting/aborting the python/application
    Last edited by ck.umraliya; 2008-09-18 at 11:12. Reason: suplement content
    - Chintan Umraliya

  4. #4
    Registered User
    Join Date
    Sep 2008

    Re: Sending Screenshots over USB


    Thanks for the quick answers!

    I just installed the envy module on the phone and added the example source in the beginning of my script.

    It correctly prints the version and set_app_system(1) works fine either. First he prints the 0 then the 1.

    Anyway it's still not possible for me to send the complete Screenshot.

    Maybe there's need for a little more explanation here.

    I can send the capture Screen command from my PC to the phone. This is received correctly and the script actually starts sending the data I requested.
    Somewhere in the middle (doesn't seem to be the same point everytime) it then crashes with the error mentioned in my earlier post. This just happens when the script is in the background, no matter if it's send there by appswitch or by hand.

    When I send the shell to the background, bring it back up again and then take the screenshot it doesn't crash.
    I can even take multiple screenshots in a row without a problem as long as I'm in the shell.


  5. #5
    Registered User
    Join Date
    Sep 2008

    Re: Sending Screenshots over USB

    Hi everyone!

    I didn't find another way so I worked around the problem like this:
    1. Hide the app
    2. take the screen
    3. show the app again and send the screenshot

    If anyone has a better idea please let me know!


Similar Threads

  1. Replies: 35
    Last Post: 2009-04-11, 14:36
  2. sending sms throgh a gsm phone connected to a pc thru usb
    By deepu56 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2008-06-11, 10:13
    By herat007 in forum General Messaging
    Replies: 3
    Last Post: 2008-01-16, 04:38
  4. Sending SMS from Java Desktop Client using Nokia E70 connected to USB port
    By pasachi in forum Feedback - Nokia Developer Services & Infrastructure
    Replies: 0
    Last Post: 2007-10-31, 10:06
  5. Sending AT commands to USB Port
    By shanprabu in forum PC Suite API and PC Connectivity SDK
    Replies: 2
    Last Post: 2004-06-15, 02:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts