Coder Social home page Coder Social logo

arduino-cloud-cli's Introduction

Arduino is an open-source physical computing platform based on a simple I/O board and a development environment that implements the Processing/Wiring language. Arduino can be used to develop stand-alone interactive objects or can be connected to software on your computer (e.g. Flash, Processing and MaxMSP). The boards can be assembled by hand or purchased preassembled; the open-source IDE can be downloaded for free at https://arduino.cc

Github

More info at

Bug reports and technical discussions

  • To report a bug in the software or to request a simple enhancement go to Github Issues

  • More complex requests and technical discussion should go on the Arduino Developers mailing list

  • If you're interested in modifying or extending the Arduino software, we strongly suggest discussing your ideas on the Developers mailing list before starting to work on them. That way you can coordinate with the Arduino Team and others, giving your work a higher chance of being integrated into the official release

Security

If you think you found a vulnerability or other security-related bug in this project, please read our security policy and report the bug to our Security Team ๐Ÿ›ก๏ธ Thank you!

e-mail contact: [email protected]

Installation

Detailed instructions for installation in popular operating systems can be found at:

Contents of this repository

This repository contains just the code for the Arduino IDE itself. Originally, it also contained the AVR and SAM Arduino core and libraries (i.e. the code that is compiled as part of a sketch and runs on the actual Arduino device), but those have been moved into their own repositories. They are still automatically downloaded as part of the build process and included in built releases, though.

The repositories for these extra parts can be found here:

Building and testing

Instructions for building the IDE and running unit tests can be found on the wiki:

Credits

Arduino is an open source project, supported by many.

The Arduino team is composed of Massimo Banzi, David Cuartielles, Tom Igoe and David A. Mellis.

Arduino uses GNU avr-gcc toolchain, GCC ARM Embedded toolchain, avr-libc, avrdude, bossac, openOCD and code from Processing and Wiring.

Icon and about image designed by ToDo

arduino-cloud-cli's People

Contributors

csarnataro avatar eclipse1985 avatar matteopologruto avatar mirkokurt avatar pennam avatar per1234 avatar polldo avatar rjtokenring avatar robgee86 avatar serjlee avatar stevisco avatar ubidefeo avatar umbynos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-cloud-cli's Issues

0.0.8 not running on Mac OS

I have downloaded the latest release but cannot get it to run

$> ./arduino-cloud-cli
[1]    29707 killed     ./arduino-cloud-cli

I'm on Mac OS 12.3
Apple M1 Max

Improve docs to clarify that for some command the `arduino-cli` is a pre-requisite

I tried to create a device in the Cloud with the command arduino-cloud-cli device create.
It turned out that, for security reasons (see this interesting blog post), this command has to configure the board via the so-called "provisioning process" which requires to flash a specific sketch on the board as part of the process.
For this reason, internally, it tries to call the arduino-cli to flash such a sketch on the board.
Since I didn't have the arduino-cli installed, the process failed.
After installing it, the process completed successfully.

I would suggest to update the README file to add this dependency from the arduino-cli for some commands (namely, the device create command).

[IOT-1421] Improve command feedbacks for users

We could return specific types of errors (instead of generic ones) and then depending on it understand what kind of feedback we should give to the user.

Eg:

diff --git a/cli/dashboard/create.go b/cli/dashboard/create.go
index 211dca7..bfcc0d9 100644
--- a/cli/dashboard/create.go
+++ b/cli/dashboard/create.go
@@ -64,13 +64,21 @@ func runCreateCommand(cmd *cobra.Command, args []string) {
 		params.Name = &createFlags.name
 	}
 
-	dashboard, err := dashboard.Create(params)
+	dboard, err := dashboard.Create(params)
 	if err != nil {
-		feedback.Errorf("Error during dashboard create: %v", err)
+		switch err.(type) {
+		case dashboard.ErrMissingName:
+			feedback.Errorf(`Error during dashboard create: %v.
+
+It seems like the provided template doesn't have a default name for the
+dashboard,  please provide one with the --name option."`, err)
+		default:
+			feedback.Errorf("Error during dashboard create: %v", err)
+		}
 		os.Exit(errorcodes.ErrGeneric)
 	}
 
-	feedback.PrintResult(createResult{dashboard})
+	feedback.PrintResult(createResult{dboard})
 }
 
 type createResult struct {
diff --git a/command/dashboard/create.go b/command/dashboard/create.go
index d92c594..ae77261 100644
--- a/command/dashboard/create.go
+++ b/command/dashboard/create.go
@@ -18,13 +18,17 @@
 package dashboard
 
 import (
-	"errors"
-
 	"github.com/arduino/arduino-cloud-cli/internal/config"
 	"github.com/arduino/arduino-cloud-cli/internal/iot"
 	"github.com/arduino/arduino-cloud-cli/internal/template"
 )
 
+type ErrMissingName struct{}
+
+func (ErrMissingName) Error() string {
+	return "dashboard name not specified"
+}
+
 // CreateParams contains the parameters needed to create a new dashboard.
 type CreateParams struct {
 	Name     *string           // Name of the new dashboard
@@ -54,7 +58,7 @@ func Create(params *CreateParams) (*DashboardInfo, error) {
 	}
 	// If name is not specified in the template, it should be passed as parameter
 	if dashboard.Name == "" {
-		return nil, errors.New("dashboard name not specified")
+		return nil, ErrMissingName{}
 	}
 
 	newDashboard, err := iotClient.DashboardCreate(dashboard)

Originally posted by @glumia in #50 (comment)

Extracted dashboards yaml file uses things/variables names rather than UIDs

If I extract a Dashboard its widgets are linked to Things and Variables based on their names rather than UID.
I would expect the Thing ID and Variable ID to be listed instead.
This could be useful to retrieve full details of a dashboard, not just the labels.
Any reason why it's just like this?

Current structure

- height: 4
    height_mobile: 4
    name: Switch A
    options:
        frameless: false
        mode: Color 2
        showThing: false
    type: LED
    variables:
      - thing_id: sOnOff
        variable_id: switch_A
    width: 4
    width_mobile: 4
    x: 0
    x_mobile: 0
    "y": 0
    y_mobile: 0

Full structure

- height: 4
    height_mobile: 4
    name: Switch A
    options:
        frameless: false
        mode: Color 2
        showThing: false
    type: LED
    variables:
      - thing_id: 0bbafafc-2ac3-4d10-9620-34f8fb284701
        thing_name: SonOff
        variable_id: d0be0122-24cd-4a6d-99f5-793e21ac34a1
        variable_id: switch_A
    width: 4
    width_mobile: 4
    x: 0
    x_mobile: 0
    "y": 0
    y_mobile: 0

Timezone value is not ported into cloned thing

starting from a Thing with a specific Timezone set, using thing clone command, the original Timezone is ignored and the cloned thing takes a standard America / New York Timezone.

Original Thing
Screenshot 2023-09-25 alle 09 24 39

Cloned Thing
Screenshot 2023-09-25 alle 09 25 06

Getting Thing Name & Variable Name in Dashboard template

Hi everyone,

we are working on the project where we want to generate the dashboard via command line. But when we extract the dashboard template it's giving Thing Name in the field of thing_id and Variable Name in the field of variable_id instead of Thing ID and Variable ID. already an issue is opened but still there is no updated. Would you please resolve the issue.

Best Regards,

[content-demo] project folder

this project folder contains all the resources used for the "workshop" with the content team @karlsoderby
WARNING: the arduino-cloud-cli contains configuration features that are not merged yet and are somewhat unstable (they will be fixed, merged and documented on the README.md soon)

Download: WP.zip

steps to reproduce the cloud-blink demo:

  • set a configuration: config init
  • create a device: device create
  • create a thing using BlinkThing.yaml template: thing create
  • attach the thing to the device: thing bind
  • edit the BlinkCloud sketch's wifi credentials and the thing-id (in arduino-secrets.h and thingProperties.h respectively)
  • upload BlinkCloud sketch to the device (using arduino-cli or IDE)
  • create a dashboard using BlinkDashboard.yaml template (using the override flag to replace the thing id placeholder with the actual thing-id): dashboard create

Arduino-cloud-cli issues too many requests per second and runs into rate-limit

When running the following command which creates a dashboard with 6 elements (3 static variables and 3 graphs)

arduino-cloud-cli dashboard create --name LoraWetterStation --template "LoraSample - Wetterstation DHT11 Pin 3-dashboard".json  --override LoraWetterStation=<my-secret-thing-id>

I get the following error with an "entry" plan:

429 Too Many Requests

the page https://www.arduino.cc/reference/en/iot/

indicates that "Arduino IoT APIs are rate limited, authenticated clients limit is up to 10req/s."

To be more user friendly the cli should have either a default to throttle API invocations to max n per second or a command option to specify how many API calls it can do per second.

I just learned that the "entry" plan is limited to 1 request per second. So it should be a configuration or command line option to specify the amount of API calls issued per second.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.