Rob

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Powering RPI Zero from AlphaClock #29783
    Rob
    Participant

    I just wanted to follow up and say thanks. I ended up using this https://www.adafruit.com/product/1385 and it worked perfectly.

    Thank you!

    in reply to: Powering RPI Zero from AlphaClock #29782
    Rob
    Participant

    Ah that’s a good idea. I’ll explore that direction. Thanks for the suggestion!

    in reply to: Powering RPI Zero from AlphaClock #29780
    Rob
    Participant

    It’s the white Alpha Clock Five.

    in reply to: python: Trouble with connecting via pyserial/FTDIfriend #29716
    Rob
    Participant

    Following up for closure. After a sleeping on it, I realized my code was occasionally sending over a 3 or 4 letter word without whitespace padding to equal it all up to five characters. This meant that I was not sending over the complete 13 byte command that the clock was expecting, and thus my subsequent command was appended to the previous command. As I hadn’t been resetting the clock, this truncation was being compounded and even my simple debug code was being affected by it.

    Thanks for your help (I also took your advice and got python 3.9 and pyserial2.5 running.)

    Cheers!

    Sample code to recreate the problem:

    
    import serial
    import time
    ser = serial.Serial('/dev/cu.usbserial-AC013VIR', baudrate=19200)
    time.sleep(3)
    theseWordsWork = ["TRUSS", "SPIED", "WHACK", "BOGUS", "METER", "SLIDE"]
    theseWordsDontWork = ["TRUSS", "SPIE", "WHAC", "BGUS", "METER", "SLIDE"]
    for word in theseWordsDontWork:
        header = b'\xFF'
        command = b'A0'
        data = word.encode()
        space = b'     '
        ser.write(header + command + data + space)
        time.sleep(1)
    ser.close()
    
    in reply to: python: Trouble with connecting via pyserial/FTDIfriend #29711
    Rob
    Participant

    Actually scratch that, once I added more 500ms delays between each .write() method, I am able to get it to work reliably as expected.

    Do you understand why the timing is so much more touchy in python than it is in processing?

    Cheers, and thanks for your help!

    in reply to: python: Trouble with connecting via pyserial/FTDIfriend #29710
    Rob
    Participant

    Thanks for the reply.
    Things are perfectly stable otherwise. In fact, I’m able to interface with the clock exactly as expected using processing. It’s only once I tried to port my work over to python that I encountered this problem.

    There’s no reset happening from what I can tell, and I’ve tried adding in a delay, but this hasn’t had any affect.

    I’m running the code using the pycharm IDE in a virtual python2.7 environment (because I was having a hard time getting pyserial to play nice with my local python3 runtime). Do you think my environment could somehow be to blame?

Viewing 6 posts - 1 through 6 (of 6 total)