Closed crosson closed 11 years ago
Well it works fine in OSX. Same configuration.
-Ruby 1.9.3 -Arduino Uno
The system it was not working on was a Windows 7 box. Am I missing a step somewhere on windows?
It doesn't work from my Windows 7 machine either. I was able to manually send commands through the Arduino IDE serial monitor ie: !001301. !011301. to turn on a LED on pin 13 and the board behaved as expected. Also, I tested the serielport gem itself and was able to establish two way communication. So at least I was able to rule out the arduino code and serialport gem as the problem.
Found the problem. There is no logic to determine which port in Windows is the arduino board. The find_arduino method from tx_rx.rb will always return serial port COM1 or the first port listed from the tty_devices method.
I know the port I need is COM3, changing COM1 to COM3 in the tty_devices method gets everything working fine for me.. For now I'll be hard coding my port config, unless someone knows how to automagically detect it in win7.
Interesting. Glad it wasn't just my system. This is likely what my problem was as well since I was on COM3.
I do not have access to a windows system but would love to see a pull request to support it. I think @j3 did some work on it but never finshed
I don't have access to a Windows machine either, but looking at du.ino
, there's a handler for turning debug mode on and off. It prints "hello" or "goodbye" respectively to the serial connection when debug is set to true or false.
Maybe try enumerating through the COM ports until one responds to the message with the appropriate response?
Also the arduino IDE has support for serial logging so you may be able to find out how they do it.
Is this issues solved?
Sorta. It'll search up to COM9, but I've seen COM ports higher than even that. It should probably just enumerate up to 256.
I can run ino scripts on their own but when I try to upload du.ino and run the led.rb example script nothing happens. When I run the script the led blinks a few times then nothing. I'm probably doing something wrong....