• Thanks Gordon,
    I have tried your suggestion but bleak throws an error, which I will show below.
    My single quotes show jason.dump etc as before. This is also below.
    However I am confused, as per conversation with fanoush, I thought my problem is for my function to convert the bytearray back to a string using javascript. ( Icant find a way to do this yet) but any clarity on this matter would help.
    With the following

    command = "Y("+json.dumps(dict)+")\n"
    
    

    gives an error. Note I am not convinced that this is due to the command line as bleak seems a bit unstable.

    File "/home/pi/.local/lib/python3.7/site-pack­ages/bleak/backends/bluezdbus/client.py"­, line 146, in connect
        raise BleakError(str(e))
    bleak.exc.BleakError: org.bluez.Error.Failed: Software caused connection abort
    

    With this

    command = "Y('+json.dumps(dict)+')\n"
    
    ``Console gives
    
    

    Connecting...
    Connected
    Writing command
    RX> bytearray(b"Y(\'+json.dumps(dict)")
    RX> bytearray(b"Y(\'+json.dumps(dict)")
    RX> bytearray(b"+\')")
    RX> bytearray(b"+\')")
    RX> bytearray(b'\r\n')
    RX> bytearray(b'\r\n')
    Waiting for data
    RX> bytearray(b'=undefined\r\n>')
    RX> bytearray(b'=undefined\r\n>')
    Done!

    The watch displays
    
    

    +json.dumps(dict)+
    ```

About

Avatar for user118216 @user118216 started