Search code examples
javaraspberry-pi2

Communication between Raspberry Pi 2 and a PC via internet


My issue is that I am trying to run a java code on my Raspberry Pi 2 that display text based on command sent from my PC (which is not in local network, or physically connected with the Raspberry Pi 2). My problem is that I did not even know where to start from!

My current attempt:

My initial idea was that I would manage to send the text to a website or via Dropbox and then it would be simple for the Raspberry Pi 2 to read this text using a simple Java code. The issue was that setting up Dropbox seems like an overkill since it is just a simple text that I want to transfer. As for reading texts from website I got stuck on how on earth can I create a dummy website where I can simply update its text content using Java code or any other program without actually opening the website or using my PC as a server.

If I am overthinking and there is a simpler solution it is definitely welcomed and appreciated :)


Solution

  • your solution is fine, i'd suggest to go with something like github or gist (something [only] you can edit).

    best solution would be if you had a webservice running on your raspberry pi, so you can send commands to it via webservice calls. (google for spring-boot simple rest service)

    e.g.: see --> here

    another option would be to have FTP running on your PI and sending the commands to a text-file on your pi via FTP.