tino / pyFirmata

Python interface for the Firmata (http://firmata.org/) protocol. It is compliant with Firmata 2.1. Any help with updating to 2.2 is welcome. The Capability Query is implemented, but the Pin State Query feature not yet.
MIT License
575 stars 193 forks source link

Sending text to display no longer working? < board.send_sysex( STRING_DATA, util.str_to_two_byte_iter( text ) ) > #128

Open nildude opened 9 months ago

nildude commented 9 months ago

Hi fellow tinkers,

I am suddenly having issues writing outputs to my DF Robot 2x16 LDC display. I was previously able to direct all text messages to the display but installing the latest version of pyFirmata has resulted in text not showing up:

I am using the board.send_sysex( STRING_DATA, util.str_to_two_byte_iter( text ) ) method.

I am not getting any error codes and not sure how to further troubleshoot?

The python code looks like this:

import pyfirmata
from pyfirmata import Arduino, util, STRING_DATA

# Setting up Arduino
if __name__ == '__main__':
    board = pyfirmata.Arduino('COM4') # '/dev/ttyACM0'
    #board = pyfirmata.Arduino('/dev/ttyACM0') # '/dev/ttyACM0'
    print("Communication Successfully started")

it = pyfirmata.util.Iterator(board)
it.start()

def msg( text ):
    if text:
        board.send_sysex( STRING_DATA, util.str_to_two_byte_iter( text ) )

if __name__ == '__main__': 
 msg('Testing test')
 msg('Second line') 

Thank you for your assistance.

Best regards Lars Henrik

nildude commented 9 months ago

It seems like the "Firmata.attach( STRING_DATA, stringDataCallback);" function is not receiving the STRING_DATA object? Any ideas?