Skip to content

Commit ad22db5

Browse files
umbynosStefania
and
Stefania
authoredFeb 3, 2021
[EDITOR-523] Update README.md (#607)
* removed old download links * move to https://github.com/arduino/arduino-create-agent/wiki/Advanced-usage * move to https://github.com/arduino/arduino-create-agent/wiki/Disable-Autostart * move to https://github.com/arduino/arduino-create-agent/wiki/How-to-use-it * move to https://github.com/arduino/arduino-create-agent/wiki/Developement * add Documentation pointing to wiki and other improvements * add architecture scheme * fix typos * applied suggestions from @smellai * fix minor typos * add notice on apple m1 support * update issue template with architecture Co-authored-by: Stefania <[email protected]>
1 parent 9123aae commit ad22db5

File tree

2 files changed

+36
-443
lines changed

2 files changed

+36
-443
lines changed
 

‎.github/ISSUE_TEMPLATE/bug_report.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ about: Create a report to help us improve
2020
- Browser [e.g. chrome, safari]:
2121
- Browser Version:
2222
- Agent Version [e.g. 1.0.0]:
23+
- CPU architecture [e.g. amd64]
2324

2425
## Additional context
2526
<!--Add any other context about the problem here.-->

‎README.md

+35-443
Original file line numberDiff line numberDiff line change
@@ -3,453 +3,44 @@
33
arduino-create-agent
44
====================
55

6+
The Arduino Create Agent is a single binary that will sit on the traybar and work in the background. It allows you to use the [Arduino Create applications](https://create.arduino.cc) to seamlessly upload code to any USB connected Arduino board (or Yún in LAN) directly from the browser.
67

7-
## GOA 2 refactoring
8-
The agent is currently transitioning to the v2 of the GOA framework for API management, please refer to the following
9-
[documentation](https://github.com/goadesign/goa/tree/v2) in order to install tools and libraries
10-
11-
12-
i.e. to regenerate code from design use:
13-
```bash
14-
goa gen github.com/arduino/arduino-create-agent/design
15-
```
16-
17-
## Installation
18-
Get the latest version of the Agent for all supported platforms:
19-
20-
### Windows
21-
* [Windows with Edge](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-edge.exe)
22-
* [Windows with Chrome](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-chrome.exe)
23-
* [Windows with Firefox](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-firefox.exe)
24-
25-
### MacOSX
26-
* [MacOSX with Safari](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-safari.dmg)
27-
* [MacOSX with Chrome](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-chrome.dmg)
28-
* [MacOSX with Firefox](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-firefox.dmg)
29-
30-
### Linux
31-
* [Linux x64 with Chrome](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-linux-x64-installer-chrome.tar.gz)
32-
* [Linux x64 with Firefox](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-linux-x64-installer-firefox.tar.gz)
33-
34-
arduino-create-agent is a fork of @[johnlauer](https://github.com/johnlauer)'s [serial-port-json-server](https://github.com/johnlauer/serial-port-json-server) (which we really want to thank for his kindness and great work)
35-
36-
The history has been rewritten to keep the repo small (thus removing all binaries committed in the past)
37-
38-
39-
40-
## Using multiple configurations
41-
42-
The agent supports multiple configuration files. When multiple configurations are found by the agent, the tray icon menu is expanded to contain the different configurations:
43-
44-
![Agent multiple configuration tray icon](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/linux/tray-icon-multiple-profiles.png)
45-
46-
The default `config.ini` file contains common configurations, every other config file inherit from it.
47-
48-
To create multiple configuration files:
49-
- stop the agent: tray bar icon -> pause then tray bar icon -> kill
50-
- find the `config.ini` file that is present in the `arduino-create-agent` installation folder
51-
- copy `config.ini` or create a new ini file (e.g. `example.ini`) with content:
52-
```ini
53-
name = your configuration name
54-
```
55-
add in this file other configuration options (you can override inherited values from `config.ini`)
56-
- restart the agent
57-
- click the tray bar icon and select the new configuration
58-
59-
**Tip**: you can also use the multiple configurations feature to create a new configuration with the proxy settings. This way you can have multiple proxies configured and disable proxy configuration with ease.
60-
61-
## When behind a proxy
62-
63-
The agent supports working behind a proxy, but manual configuration is required (there is no support for automatic proxy discovery).
64-
65-
To add proxy configuration:
66-
- stop the agent: tray bar icon -> pause then tray bar icon -> kill
67-
- find the `config.ini` file that is present in the `arduino-create-agent` installation folder
68-
- copy `config.ini` to a new file (e.g. `proxy.ini`) with content:
69-
```ini
70-
name = Proxy Enabled
71-
[env]
72-
http_proxy=your.proxy.here
73-
https_proxy=your.https.proxyhere
74-
```
75-
- please note spaces are not allowed before and after the string `http_proxy`
76-
- restart the agent
77-
- select the proper Proxy profile as in the image
78-
- your agent will now work behind a proxy
79-
80-
![Agent multiple configuration tray icon](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/linux/tray-icon-multiple-profiles.png)
81-
82-
83-
## Disable Autostart
84-
85-
### Windows
86-
1. Type "Task Manager in the Windows Search Bar"
87-
88-
![Type "Task Manager in the Windows Search Bar"](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/windows/01.png)
89-
2. Select the Startup tab
90-
91-
![Select the Startup tab](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/windows/02.png)
92-
3. Select the autostart file
93-
94-
![Select the autostart file](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/windows/03.png)
95-
4. Disable it
96-
97-
![Disable it](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/windows/04.png)
98-
99-
### Mac OSX
100-
1. Open Finder, click on Go menu, select 'Go to Folder'
101-
102-
![Open Finder, click on Go menu, select 'Go to Folder'](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/mac/01.png)
103-
2. Type the directory containing the autolauncher file, change <username> with your Mac username, by default the directory is /Users/username/Library/LaunchAgents
104-
105-
![Type the directory containing the autolauncher file, change <username> with your Mac username, by default the directory is /Users/username/Library/LaunchAgents](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/mac/02.png)
106-
3. Select the ArduinoCreateAgent.plist file
107-
108-
![Select the ArduinoCreateAgent.plist file](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/mac/03.png)
109-
4. Right click on the file name and select 'Move to Trash'
110-
111-
![Right click on the file name and select 'Move to Trash'](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/mac/04.png)
112-
113-
---
114-
The command line way:
115-
```
116-
$ launchctl unload ~/Library/LaunchAgents/ArduinoCreateAgent.plist
117-
```
118-
119-
### Linux
120-
1. Show hidden files
121-
122-
![Show hidden files](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/linux/01.png)
123-
2. Select the .config dir in your home
124-
125-
![Select the .config dir in your home](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/linux/02.png)
126-
3. Select the autostart dir
127-
128-
![Select the autostart dir](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/linux/03.png)
129-
4. Move the file to the trash
130-
131-
![Move the file to the trash](https://raw.githubusercontent.com/arduino/arduino-create-agent/devel/images/linux/04.png)
132-
133-
---
134-
The command line way:
135-
136-
Just remove the autostart file in your desktop manager, in Ubuntu is:
137-
```
138-
$ rm $HOME/.config/autostart/arduino-create-agent.desktop
139-
```
140-
To start manually the agent you can open the file at:
141-
```
142-
$ nohup $HOME/ArduinoCreateAgent-1.1/Arduino_Create_Bridge &
143-
```
144-
or in the location selected during the installation
145-
146-
# Contributing
147-
148-
Please use the current latest version:
149-
150-
### Windows
151-
* [Windows with Edge dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer-edge.exe)
152-
* [Windows with Chrome dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer.exe)
153-
* [Windows with Firefox dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer-firefox.exe)
154-
155-
### MacOSX
156-
* [MacOSX with Safari dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-safari.dmg)
157-
* [MacOSX with Chrome dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-chrome.dmg)
158-
* [MacOSX with Firefox dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-firefox.dmg)
159-
160-
### Linux
161-
* [Linux x64 with Chrome dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-linux-x64-installer-chrome.run)
162-
* [Linux x64 with Firefox dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-linux-x64-installer-firefox.run)
163-
164-
165-
## How to use it
166-
The arduino create agent is a single binary that reads from a configuration file. Upon launching it will sit on the traybar and work in the background.
167-
168-
It will listen to http and websocket connections on a range of ports from `8990` to `9000`.
169-
170-
### Discover the port
171-
You should make GET request to the `/info` endpoint on the possible ports, until you find a reply:
172-
173-
$ curl http://127.0.0.1:8990/info
174-
curl: (7) Failed to connect to 127.0.0.1 port 8990: Connection refused
175-
$ curl http://127.0.0.1:8991/info
176-

177-
$ curl http://127.0.0.1:8992/info
178-
{"http":"http://127.0.0.1:8992","https":"https://127.0.0.1:8991","version":"1.0.36","ws":"ws://127.0.0.1:8992","wss":"wss://127.0.0.1:8991"}
179-
180-
The reply will contain a json with info about the version and the http and https endpoints to use
181-
182-
### Open a websocket
183-
Most of the commands can be performed with websocket instructions. We use a library called [socket.io](https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js) to handle the messages.
184-
Once you have the websocket endpoint you need you can:
185-
186-
```javascript
187-
var socket = io(endpoint);
188-
socket.on('connect', function () {
189-
socket.emit('command', yourCommand);
190-
191-
socket.on('command', function () {
192-
// Your code to handle messages
193-
})
194-
}
195-
```
196-
197-
### Use the debug console
198-
By clicking on the tray icon and going to the debug console you can try most of the websocket commands. The first command you should type in is:
199-
200-
log on
201-
202-
### List the boards
203-
To get a json list of the connected boards you can issue the command:
204-
205-
list
206-
207-
You will receive an object of all the boards connected with USB or over the network:
208-
209-
```json
210-
{
211-
"Ports":[
212-
{
213-
"Name":"/dev/ttyACM0",
214-
"SerialNumber":"",
215-
"DeviceClass":"",
216-
"IsOpen":false,
217-
"IsPrimary":false,
218-
"Baud":0,
219-
"BufferAlgorithm":"",
220-
"Ver":"1.0.36",
221-
"NetworkPort":false,
222-
"VendorID":"0x2341",
223-
"ProductID":"0x8036"
224-
}
225-
],
226-
"Network":false
227-
}{
228-
"Ports":[
229-
{
230-
"Name":"192.168.1.101",
231-
"SerialNumber":"",
232-
"DeviceClass":"",
233-
"IsOpen":false,
234-
"IsPrimary":false,
235-
"Baud":0,
236-
"BufferAlgorithm":"",
237-
"Ver":"1.0.36",
238-
"NetworkPort":true,
239-
"VendorID":"board=Arduino Y\\195\\186n Shield distro_version=0.1",
240-
"ProductID":"Shield"
241-
}
242-
],
243-
"Network":true
244-
}
245-
```
246-
247-
### Open/Close ports
248-
249-
To read input from a board connected to USB you must first open the port with the command
250-
251-
open /dev/ttyACM0 9600
252-
253-
where you should replace /dev/ttyACM0 with the actual port and 9600 with the baud.
254-
255-
You will receive a message like:
256-
257-
```json
258-
{
259-
"Cmd":"Open",
260-
"Desc":"Got register/open on port.",
261-
"Port":"/dev/ttyACM0",
262-
"IsPrimary":true,
263-
"Baud":9600,
264-
"BufferType":""
265-
}
266-
```
267-
268-
or
269-
270-
```json
271-
{
272-
"Cmd":"OpenFail",
273-
"Desc":"Error opening port. Serial port busy",
274-
"Port":"/dev/ttyACM0",
275-
"Baud":9600
276-
}
277-
```
278-
279-
You can then close the port with
280-
281-
close /dev/ttyACM0
282-
283-
You will receive a message like:
284-
285-
```json
286-
{
287-
"Cmd":"Close",
288-
"Desc":"Got unregister/close on port.",
289-
"Port":"/dev/ttyACM0",
290-
"Baud":9600
291-
}
292-
```
293-
294-
or
295-
296-
297-
```json
298-
{
299-
"Error":"We could not find the serial port /dev/ttyACM0 that you were trying to close."
300-
}
301-
```
302-
303-
### Receiving and sending data
304-
305-
While a port is open you can send input with
306-
307-
send /dev/ttyACM0 hello
308-
309-
with a reply like
310-
311-
```json
312-
{"Cmd":"Queued","QCnt":1,"Ids":[""],"D":["hello"],"Port":"/dev/ttyACM0"}
313-
{"Cmd":"Write","QCnt":0,"Id":"","P":"/dev/ttyACM0"}
314-
{"Cmd":"CompleteFake","Id":"","P":"/dev/ttyACM0"}
8+
## Architecture
3159
```
316-
317-
You can receive output from the serial port by listening to messages like this:
318-
319-
```json
320-
{
321-
"D":"output string\r\n"
322-
}
323-
```
324-
325-
### Download a tool
326-
You can download a tool on the computer with a command like
327-
328-
downloadtool avrdude 6.0.1-arduino5 replace
329-
330-
receiving a reply like
331-
332-
```json
333-
{
334-
"DownloadStatus": "Success",
335-
"Msg":"Map Updated"
336-
}
10+
+-------------------------------+
11+
| |
12+
| Browser |
13+
| | Web socket +----------------------+ flashes +---------------+
14+
| +---------------------------+ |<-------------->| +------------>| |
15+
| | | | | Arduino Create Agent | | Arduino Board |
16+
| | Arduino Create Web Editor | +--------------->| |<------------+ |
17+
| | | | REST API +----------------------+ serial +---------------+
18+
| +---------------------------+ |
19+
+-------------------------------+
33720
```
33821

339-
The syntax of the command is:
340-
341-
downloadtool {{name}} {{version}} {{behaviour}}
342-
343-
where `version` can be a version number of the string "latest", and `behaviour` can be
344-
"keep" (which skips the download if the tool already exists) and "replace" (which will download it again).
345-
346-
### Upload
347-
You can upload a binary sketch to a board connected to a port with a POST request to be made at the http endpoint.
348-
349-
The payload is a json object that looks like this:
350-
351-
```json
352-
{
353-
"board":"arduino:avr:leonardo",
354-
"port":"/dev/ttyACM1",
355-
"commandline":"\"{runtime.tools.avrdude.path}/bin/avrdude\" \"-C{runtime.tools.avrdude.path}/etc/avrdude.conf\" -v -patmega32u4 -cavr109 -P{serial.port} -b57600 -D \"-Uflash:w:{build.path}/{build.project_name}.hex:i\"",
356-
"signature":"97db97ced2c",
357-
"hex":"OjEwMDAwMDAwMEM5NEU1MDAwQzk0MEQwMTBDOTQwRDAxMEM5NDBEMDE2MQ0KOjEwMDAxMDAwMEM5NDBEMDEwQzk0M",
358-
"filename":"Blink.ino.hex",
359-
"extrafiles": [],
360-
"extra":{
361-
"auth":{
362-
"username":null,
363-
"password":null,
364-
"private_key":null,
365-
"port":null
366-
},
367-
"wait_for_upload_port":true,
368-
"use_1200bps_touch":true,
369-
"network":false,
370-
}
371-
}
372-
```
373-
374-
- commandline is the command to execute to perform the upload. This is, for example, avrdude on a Leonardo.
375-
376-
- hex contains the sketch binary encoded in base64 (could decode in Intel hex or raw binary)
377-
378-
- signature is the signature of the commandline signed with the private key that matches the public key contained in the config.ini of the arduino-create-agent
379-
380-
The results of the upload will be delivered via websocket with messages that look like:
381-
382-
```json
383-
{"Msg":"avrdude: verifying ...","ProgrammerStatus":"Busy"}
384-
{"Msg":"avrdude done. Thank you.","ProgrammerStatus":"Busy"}
385-
{"Flash":"Ok","ProgrammerStatus":"Done"}
386-
```
387-
388-
### Javacript client library
389-
390-
You can install the [arduino-create-agent-js-client](https://github.com/arduino/arduino-create-agent-js-client) in your client application
391-
392-
---
393-
394-
## Development
395-
396-
Please remember that for compile the project, you need go version >= 1.10.x (older versions are not supported for compile)
397-
398-
To clone the repository, run the following command:
399-
```
400-
go get github.com/arduino/arduino-create-agent
401-
```
402-
403-
This will clone the repository into your [Go workspace](https://golang.org/doc/code.html#Workspaces) or create a new workspace, if one doesn't exist. You can set `$GOPATH` to define where your Go workspace is located.
404-
405-
Now you can go to the project directory and compile it:
406-
```
407-
cd $GOPATH/src/github.com/arduino/arduino-create-agent
408-
go build
409-
```
410-
411-
This will create the `arduino-create-agent` binary.
412-
413-
Other prerequisites are:
414-
* libappindicator (Linux only on Ubuntu `sudo apt-get install libappindicator1 libappindicator3-0.1-cil libappindicator3-0.1-cil-dev libappindicator3-1 libappindicator3-dev libgtk-3-0 libgtk-3-dev`)
415-
* [go-selfupdate] (https://github.com/sanbornm/go-selfupdate) if you want to test automatic updates
416-
417-
### Windows
418-
Since we are using the https://github.com/lxn/walk library, we need to ship a manifest.xml file, otherwise the error would be:
419-
420-
```
421-
panic: Unable to create main window: TTM_ADDTOOL failed
422-
```
423-
424-
To do it make sure to install the required tool:
425-
426-
```
427-
$ go get github.com/akavel/rsrc
428-
```
429-
430-
and build it with
431-
432-
```
433-
$ rsrc -arch=386 -manifest=manifest.xml
434-
$ go build
435-
```
436-
437-
Keep in mind that the presence of rsrc.syso file will break other builds, for example
22+
## Installation
23+
Get the [latest version](https://github.com/arduino/arduino-create-agent/releases) of the Agent for all supported platforms or complete the [Getting Started](https://create.arduino.cc/getting-started/plugin/welcome).
43824

439-
```
440-
$ GOOS=linux go build
441-
# github.com/arduino/arduino-create-agent
442-
/usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
443-
/usr/sbin/ld: i386 architecture of input file `/tmp/go-link-084341451/000000.o' is incompatible with i386:x86-64 output
444-
collect2: error: ld returned 1 exit status
445-
```
25+
## Apple M1 support
26+
At the moment the new Apple Silicon Macs released in November 2020, like the new [MacBook Pro 13"](https://www.apple.com/macbook-pro-13/), [MacBook Air](https://www.apple.com/macbook-air/) and [Mac mini](https://www.apple.com/mac-mini/) models with the [Apple M1](https://www.apple.com/mac/m1/) chip are currently NOT supported by the Create Agent.
44627

447-
## Submitting an issue
28+
## Documentation
29+
The documentation has been moved to the [wiki](https://github.com/arduino/arduino-create-agent/wiki) page. There you can find:
30+
- [Advanced usage](https://github.com/arduino/arduino-create-agent/wiki/Advanced-usage): explaining how to use multiple configurations and how to use the agent with a proxy.
31+
- [Agent Beta Program](https://github.com/arduino/arduino-create-agent/wiki/Agent-Beta-Program)
32+
- [Developement](https://github.com/arduino/arduino-create-agent/wiki/Developement): containing useful info to help in development
33+
- [Disable Autostart](https://github.com/arduino/arduino-create-agent/wiki/Disable-Autostart)
34+
- [How to compile on Raspberry Pi](https://github.com/arduino/arduino-create-agent/wiki/How-to-compile-on-Raspberry-Pi)
35+
- [How to use crashreport functionality](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality)
36+
- [How to use the agent](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-the-agent)
44837

449-
Please attach the output of the commands running at the debug console if useful.
38+
## Contributing
39+
### Submitting an issue
45040

451-
## Submitting a pull request
41+
When submitting a new issue please search for duplicates before creating a new one. Help us by providing useful context and information. Please attach the output of the commands running at the debug console or attach [crash reports](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality) if useful.
45242

43+
### Submitting a pull request
45344
We are glad you want to contribute with code: that's the best way to help this software.
45445

45546
Your contribution is adding or modifying existing behaviour, please always refer to an existing issue or open a new one before contributing. We are trying to use [Test Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) in the near future: please add one or more tests that prove that your contribution is good and is working as expected, it will help us a lot.
@@ -460,6 +51,12 @@ Also, for your contribution to be accepted, every one of your commits must be "S
46051

46152
By signing off your commits, you agree to the following agreement, also known as [Developer Certificate of Origin](http://developercertificate.org/): it assures everyone that the code you're submitting is yours or that you have rights to submit it.
46253

54+
## Authors and acknowledgment
55+
arduino-create-agent is a fork of @[johnlauer](https://github.com/johnlauer)'s [serial-port-json-server](https://github.com/johnlauer/serial-port-json-server) (which we really want to thank for his kindness and great work)
56+
57+
The history has been rewritten to keep the repo small (thus removing all binaries committed in the past)
58+
59+
## License
46360
```
46461
Developer Certificate of Origin
46562
Version 1.1
@@ -498,8 +95,3 @@ By making a contribution to this project, I certify that:
49895
maintained indefinitely and may be redistributed consistent with
49996
this project or the open source license(s) involved.
50097
```
501-
502-
503-
## Creating a release
504-
Just create a new release on GitHub, and our drone server will build and upload
505-
the compiled binaries for every architecture in a zip file in the release itself.

0 commit comments

Comments
 (0)
Please sign in to comment.