gobot.io/x/gobot/v2@v2.1.0/platforms/intel-iot/edison/README.md (about) 1 # Edison 2 3 The Intel Edison is a WiFi and Bluetooth enabled development platform for the Internet of Things. It packs a robust set of features into its small size and supports a broad spectrum of I/O and software support. 4 5 For more info about the Edison platform click [here](http://www.intel.com/content/www/us/en/do-it-yourself/edison.html). 6 7 ## How to Install 8 9 You would normally install Go and Gobot on your workstation. Once installed, cross compile your program on your workstation, transfer the final executable to your Intel Edison, and run the program on the Intel Edison itself as documented here. 10 11 ``` 12 go get -d -u gobot.io/x/gobot/v2/... 13 ``` 14 15 ### Setting up your Intel Edison 16 17 Everything you need to get started with the Edison is in the Intel Getting Started Guide: 18 19 https://software.intel.com/en-us/iot/library/edison-getting-started 20 21 Don't forget to configure your Edison's wifi connection and flash your Edison with the latest firmware image! 22 23 The recommended way to connect to your device is via wifi, for that follow the directions here: 24 25 https://software.intel.com/en-us/connecting-your-intel-edison-board-using-wifi 26 27 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. 28 29 You can obtain the IP address of your Edison, by running the floowing command: 30 31 ``` 32 ip addr show | grep inet 33 ``` 34 35 Don't forget to setup the a password for the device otherwise you won't be able to connect using SSH. From within the screen session, run the following command: 36 37 ``` 38 configure_edison --password 39 ``` 40 41 Note that you MUST setup a password otherwise SSH won't be enabled. If 42 later on you aren't able to scp to the device, try to reset the 43 password. This password will obviously be needed next time you connect to 44 your device. 45 46 47 ## How To Use 48 49 50 ```go 51 package main 52 53 import ( 54 "time" 55 56 "gobot.io/x/gobot/v2" 57 "gobot.io/x/gobot/v2/drivers/gpio" 58 "gobot.io/x/gobot/v2/platforms/intel-iot/edison" 59 ) 60 61 func main() { 62 e := edison.NewAdaptor() 63 led := gpio.NewLedDriver(e, "13") 64 65 work := func() { 66 gobot.Every(1*time.Second, func() { 67 led.Toggle() 68 }) 69 } 70 71 robot := gobot.NewRobot("blinkBot", 72 []gobot.Connection{e}, 73 []gobot.Device{led}, 74 work, 75 ) 76 77 robot.Start() 78 } 79 ``` 80 81 You can read the [full API documentation online](http://godoc.org/gobot.io/x/gobot/v2). 82 83 ## How to Connect 84 85 ### Compiling 86 87 Compile your Gobot program on your workstation like this: 88 89 ```bash 90 $ GOARCH=386 GOOS=linux go build examples/edison_blink.go 91 ``` 92 93 Once you have compiled your code, you can you can upload your program and execute it on the Intel Edison from your workstation using the `scp` and `ssh` commands like this: 94 95 ```bash 96 $ scp edison_blink root@<IP of your device>:/home/root/ 97 $ ssh -t root@<IP of your device> "./edison_blink" 98 ``` 99 100 At this point you should see one of the onboard LEDs blinking. Press control + c 101 to exit. 102 103 To update the program after you made a change, you will need to scp it 104 over once again and start it from the command line (via screen).