forked from hybridgroup/gobot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the Edison documentation for 1.5
- Loading branch information
Showing
1 changed file
with
57 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,48 +4,51 @@ The Intel Edison is a wifi and Bluetooth® enabled devolopment platform for the | |
|
||
For more info about the Edison platform click [here](http://www.intel.com/content/www/us/en/do-it-yourself/edison.html). | ||
|
||
## How to Install | ||
## How to Install (using Go 1.5+) | ||
|
||
First you must install the appropriate Go packages | ||
Install Go from source or use an [official distribution](https://golang.org/dl/). | ||
|
||
``` | ||
go get -d -u github.com/hybridgroup/gobot/... && go install github.com/hybridgroup/gobot/platforms/intel-iot/edison | ||
``` | ||
Then you must install the appropriate Go packages | ||
|
||
#### Setting up your Intel Edison | ||
|
||
## Setting up your Intel Edison | ||
|
||
Everything you need to get started with the Edison is in the Intel Getting Started Guide | ||
located [here](https://communities.intel.com/docs/DOC-23147). Don't forget to | ||
configure your Edison's wifi connection and [flash](https://communities.intel.com/docs/DOC-23192) | ||
located [here](https://github.com/hybridgroup/gobot/tree/master/platforms). Don't forget to | ||
configure your Edison's wifi connection and [flash](https://github.com/hybridgroup/gobot/tree/master/platforms) | ||
your Edison with the latest firmware image! | ||
|
||
#### Cross compiling for the Intel Edison | ||
You must first configure your Go environment for 386 linux cross compiling | ||
If you followed the Edison setup steps you should be all set to access | ||
your device using its wifi IP. Just in case you were too eager to get | ||
started, here are the critical parts you can't skip! | ||
|
||
```bash | ||
$ cd $GOROOT/src | ||
$ GOOS=linux GOARCH=386 ./make.bash --no-clean | ||
``` | ||
[Connect to your device via USB](https://software.intel.com/en-us/setting-up-serial-terminal-intel-edison-board | ||
) so you can setup the network. | ||
|
||
Then compile your Gobot program with | ||
The recommended way to connect to your device is via wifi, for that follow the [Intel directions](https://software.intel.com/en-us/connecting-your-intel-edison-board-using-wifi) so you can get your device to connect to your local wifi network and get its IP. If you don't have a wifi network available, the Intel documentation explains how to use another connection type, but note that this guide assumes you are using wifi connection. | ||
|
||
You should get the ip of your edison as a message looking like that: | ||
|
||
```bash | ||
$ GOARCH=386 GOOS=linux go build examples/edison_blink.go | ||
``` | ||
Please connect your laptop or PC to the same network as this device and go to http://10.35.15.185 or http://edison.local in your browser. | ||
``` | ||
|
||
Then you can simply upload your program over the network from your host computer to the Edison | ||
Don't forget to setup the a password for the device otherwise you won't be able to | ||
connect. From within the screen session: | ||
|
||
```bash | ||
$ scp edison_blink [email protected]:/home/root/ | ||
``` | ||
configure_edison --password | ||
``` | ||
|
||
and execute it on your Edison with | ||
Note that you MUST setup a password otherwise SSH won't be enabled. If | ||
later on you aren't able to scp to the device, try to reset the | ||
password. This password will obviously be needed next time you connect to | ||
your device. | ||
|
||
```bash | ||
$ ./edison_blink | ||
``` | ||
|
||
## How to Use | ||
## Example program | ||
|
||
Save the following code into a file called `main.go`. | ||
|
||
```go | ||
package main | ||
|
@@ -81,6 +84,33 @@ func main() { | |
gbot.Start() | ||
} | ||
``` | ||
## How to Connect | ||
|
||
The [Intel Edison Getting Started Guide](https://communities.intel.com/docs/DOC-23147) details connection instructions for Windows, Mac and Linux. | ||
You can read the [full API documentation online](http://godoc.org/github.com/hybridgroup/gobot). | ||
|
||
#### Cross compiling for the Intel Edison | ||
|
||
Compile your Gobot program run the following command using the command | ||
line from the directory where you have your `main.go` file: | ||
|
||
```bash | ||
$ GOARCH=386 GOOS=linux go build . | ||
``` | ||
|
||
Then you can simply upload your program over the network from your host computer to the Edison | ||
|
||
```bash | ||
$ scp main root@<IP of your device>:/home/root/blink | ||
``` | ||
|
||
and execute it on your Edison (use screen to connect, see the Intel | ||
setup steps if you don't recall how to connect) | ||
|
||
```bash | ||
$ ./blink | ||
``` | ||
|
||
At this point you should see the onboard led blinking. Press control + c | ||
to exit. | ||
|
||
To update the program after you made a change, you will need to scp it | ||
over once again and start it from the command line (via screen). |