PokeyDopey
Posts: 2
Joined: Sat Oct 15, 2016 12:23 pm

Sending code via WiFi

Sat Oct 15, 2016 12:37 pm

Disclaimer: first post, sorry if this is the wrong forum area...
I'm currently working on a project where we want to make a mini rover with the Raspberry Pi 3. We're going to do all the standard add motors, add camera etc... But what we really want to implement is the ability to write code remotely. In the past when working on an AR Drone https://www.parrot.com/uk/drones/parrot ... on-details we were able to connect directly to the drone via it's WiFi which allowed us to upload and run code from a laptop.

Is this possible with the current WiFi chip that's on the Pi3? We're happy to buy an adapter if not!

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Sending code via WiFi

Sat Oct 15, 2016 7:10 pm

The WiFi doesnt really matter. What you have is a TCP/IP network connection from whatever unit to the one you want to program. But there has to be some software (or firmware) that can receive the new code and run it. It doesnt really matter if it is over ethernet, wifi or 3G/4G-data.

If you are running a Raspberry there are so many ways to achieve this. What language are you going to program your rover in ?

Edit:
- You might be thinking about "WiFi Ad-Hoc networks" where you connect wifi directly between two devices without a router or Access Point. I belive this is pretty easy to set-up regardless of wifi-adapter used.
- The alternative is to set up the Raspberry as a Access Point that others can connect to. This method might be more compatible with older smartphones which might not support Ad-Hoc mode. ( I have never used a Parrot Drone but I have a feeling this is the method used on them )
But as said above, neither of these methods give you everything you need to transfer code, but you get a TCP/IP network between two devices.
Last edited by topguy on Sat Oct 15, 2016 7:19 pm, edited 1 time in total.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Sending code via WiFi

Sat Oct 15, 2016 7:16 pm

SSH allows you to run a remote terminal.
SFTP allows you to transfer files.

The pi doesn't much like adhoc WIFI networks (can be made to work but it's a hassle) so have a WIFI hotspot at the other end (such as your phone set as wifi hotspot or a cheap combo Powerbank/WIFI hotspot).
Doug.
Building Management Systems Engineer.

PokeyDopey
Posts: 2
Joined: Sat Oct 15, 2016 12:23 pm

Re: Sending code via WiFi

Sun Oct 16, 2016 3:28 pm

topguy wrote:The WiFi doesnt really matter. What you have is a TCP/IP network connection from whatever unit to the one you want to program. But there has to be some software (or firmware) that can receive the new code and run it. It doesnt really matter if it is over ethernet, wifi or 3G/4G-data.
topguy wrote:- You might be thinking about "WiFi Ad-Hoc networks" where you connect wifi directly between two devices without a router or Access Point. I belive this is pretty easy to set-up regardless of wifi-adapter used.
- The alternative is to set up the Raspberry as a Access Point that others can connect to. This method might be more compatible with older smartphones which might not support Ad-Hoc mode. ( I have never used a Parrot Drone but I have a feeling this is the method used on them )
But as said above, neither of these methods give you everything you need to transfer code, but you get a TCP/IP network between two devices.
I've seen this "Ad-Hoc" mentioned before! The idea is we don't want to need an internet connection at all. We want to connect directly without external connections. We'll work on getting the TCP/IP connection sorted for the time being then I guess. We'll also get looking into the software/firmware necessary.
topguy wrote:If you are running a Raspberry there are so many ways to achieve this. What language are you going to program your rover in ?
We're using Python at the moment but this early in development it's possible to swap to a more suitable language.

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Sending code via WiFi

Sun Oct 16, 2016 3:38 pm

PokeyDopey wrote:The idea is we don't want to need an internet connection at all. We want to connect directly without external connections. We'll work on getting the TCP/IP connection sorted for the time being then I guess.
topguy wrote:If you are running a Raspberry there are so many ways to achieve this. What language are you going to program your rover in ?
We're using Python at the moment but this early in development it's possible to swap to a more suitable language.
Both the methods I described gives you connection without any dependency of the internet.

Usiing Python code means that you don't have to compile it before the transfer from another device. So you can transfer the file with FTP, SCP or any method you see fit.
What you would have to make is some mechanism on the Rover that detects that new code has been updated will shut down the running code, copy the new file over and restart it.

Return to “Networking and servers”