element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Copying my main.cpp from Raspberry onto any Editor.
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 11 replies
  • Answers 1 answer
  • Subscribers 666 subscribers
  • Views 1209 views
  • Users 0 members are here
  • raspberry
  • raspberry_pi
Related

Copying my main.cpp from Raspberry onto any Editor.

Former Member
Former Member over 9 years ago

Hi, This is Asif, and I am new into the coding world. I have been working on a project, which requires me to optimize someone else's code As i am new to this, i have been facing some really basic problems. So, I got my raspberry pi connected. i can read all the files in the directory(in which the code is written), and also managed to read the main.cpp in the LX-Terminal. However i want to copy this code from raspberry pi(LX terminal) to some other kind of editor. which i can open and refer/read on any platform i am working on.(phone/desktop). Could you please let me know how could i possibly do this. and if its possible.

  • Sign in to reply
  • Cancel
  • shabaz
    0 shabaz over 9 years ago

    Hi Asif,

     

    You could use a USB memory stick to do the transfer, but a popular way is to just use your network connection. For most computers (including Windows or Mac) there is software that performs something known as 'SSH' that is advisable to get familiar with using, and 'SFTP. Together they provide the ability to work remotely, and to transfer files. On windows, one popular version of SSH software is called 'PuTTY' and it is a free download. For the SFTP element (sometimes it is combined in the same piece of software) you could investigate WinSCP (I've not used it - but google for 'SFTP Raspberry Pi' to find tutorials).

    SFTP will allow you to transfer files back and forth between your PC and the

    Raspberry Pi. If you google for PuTTY, SFTP and Raspberry Pi you'll find tutorials to

    help you with all that.

    SSH and SFTP are ideal if your PC and the Raspberry Pi are on the same network - additional effort is needed to work across the internet, such as if your PC and Raspberry Pi are separated at different locations like school and home.

    Yet another method is to place your code on a cloud platform, e.g. github. Then you can

    download it from anywhere, on any device.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 9 years ago

    Why not using a code sharing online so you can edit from everywhere and download the last version when ready ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago

    Share it if not confidential. I may help you to optimize. Also inform platform at you are working.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to Former Member

    i cannot share, as it is confidential. However i appreciate the Help image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to shabaz

    Thanks. That was a really helpful answer, i would try transferring it using SFTP. Its just that, now I have to see what SFTP exactly is.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 9 years ago in reply to Former Member

    If you're on a Windows PC, you could try Notepad++ - I just tried it, and it seems quite easy to use, it uses the built-in SFTP functionality inside it.

     

    After I installed Notepad++, I then followed the instructions here:

    http://www.cssbakery.com/2012/04/using-notepad-to-edit-files-on-server.html

    (the only difference I did was to select the 'initial remote directory' to be /home/pi )

     

    When you run it, you can connect to the Raspberry Pi by clicking the icon that is called "(Dis)Connect" in the NppFTP pane, and you'll see the files on the Raspberry Pi listed.

    When you double-click any of them, they will open up in the editor. When you hit 'save' it will save them back onto the RPI, but you can do a local save to your PC by going to 'Save As'.

    Also, if you have any file already open in the editor (i.e. any file on your PC, you can transfer it by pressing the 'Upload' button in the NppFTP pane.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to shabaz

    Sorry, i got the exact mistake, i actually cannot establish the connection between the two, after i click that Dis(Connect) pane on the window, it doesnt connect to my raspberry.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 9 years ago in reply to Former Member

    The screenshot below shows my settings, yours needs to look something similar.

    You can confirm if your raspberry pi is reachable by typing 'ping xx.xx.xx.xx' in a

    Windows command prompt first (where xx.xx.xx.xx is the IP address of your

    Raspberry Pi). If the ping is not successful, then there is a network related issue.

    The ping should always be your first test to ensure that you have reachability.

     

    Bear in mind, this won't (usually) work if the only path between you and the Raspberry Pi is the public Internet. Where is your Raspberry Pi and PC located - in the same physical location?

    image

     

    This is what the ping output could look like, your addressing will be different:

    image

    (Type ipconfig /all if you're unsure what network connection is in use on your PC). You can see that my PC is on the same network (192.168.1.xx) as the Raspberry Pi.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jack.chaney56
    0 jack.chaney56 over 9 years ago

    Presuming you are using a Pi B, B+, or 2, and not an A or A+, and you have a keyboard and mouse plugged in, and possibly a WI-FI dongle, that should leave you with one USB connector.  I suggest using the sneaker-net solution and plug a USB drive into the a free USB port on the PI and doing a drag and drop of the file(s).

     

    If you are in need of a more shared solution, you could set up your Pi as a Samba server, and copy any shared files into the Samba directory, then pick them up from the other PC as a shared directory.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to shabaz

    Thanks for all the help. I finally got it. I was doing one stupid mistake, my laptop and my raspberry pi were not on same network. thats why it didnt connect

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube