def upload(self, *parameters):
        parser = argparse.ArgumentParser(description=self.upload.__doc__,
                                         prog="bii %s:upload" % self.group)
        parser.add_argument('firmware', type=str, nargs="?", help='firmwares to upload')
        parser.add_argument("--ssh", type=str, nargs="?", default=argparse.SUPPRESS,
                            help='Upload by ssh. You can specify the IP (default 192.168.240.1)')
        args = parser.parse_args(*parameters)

        # Refresh the arduino port. Check if user's entered arduino settings
        # FIXME: Leonardo board could fail sometimes because of its port reset
        super(ArduinoToolChain, self).build()  # Here initialize arduino settings if it doesn't exist
        if 'ssh' in args:
            ip = args.ssh or "192.168.240.1"
            self.arduino.ssh_upload(args.firmware, ip)
        else:
            self.arduino.refresh_port()
            self.arduino.upload(args.firmware)

        self.bii.user_io.out.success('Upload finished')
Upload a firmware in Arduino
dataset/ETHPy150Open biicode/client/dev/hardware/arduino/arduinotoolchain.py/ArduinoToolChain.upload