1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-01 13:48:57 +08:00

docs: add explanations for scp/ssh workflow on SoC boards to README

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-04-12 15:39:23 +02:00
parent a1c887aad4
commit d27d3e50ec
6 changed files with 60 additions and 67 deletions

View File

@ -8,10 +8,13 @@ We recommend updating to the latest Debian Jessie OS when using the BeagleBone,
For more info about the BeagleBone platform go to [http://beagleboard.org/getting-started](http://beagleboard.org/getting-started).
## How to Install
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 BeagleBone, and run the program on the BeagleBone itself as documented here.
```
go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/beaglebone
go get -d -u gobot.io/x/gobot/...
```
## How to Use
@ -55,19 +58,21 @@ func main() {
### Compiling
Simply compile your Gobot program like this:
Compile your Gobot program on your workstation like this:
```bash
$ GOARM=7 GOARCH=arm GOOS=linux go build examples/beaglebone_blink.go
```
If you are running the official Debian Linux through the usb->ethernet connection, or are connected to the board using WiFi, you can simply upload your program and execute it with the `scp` command like this:
Once you have compiled your code, you can you can upload your program and execute it on the BeagleBone from your workstation using the `scp` and `ssh` commands like this:
```bash
$ scp beaglebone_blink root@192.168.7.2:/home/root/
$ ssh -t root@192.168.7.2 "./beaglebone_blink"
```
In order to run the preceeding commands, you must be running the official Debian Linux through the usb->ethernet connection, or be connected to the board using WiFi.
### Updating your board to the latest OS
We recommend updating your BeagleBone to the latest Debian OS. It is very easy to do this using the Etcher (https://etcher.io/) utility program.

View File

@ -7,8 +7,11 @@ We recommend updating to the latest Debian OS when using the C.H.I.P., however G
For documentation about the C.H.I.P. platform click [here](http://docs.getchip.com/).
## How to Install
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 C.H.I.P and run the program on the C.H.I.P. itself as documented here.
```
go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/chip
go get -d -u gobot.io/x/gobot/...
```
### PWM support
@ -72,13 +75,13 @@ func main() {
### Compiling
Compile your Gobot program like this:
Compile your Gobot program on your workstation like this:
```bash
$ GOARM=7 GOARCH=arm GOOS=linux go build examples/chip_button.go
```
Then you can simply upload your program to the CHIP and execute it with
Once you have compiled your code, you can you can upload your program and execute it on the C.H.I.P. from your workstation using the `scp` and `ssh` commands like this:
```bash
$ scp chip_button root@192.168.1.xx:

View File

@ -5,8 +5,11 @@ The [DragonBoard 410c](http://www.96boards.org/product/dragonboard410c/), a prod
Make sure you are using the latest Linaro Debian image. Both AArch32 and AArch64 work™ though you should stick to 64bit as OS internals may be different and aren't tested.
## How to Install
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 DragonBoard and run the program on the DragonBoard itself as documented here.
```
go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/dragonboard
go get -d -u gobot.io/x/gobot/...
```
## How to Use
@ -52,13 +55,13 @@ func main() {
### Compiling
Compile your Gobot program like this:
Compile your Gobot program on your workstation like this:
```bash
$ GOARCH=arm64 GOOS=linux go build examples/dragon_button.go
```
Then you can simply upload your program to the board and execute it with
Once you have compiled your code, you can you can upload your program and execute it on the DragonBoard from your workstation using the `scp` and `ssh` commands like this:
```bash
$ scp dragon_button root@192.168.1.xx:

View File

@ -1,17 +1,18 @@
# Edison
The Intel Edison is a wifi and Bluetooth® enabled devolopment 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.
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.
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 (using Go 1.5+)
## How to Install
Install Go from source or use an [official distribution](https://golang.org/dl/).
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.
Then you must install the appropriate Go packages
```
go get -d -u gobot.io/x/gobot/...
```
## 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:
@ -43,9 +44,8 @@ password. This password will obviously be needed next time you connect to
your device.
## Example program
## How To Use
Save the following code into a file called `main.go`.
```go
package main
@ -62,10 +62,6 @@ func main() {
e := edison.NewAdaptor()
led := gpio.NewLedDriver(e, "13")
// Uncomment the line below if you are using a Sparkfun
// Edison board with the GPIO block
// e.SetBoard("sparkfun")
work := func() {
gobot.Every(1*time.Second, func() {
led.Toggle()
@ -84,29 +80,24 @@ func main() {
You can read the [full API documentation online](http://godoc.org/gobot.io/x/gobot).
#### Cross compiling for the Intel Edison
## How to Connect
Compile your Gobot program run the following command using the command
line from the directory where you have your `main.go` file:
### Compiling
Compile your Gobot program on your workstation like this:
```bash
$ GOARCH=386 GOOS=linux go build .
$ GOARCH=386 GOOS=linux go build examples/edison_blink.go
```
Then you can simply upload your program over the network from your host computer to the Edison
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:
```bash
$ scp main root@<IP of your device>:/home/root/blink
$ scp edison_blink root@<IP of your device>:/home/root/
$ ssh -t root@<IP of your device> "./edison_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
At this point you should see one of the onboard LEDs blinking. Press control + c
to exit.
To update the program after you made a change, you will need to scp it

View File

@ -1,12 +1,20 @@
# Edison
The Intel Joule is a wifi and Bluetooth® enabled development platform for the Internet of Things.
The Intel Joule is a WiFi and Bluetooth enabled development platform for the Internet of Things.
For more info about the Intel Joule platform go to:
http://www.intel.com/joule
## Setting up your Intel Joule
## How to Install
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 Joule, and run the program on the Intel Joule itself as documented here.
```
go get -d -u gobot.io/x/gobot/...
```
### Setting up your Intel Joule
Everything you need to get started with the Joule is in the Intel Getting Started Guide located at:
@ -14,9 +22,8 @@ https://intel.com/joule/getstarted
Don't forget to configure your Joule's wifi connection and update your Joule to the latest firmware image!
## Example program
## How To Use
Save the following code into a file called `main.go`.
```go
package main
@ -51,26 +58,21 @@ func main() {
You can read the [full API documentation online](http://godoc.org/gobot.io/x/gobot).
#### Cross compiling for the Intel Joule
## How to Connect
Compile your Gobot program run the following command using the command
line from the directory where you have your `main.go` file:
### Compiling
Compile your Gobot program on your workstation like this:
```bash
$ GOARCH=386 GOOS=linux go build .
$ GOARCH=386 GOOS=linux go build joule_blink.go
```
Then you can simply upload your program over the network from your host computer to the Joule
Once you have compiled your code, you can you can upload your program and execute it on the Intel Joule from your workstation using the `scp` and `ssh` commands like this:
```bash
$ scp main root@<IP of your device>:/home/root/blink
```
and then execute it on your Joule (use screen to connect, see the Intel
setup steps if you don't recall how to connect)
```bash
$ ./blink
$ scp joule_blink root@<IP of your device>:/home/root/
$ ssh -t root@<IP of your device> "./joule_blink"
```
At this point you should see one of the onboard LEDs blinking. Press control + c

View File

@ -8,10 +8,10 @@ We recommend updating to the latest Raspian Jessie OS when using the Raspberry P
For more info about the Raspberry Pi platform, click [here](http://www.raspberrypi.org/).
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 Raspberry Pi, and run the program on the Raspberry Pi as documented here.
## How to Install
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 Raspberry Pi, and run the program on the Raspberry Pi as documented here.
```
go get -d -u gobot.io/x/gobot/...
```
@ -66,22 +66,11 @@ Use the following `GOARM` values to compile depending on which model Raspberry P
`GOARM=6` (Raspberry Pi A, A+, B, B+, Zero)
`GOARM=7` (Raspberry Pi 2, 3)
Once you have compiled your code, you can upload your program over the network from your host computer to the Raspi
Once you have compiled your code, you can you can upload your program and execute it on the Raspberry Pi from your workstation using the `scp` and `ssh` commands like this:
```bash
$ scp raspi_blink pi@192.168.1.xxx:/home/pi/
```
and then SSH to your Raspberry Pi
```bash
$ ssh pi@192.168.1.xxx
```
and execute it on the Raspberry Pi itself with
```bash
$ ./raspi_blink
$ ssh -t pi@192.168.1.xxx "./raspi_blink"
```
### Enabling PWM output on GPIO pins.