disegnovitruviano / funnel

Automatically exported from code.google.com/p/funnel
Other
0 stars 0 forks source link

fio_simple_scope.rb won't run #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. launch a Funnel Server
2. open fio_simple_scope.rb in TextMate
3. execute the code

What is the expected output? What do you see instead?
This example should run, but got error messages. Here is an example of
error messages:

ScriptMate r8136 running jruby 1.1.3 (ruby 1.8.6 patchlevel 114)
(2008-07-20 rev 7243) [i386-java]
(/Users/kotobuki/Documents/jruby-1.1.3/bin/jruby)
>>> fio_simple_scope.rb

INFO: Ready to use the action-coding environment
command port: localhost, 53227
Rebooted successfully
TimeoutError occurred at configuration: Got no reply for /configure
TimeoutError occurred at start polling: Got no reply for /polling

If I comment the following line, the same code runs without errors.

config.set_digital_pin_mode 12, IN

Please use labels and text to provide additional information.
r515
Mac OS X 10.5.5

Original issue reported on code.google.com by kotob...@gmail.com on 15 Nov 2008 at 1:59

GoogleCodeExporter commented 9 years ago
FirmataIOクラスのsetConfigurationメソッドの最後で、コンフィグ�
��に各ピンの値を通知する
ようにしていた。ここで、Arduinoの場合にはモジュール1個(
IDは0)しか通知していなかった
が、FIOの場合にはブロードキャストを意味する0xFFFFに対し��
�このメソッドが呼ばれるのが通
常である。

しかし、各ピンの値を収めるための配列は65535個しか用意さ
れておらず、0xFFFFで65536番目
の要素にアクセスした際、範囲外へのアクセスになって動��
�が停止、結果的にタイムアウトし
てしまっていた。

そこで、FirmataIOクラスを継承するArduinoIOクラスとFunnelIOクラ
スでこのメソッドをオー
バーライドし、FunnelIOに関してはNode 
Discoveryコマンドで検出されたノードについての
み、各ピンの値を通知するようにした。

http://code.google.com/p/funnel/source/detail?r=516#

なお、この動作はデジタルピンを入力(DINまたはIN)に設定
した場合のみ発生するため、今回
の問題が起きるまで潜伏していたものと思われる。

Original comment by kotob...@gmail.com on 15 Nov 2008 at 6:18