Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Taking a journey with python3

  1. #11

    Re: Taking a journey with python3

    More hints, if the above does not work, then maybe time to add some diagnostics stuff to your code.

    Things like: Maybe have the Arbotix blink led once if it receives what you think is a valid packet and blink multiple times if it receives some invalid data.

    Or maybe have it echo the data back to you, and have your python code print out what data it received back (probably converted to Hex ascii text).

    If it were me, I would hook up logic Analyzer and actually look at the data...

  2. Re: Taking a journey with python3

    That hasnt made any difference either :/

  3. Re: Taking a journey with python3

    That hasnt made any difference :/

  4. Re: Taking a journey with python3

    I mean the LED that shows a connection flashes everytime i try to send so i think its getting there i just dont know whats wrong with what im sending. Ive also been printing stuff as my debug method and i wish i had a logic analyzer lol

  5. #15

    Re: Taking a journey with python3

    Again in all cases like this it would help if you actually show your complete programs and maybe pictures of hook up... As such that maybe someone can replicate your program...

    On my RPI3, I ran the following: $ python3 ./led_on.py

    Where led_on.py is:
    Code:
    #!/usr/bin/env python
    
    import serial
    port = '/dev/ttyUSB0'
    baud = 38400
    
    
    ser = serial.Serial(port, baud)
    ser.flushInput()
    ser.flushOutput()
    
    
    ser.write(b'0xff')
    ser.write(b'0xff')
    ser.write(b'0xfe')
    ser.write(b'0x04')
    ser.write(b'0x03')
    ser.write(b'0x19')
    ser.write(b'0x01')
    ser.write(b'0xe0')
    ser.flush()
    ser.close()
    I then looked at what was output, by simply hooking up my logic analyzer to the FTDI cable.

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	24 
Size:	27.6 KB 
ID:	7113
    What you will see is the lines like: ser.write(b'0xff')
    Actually output the ASCII characters: 0xff
    Not the single byte value 0xff

    Hopefully @jwatte knows more here as I see you are on this thread

  6. #16

    Re: Taking a journey with python3

    You are providing strings to the write() function, so yes, it's writing strings.
    However, you have expressed the string constants wrong -- Python uses \x, not 0x, for escape characters.
    Instead, do this:
    Code:
    ser.write(b'\xff\xff\xfe\x04\x03\x19\x01\xe0')

  7. Re: Taking a journey with python3

    Hello,

    I am back. I have tried what you suggested to no avail. Since I last replied I have been trying it on a Windows OS to see if it was my serial port but nothing has changed. Originally I was trying it off a Raspberry Pi. Does anyone have any other ideas?

  8. #18

    Re: Taking a journey with python3

    Your next step in debugging:
    Hook up a logic analyzer on the serial output wires, and see what's actually being written.
    I recommend a Saleae Logic analyzer of some sort.
    (Although it seems they dropped the lowest-cost Logic 4 unit, and also raised prices slightly -- still, they are good hardware with great software support!)

  9. #19

    Re: Taking a journey with python3

    Yes - I also second using a Saleae logic analyzer...

    FYI - I have a Dynamixel Analyzer that originally was started by user r3n33. Currently I am in the process of adding Protocol 2 support for decoding messages and adding the X series registers... It still is a WIP but getting reasonable...

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	18 
Size:	34.9 KB 
ID:	7158

    Also in any thing like this, I recommend posting the actual sources you are trying and anything else needed for someone to reproduce the problem... Which version of python, what type of RPI. What OS...

  10. Re: Taking a journey with python3

    Quote Originally Posted by KurtEck View Post
    Yes - I also second using a Saleae logic analyzer...

    FYI - I have a Dynamixel Analyzer that originally was started by user r3n33. Currently I am in the process of adding Protocol 2 support for decoding messages and adding the X series registers... It still is a WIP but getting reasonable...

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	18 
Size:	34.9 KB 
ID:	7158

    Also in any thing like this, I recommend posting the actual sources you are trying and anything else needed for someone to reproduce the problem... Which version of python, what type of RPI. What OS...
    Should a logic analyzer be the way to go? Or could I get another pass-through device like the USB2AX? The code im trying to use is my own from scratch it has been posted earlier in the thread, python 3 as the title says, Raspberry Pi 3 model B, Rasbian.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dan's ROS Journey
    By TXBDan in forum ROS - Robot Operating System
    Replies: 10
    Last Post: 08-26-2016, 11:52 AM
  2. Question(s) designing board - taking 3.3V from the OPEN CM9?
    By fabrice in forum Arbotix, Microcontrollers, Arduino
    Replies: 1
    Last Post: 04-28-2016, 12:24 PM
  3. Project Project BETH aka Dan's journey into a lot of things.
    By TXBDan in forum Humanoids, Walkers & Crawlers
    Replies: 32
    Last Post: 02-14-2014, 09:15 AM
  4. Big Congrats to lnxfergy for taking Gold on Mech Warfare!
    By DresnerRobotics in forum Mech Warfare
    Replies: 6
    Last Post: 06-16-2009, 10:07 PM
  5. News/Announcement Now taking Pre-Orders on the Bioloid Boomerang Zigbee Controller!
    By DresnerRobotics in forum Humanoids, Walkers & Crawlers
    Replies: 6
    Last Post: 10-25-2008, 09:51 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •