reapzor / FiloFirmata

MIT License
7 stars 2 forks source link

Example does not work #4

Open Tf19 opened 5 years ago

Tf19 commented 5 years ago

If I'm not completely wrong, that should work:

public static void main(String[] args) throws InterruptedException, IOException { Firmata firmata = new Firmata("COM8"); Thread.sleep(3000); firmata.start(); firmata.sendMessage(new SetDigitalPinValueMessage(13, DigitalPinValue.HIGH)); }

But I only get this error:

Dez 16, 2018 10:15:51 PM com.bortbort.arduino.FiloFirmata.PortAdapters.PureJavaCommSerialPort openPort INFORMATION: Connecting to port COM8 at baudrate 57600 with databits setting DATABITS_8, stopbits setting STOPBITS_1, and parity setting PARITY_NONE. Timeout: 2s Dez 16, 2018 10:15:51 PM com.bortbort.arduino.FiloFirmata.Firmata testProtocolCommunication INFORMATION: Detected Firmata device protocol version: 2.5

reapzor commented 5 years ago

Could you try firmata.sendMessage(new SystemResetMessage()); to see if the arduino board reboots? You can also try disabling the port communication and version check with firmataConfiguration.setTestProtocolCommunication(false); using a configuration object instead of just the port number. If you can, please see if the arduino board is receiving the command to set the digital pin value. I think you can print out the serial data s

I haven't touched this library for a couple years so there's a chance the library is broken somewhere with interop to the arduino board, or something else.

At least it seems like its getting some communication to the board, as it is detecting the protocol version. Why it isn't doing anything after that, may need some help looking into it if you already have the dev environment setup.