Comments (15)
@myalexer Is your arduino flashed with firmata and are you sure that COM15 is the correct port number? I just tested on windows 7 and it worked for me...
from gobot.
yes i test it with arduino program - in arduino ide port is COM15 - blink program with arduino syntax is ok and it work
from gobot.
how can i found COM port number?
from gobot.
Hi, I also struggled with this problem. it might be an idea for this page: http://gobot.io/documentation/getting-started/ to also tell users to run the firmata example first.
from gobot.
i test it but it can't work
i found port . but led not toggle every second
i use arduino uno ! gobot can interact with arduino uno?
from gobot.
I have the same problem on Arduino uno, but Ubuntu 14.10. It blinks three times no matter what port I set, even when led is not in that port. According to me, my serial port is correct 'ttyACM0'. If I get something I will let you know.
from gobot.
I can run it now!
My problem was that I was not flashed the Arduino with firmata.
http://firmata.org/wiki/Main_Page#Arduino_Uno
I'm not really sure, but, in gobot's getting started documentation there is nothing about firmata.
from gobot.
@LaraChicharo I'll add more documentation about steps for loading firmata on your arduino, sorry for the confusion!
from gobot.
zankich please help me for solved this problem
i start 2 month ago , but still i have problem in blink led !!!!
from gobot.
Yea I;m kinda stuck with Firmata not working also,... amd confused..
from gobot.
Hi guys,
First things first, the process to get the blink example working is as follows:
Upload Firmata Sketch to the Arduino.
You can do this using the Arduino IDE or using (gort.io)[gort.io].
When using the Arduino IDE just click on file > examples > firmata > StandardFirmata and upload that sketch to the arduino.
When using (gort.io)[gort.io] first install it, then run:
# This installs avrdude, which allows to upload the firmata sketch to the arduino
gort arduino install
# Scan serial port for arduino serialport address
gort scan serial
# Upload firmata protocol/sketch to the correct port the arduino is connected to
$ gort arduino upload firmata /dev/ttyACM0
Compile and run arduino_blink.go
Make sure you are using the correct port, in the case of windows you can check the port is the correct one if you can upload an example (like blink sketch) in the arduino IDE. If it uploads and works you should be good. Just update the port in the gobot example and compile.
In Linux is even easier to identify the serial port by using either gort scan serial
or just checking /dev/ttyACM*
.
Compile and run the program, after that it should work fine.
Let me know if that helps.
from gobot.
Hi, everyone
I think the docs located here are sufficient: https://github.com/hybridgroup/gobot/blob/dev/platforms/firmata/README.md
If not, someone can re-open this issue. Thanks, and closing.
from gobot.
Same problem here, Arduino Uno with the firmata firmware flashed fine ( I could use pyFirmata to test), nothing happens, I added some logs in the program to have more information :
package main
import (
"fmt"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/firmata"
)
func main() {
firmataAdaptor := firmata.NewAdaptor("/dev/cu.usbmodem1411")
led := gpio.NewLedDriver(firmataAdaptor, "13")
work := func() {
gobot.Every(1*time.Second, func() {
fmt.Println("Updating LED")
led.Toggle()
})
}
robot := gobot.NewRobot("bot",
[]gobot.Connection{firmataAdaptor},
[]gobot.Device{led},
work,
)
fmt.Println("Starting")
robot.Start()
fmt.Println("Started")
}
2017/01/07 22:43:22 Initializing connections...
2017/01/07 22:43:22 Initializing connection Firmata ...
2017/01/07 22:43:22 Initializing devices...
2017/01/07 22:43:22 Initializing device LED ...
2017/01/07 22:43:22 Robot bot initialized.
Starting
2017/01/07 22:43:22 Starting Robot bot ...
2017/01/07 22:43:22 Starting connections...
2017/01/07 22:43:22 Starting connection Firmata on port /dev/cu.usbmodem1411...
It's not even running the work function.
The TTY port is correct (Detected by Arduino IDE and working fine with pyFirmata)
What could be the cause ?
from gobot.
Ok I found the issue, looks like for master part is missing from the example code, here is the working one :
package main
import (
"fmt"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/firmata"
)
func main() {
gbot := gobot.NewMaster()
firmataAdaptor := firmata.NewAdaptor("/dev/cu.usbmodem1411")
led := gpio.NewLedDriver(firmataAdaptor, "13")
work := func() {
gobot.Every(1*time.Second, func() {
fmt.Println("Updating LED")
led.Toggle()
})
}
robot := gobot.NewRobot("bot",
[]gobot.Connection{firmataAdaptor},
[]gobot.Device{led},
work,
)
gbot.AddRobot(robot)
fmt.Println("Starting")
gbot.Start()
fmt.Println("Started")
}
from gobot.
Hi @kedare the original example code works for me, albeit by changing my serial port to /dev/ttyACM0
as I am on Linux.
$ go run ./examples/check.go
2017/01/08 17:29:05 Initializing connections...
2017/01/08 17:29:05 Initializing connection Firmata ...
2017/01/08 17:29:05 Initializing devices...
2017/01/08 17:29:05 Initializing device LED ...
2017/01/08 17:29:05 Robot bot initialized.
Starting
2017/01/08 17:29:05 Starting Robot bot ...
2017/01/08 17:29:05 Starting connections...
2017/01/08 17:29:05 Starting connection Firmata on port /dev/ttyACM0...
2017/01/08 17:29:10 Starting devices...
2017/01/08 17:29:10 Starting device LED on pin 13...
2017/01/08 17:29:10 Starting work...
Updating LED
Updating LED
Updating LED
Updating LED
Updating LED
Updating LED
Since the v1.0 release you can use "Classic Gobot" as the first example does, so no need for the Master()
part.
I then tested the code on OSX, and both examples worked with my serialport /dev/tty.usbmodem1421
. I suggest you use the tty
vs the cu
version of the serial port on OSX.
Hope that helps!
from gobot.
Related Issues (20)
- roadmap(i2c): MMA8452 3-Axial Accelerometer
- roadmap(I2C): VCNL4010 distance/light sensor module
- roadmap(1-wire): add support for 1-wire protocol HOT 1
- roadmap(serial): create a common serial adaptor HOT 1
- roadmap(ble): implement support for more peripherals HOT 2
- Support for Sphero BOLT HOT 3
- adafruit_driver.go contains shared variables and init() HOT 1
- avoid master/slave terminology HOT 1
- code and test contains data race HOT 2
- PCA9685 wrong initialisation HOT 2
- golangci-lint v1.55.2 is there HOT 1
- raspi with gpio.servo not work (like expected) HOT 1
- HX711 Support HOT 2
- Go 1.22 is released
- Write pwm export() failed for id xx "with open gpiochip0" HOT 4
- Stepper over MCP23017
- Stepper driver DRV8825 HOT 1
- roadmap: API-improvements
- roadmap(GPIO): use variadic constructor functions to allow for additional params, similar to i2c drivers HOT 1
- roadmap(AIO): use variadic constructor functions to allow for additional params, similar to i2c drivers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gobot.