Issue with Changing BaudRate of Allsky-340M

Discussion in 'Scripting and Programming' started by yxu, Sep 15, 2016.

  1. yxu

    yxu Standard User

    Joined:
    Sep 15, 2016
    Messages:
    3
    Hi,

    I'm using python script to control the Allsky-340M with serial specification from ftp://sbig.com/pub/devsw/SG4_AllSky-340_SerialSpec.pdf
    The camera works just fine with the initial baud rate 9600. However, that's very slow for downloading image. I want to change it to higher baud rate.
    According to that doc, if I send command 'B#' (# is a number from 0 to 6) to set baud rate to the value those numbers represent, i should get a respond 'S'. But I only got 'S' when I sent 'B0' which represents 9600 the initial setting. When I tried 'B1', I got '\xf1', and when I tried 'B2', I got '\xfe'
    The next step according to the doc would be to do ser.baudrate = new_rate (which I did). And then send 'Test", and the respond should be 'TestOk'. But I didn't get any respond for my 'Test' command.

    Has this ever happened to any of you? Or anyone has a suggestion how to change baud rate?

    Thanks!

    p.s. I use a mac pro
     
  2. Colin Haig

    Colin Haig Staff Member

    Joined:
    Oct 27, 2014
    Messages:
    3,596
    I suspect the reason you are getting garbage back is that the response is at the NEW baud rate.
    e.g. if you send B1, you'd better expect to get the response at the faster rate, eg 19200 or whatever.
     
  3. yxu

    yxu Standard User

    Joined:
    Sep 15, 2016
    Messages:
    3
    After I send B1, I changed the baud rate to 19200, then did the ser.read(). Still only got nonsense
     
  4. aaron archibald

    aaron archibald Standard User

    Joined:
    Sep 14, 2016
    Messages:
    6
    I have the same issue. I follow the protocol to the letter and I am not able to change the baud rate. But actually, no matter what baud rate I attempt to set to ("B0-6"), I get the "S" response back at the CURRENT baud rate and it never changes on the camera.

    I was however able to use the SBIG Allsky windows application to connect and set the baud rate to 460800, then go back to my script and just start communicating at that rate. So, its set, but not sure why the procedure in the protocol didn't work.

    yxu:

    are you able to retrieve an image from the camera using the procedure from the protocol?? I can not. I sent the "T"+5byte command successfully, and the camera returns the expected number of E's R's and "D" when its done exposing.

    I then send the "X" command and get the expected 2048 bytes + 1 checksum byte back from the camera.

    the protocol says if its all good, send "K" == Check-sum okay, continue transfer

    so I send "K" but the camera does not reply at all.

    additionally, sending "R" or "S" don't get the expected results as described by the protocol.

    yxu, did the protocol for transferring an image work for you??

    I'm wondering what versions of the firmware this protocol is valid for...

    thanks for any help,
    -Aaron
     
  5. yxu

    yxu Standard User

    Joined:
    Sep 15, 2016
    Messages:
    3
    Hi Aaron,

    I could take a picture. Then I release that the downloading time is just too long because of the baudrate. The script I'm using is this one https://github.com/badders/pyallsky. Even in this script it says changing baud rate doesn't work yet :p

    I thought about changing it on the windows app too. If I really couldn't make this work with python, I guess I would go there.

    Best,
    yxu
     

Share This Page