kurbatov / firmata4j

Firmata client written in Java.
MIT License
87 stars 45 forks source link

Can't connect correctly to Uno #50

Open balage1551 opened 3 years ago

balage1551 commented 3 years ago

I've installed StandardFirmata on my Uno R3. I also followed the temporal hack in #48 to avoid crash. Now I try to connect to the device:

        val device: IODevice = FirmataDevice(JSerialCommTransport("COM3")) // using the name of a port
        device.start() // initiate communication to the device
        device.ensureInitializationIsDone() // wait for initialization is done
        device.pins.forEach { p ->
            println(""+p.index +" -> "+p.supportedModes)
        }
        device.stop() // stop communication to the device

But the ensureInitializationIsDone function throws time out exception. Also (though I think it is a consequence of the previous error), listing the pins returns empty set.

Is there any step I missed?

kurbatov commented 3 years ago

Hi Balázs,

The only advice for a quick solution I have is try and see if code from this branch works for you: https://github.com/kurbatov/firmata4j/tree/fix/37-digital-pin-value-message I didn't have a chance to test it by myself (and that's what holds new release) and it may turn out to be broken.

If it doesn't work for you, some in-depth debugging of your setup is needed. Please, try to identify which initialization step hangs.