Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
Tests:
runs-on: ubuntu-latest
container: ghcr.io/guerinoni/go-docker-mqtt-ubuntu-env:latest
container: guerra1994/go-docker-mqtt-ubuntu-env

steps:
- name: check out code
Expand Down
29 changes: 23 additions & 6 deletions arduino-connector-arm.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/bin/bash -e

#
# This file is part of arduino-connector
#
# Copyright (C) 2017-2020 Arduino AG (http://www.arduino.cc/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

has() {
type "$1" > /dev/null 2>&1
return $?
Expand Down Expand Up @@ -32,7 +50,7 @@ echo ---------

echo remove old files
echo ---------
rm -f arduino-connector* certificate*
sudo rm -f /usr/bin/arduino-connector* /usr/bin/certificate*

echo uninstall previous installations of connector
echo ---------
Expand All @@ -53,19 +71,18 @@ fi
echo download connector
echo ---------
download https://downloads.arduino.cc/tools/feed/arduino-connector/arduino-connector-arm
mv arduino-connector-arm arduino-connector
chmod +x arduino-connector
sudo mv arduino-connector-arm /usr/bin/arduino-connector
sudo chmod +x /usr/bin/arduino-connector

echo install connector
echo ---------
if [ "$password" == "" ]
then
sudo -E ./arduino-connector -register -install
sudo -E arduino-connector -register -install
else
echo $password | sudo -kS -E ./arduino-connector -register -install > arduino-connector.log 2>&1
echo $password | sudo -kS -E arduino-connector -register -install > arduino-connector.log 2>&1
fi


echo start connector service
echo ---------
if [ "$password" == "" ]
Expand Down
12 changes: 6 additions & 6 deletions arduino-connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# This file is part of arduino-connector
#
# Copyright (C) 2017-2018 Arduino AG (http://www.arduino.cc/)
# Copyright (C) 2017-2020 Arduino AG (http://www.arduino.cc/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,7 +50,7 @@ echo ---------

echo remove old files
echo ---------
rm -f arduino-connector* certificate*
sudo rm -f /usr/bin/arduino-connector* /usr/bin/certificate*

echo uninstall previous installations of connector
echo ---------
Expand All @@ -71,18 +71,18 @@ fi
echo download connector
echo ---------
download https://downloads.arduino.cc/tools/feed/arduino-connector/arduino-connector
chmod +x arduino-connector
sudo mv arduino-connector /usr/bin/arduino-connector
sudo chmod +x /usr/bin/arduino-connector

echo install connector
echo ---------
if [ "$password" == "" ]
then
sudo -E ./arduino-connector -register -install
sudo -E arduino-connector -register -install
else
echo $password | sudo -kS -E ./arduino-connector -register -install > arduino-connector.log 2>&1
echo $password | sudo -kS -E arduino-connector -register -install > arduino-connector.log 2>&1
fi


echo start connector service
echo ---------
if [ "$password" == "" ]
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
)

const (
defaultConfigFile = "./arduino-connector.cfg"
defaultConfigFile = "/usr/bin/arduino-connector.cfg"
)

var (
Expand Down Expand Up @@ -103,14 +103,15 @@ func main() {
flag.StringVar(&config.appName, "appName", "arduino-connector", "")

var configFile = flag.String(flag.DefaultConfigFlagname, "", "path to config file")
flag.StringVar(&config.CertPath, "cert_path", "./", "path to store certificates")
flag.StringVar(&config.CertPath, "cert_path", "/usr/bin/", "path to store certificates")
flag.StringVar(&config.SketchesPath, "sketches_path", "", "path to store sketches")
flag.StringVar(&config.ID, "id", "", "id of the thing in aws iot")
flag.StringVar(&config.URL, "url", "", "url of the thing in aws iot")
flag.StringVar(&config.HTTPProxy, "http_proxy", "", "URL of HTTP proxy to use")
flag.StringVar(&config.HTTPSProxy, "https_proxy", "", "URL of HTTPS proxy to use")
flag.StringVar(&config.ALLProxy, "all_proxy", "", "URL of SOCKS proxy to use")
flag.StringVar(&config.AuthURL, "authurl", "https://login.arduino.cc", "Url of authentication server")
flag.StringVar(&config.AuthClientID, "auth_client_id", "", "Authentication client ID")
flag.StringVar(&config.APIURL, "apiurl", "https://api2.arduino.cc", "Url of api server")
flag.BoolVar(&config.CheckRoFs, "check_ro_fs", false, "Check for Read Only file system and remount if necessary")
flag.BoolVar(&debugMqtt, "debug-mqtt", false, "Output all received/sent messages")
Expand Down