Cannot send data over USB



  • Hi to all.
    I have one strange problem that and i can not find error / bug in my code.
    I write one external program that used to access to duet. Nothing much,
    the program is sending data from vision system to duet.

    Now, this has worked before without any problems but now i just can not send any data.
    Meanwhile, I did make firmware update but this should have (or has) no affect to this situation.

    Computer and OS is still the same as before and DUET is recognized as OpenMoko at ttyACM0.
    Am using Linux distro Ubuntu 16 / 64 bit. I will attach file that am using for comm settings but if someone has some simpler test code i can use, please share...

    This is the part that i use for comm and "serial" file is in attach....

    try:
                       #ser = serial.Serial("/dev/ttyAMC0", baudrate=115200, timeout=3.0)
                       ser = serial.Serial("/dev/ttyAMC0", baudrate=115200)
    
                       for object in self.current_objects:
                           x, y = object
                           strCode = 'G1 X' + str(x) + ' Y' + str(y) + ' Z5' + ' F1000'
                           ser.write(str.encode(strCode + '\n'))
    
                           # settings for vacuum pump
    
                           if bRecycleBin:
                               if x < 0:
                                   strCode = 'G1 X-200' + 'G1 Y0' + ' Z5' + ' F4000'
                                   ser.write(str.encode(strCode + '\n'))
                               else:
                                   strCode = 'G1 X200' + 'G1 Y0' + ' Z5' + ' F4000'
                                   ser.write(str.encode(strCode + '\n'))
    
                            # settings for vacuum pump
    
                       ser.flush()
                   except: 
                       print("Fail to connect...")
    


  • I forget to write that i have try different baudrate settings and i also try to remove it but nothing changes.
    BTW. it looks like attached file did not pass so am sending again (rename txt to py ).
    serialutil.TXT


Log in to reply