Hi Rolando
Quickly skimming your code I would guess you may be getting read
timeouts in your _binary_read function.
As a first step try setting the timeout of the serial port to zero then
the read function should block indefinitely. If this is in fact the
problem a better solution would to leave the timeout in place change to
loop to iterate until you have all the data (while sizeof(output) <
size) and not for a fixed *for i in range(num_pkts): *where some
iterations are lost to timeouts.
Kind regards
Craig
Craig Tong
Digital Engineer
African VLBI Network
SKA South Africa
+27 21 506 7300 (ext 7378)
SKA Logos
On 2015-11-12 00:02, Rolando Paz wrote:
> Hi
>
> If any one can give me your advices I will apreciate the help.
>
> For some reason the struct.unpack argument receives only 71 bytes,
> when should receive 4096 bytes.
>
> I placed several prints in the code.
>
>
> rolando@rolando-MS-7815:~/poco_arte$ sudo python plot_auto.py
> i4_c1024_arte.config
>
> Parsing config file i4_c1024_arte.config...OK
> Connecting to IBOB on port /dev/ttyUSB0.
> listdev
>
> Address map :
>
> <NO ADDR> -> XSG core config
>
> <NO ADDR> -> XSG core config
>
> 0xD0000000 -> acc_num
>
> Trying to decode address of
> 0xD0000000 -> acc_num
> 13 9 48 120 68 48 48 48 48 48 48 48 32 45 62 32 97 99 99 95 110 117
> 109 10
> This is the address of register or bram 3489660928
> 0xD0000100 -> ant0_sum_sq
>
> Trying to decode address of
> 0xD0000100 -> ant0_sum_sq
> 13 9 48 120 68 48 48 48 48 49 48 48 32 45 62 32 97 110 116 48 95 115
> 117 109 95 115 113 10
> This is the address of register or bram 3489661184
> 0xD0000200 -> ant1_sum_sq
>
> Trying to decode address of
> 0xD0000200 -> ant1_sum_sq
> 13 9 48 120 68 48 48 48 48 50 48 48 32 45 62 32 97 110 116 49 95 115
> 117 109 95 115 113 10
> This is the address of register or bram 3489661440
> 0xD0000300 -> ant2_sum_sq
>
> Trying to decode address of
> 0xD0000300 -> ant2_sum_sq
> 13 9 48 120 68 48 48 48 48 51 48 48 32 45 62 32 97 110 116 50 95 115
> 117 109 95 115 113 10
> This is the address of register or bram 3489661696
> 0xD0000400 -> ant3_sum_sq
>
> Trying to decode address of
> 0xD0000400 -> ant3_sum_sq
> 13 9 48 120 68 48 48 48 48 52 48 48 32 45 62 32 97 110 116 51 95 115
> 117 109 95 115 113 10
> This is the address of register or bram 3489661952
> 0xD0000500 -> ctrl_sw
>
> Trying to decode address of
> 0xD0000500 -> ctrl_sw
> 13 9 48 120 68 48 48 48 48 53 48 48 32 45 62 32 99 116 114 108 95 115
> 119 10
> This is the address of register or bram 3489662208
> 0xD0000600 -> delay_a
>
> Trying to decode address of
> 0xD0000600 -> delay_a
> 13 9 48 120 68 48 48 48 48 54 48 48 32 45 62 32 100 101 108 97 121 95
> 97 10
> This is the address of register or bram 3489662464
> 0xD0000700 -> delay_b
>
> Trying to decode address of
> 0xD0000700 -> delay_b
> 13 9 48 120 68 48 48 48 48 55 48 48 32 45 62 32 100 101 108 97 121 95
> 98 10
> This is the address of register or bram 3489662720
> 0xD0000800 -> delay_c
>
> Trying to decode address of
> 0xD0000800 -> delay_c
> 13 9 48 120 68 48 48 48 48 56 48 48 32 45 62 32 100 101 108 97 121 95
> 99 10
> This is the address of register or bram 3489662976
> 0xD0000900 -> delay_d
>
> Trying to decode address of
> 0xD0000900 -> delay_d
> 13 9 48 120 68 48 48 48 48 57 48 48 32 45 62 32 100 101 108 97 121 95
> 100 10
> This is the address of register or bram 3489663232
> 0xD0000A00 -> eq_coeff
>
> Trying to decode address of
> 0xD0000A00 -> eq_coeff
> 13 9 48 120 68 48 48 48 48 65 48 48 32 45 62 32 101 113 95 99 111 101
> 102 102 10
> This is the address of register or bram 3489663488
> 0xD0002000 -> ibob_lwip/ethlite
>
> Trying to decode address of
> 0xD0002000 -> ibob_lwip/ethlite
> 13 9 48 120 68 48 48 48 50 48 48 48 32 45 62 32 105 98 111 98 95 108
> 119 105 112 47 101 116 104 108 105 116 101 10
> This is the address of register or bram 3489669120
> <NO ADDR> -> ibob_lwip/lwip
>
> 0xD0004000 -> ibob_lwip/macbits
>
> Trying to decode address of
> 0xD0004000 -> ibob_lwip/macbits
> 13 9 48 120 68 48 48 48 52 48 48 48 32 45 62 32 105 98 111 98 95 108
> 119 105 112 47 109 97 99 98 105 116 115 10
> This is the address of register or bram 3489677312
> <NO ADDR> -> ibob_lwip/machdr
>
> <NO ADDR> -> led1_sync_rnd
>
> <NO ADDR> -> led2_sync_gen
>
> <NO ADDR> -> led4_eq_clip
>
> <NO ADDR> -> quadc0
>
> 0xD1000000 -> sync_gen/period
>
> Trying to decode address of
> 0xD1000000 -> sync_gen/period
> 13 9 48 120 68 49 48 48 48 48 48 48 32 45 62 32 115 121 110 99 95 103
> 101 110 47 112 101 114 105 111 100 10
> This is the address of register or bram 3506438144
> 0xD1002000 -> xengine/aa/real
>
> Trying to decode address of
> 0xD1002000 -> xengine/aa/real
> 13 9 48 120 68 49 48 48 50 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 97 97 47 114 101 97 108 10
> This is the address of register or bram 3506446336
> 0xD1004000 -> xengine/ab/imag
>
> Trying to decode address of
> 0xD1004000 -> xengine/ab/imag
> 13 9 48 120 68 49 48 48 52 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 97 98 47 105 109 97 103 10
> This is the address of register or bram 3506454528
> 0xD1006000 -> xengine/ab/real
>
> Trying to decode address of
> 0xD1006000 -> xengine/ab/real
> 13 9 48 120 68 49 48 48 54 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 97 98 47 114 101 97 108 10
> This is the address of register or bram 3506462720
> 0xD1008000 -> xengine/ac/imag
>
> Trying to decode address of
> 0xD1008000 -> xengine/ac/imag
> 13 9 48 120 68 49 48 48 56 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 97 99 47 105 109 97 103 10
> This is the address of register or bram 3506470912
> 0xD100A000 -> xengine/ac/real
>
> Trying to decode address of
> 0xD100A000 -> xengine/ac/real
> 13 9 48 120 68 49 48 48 65 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 97 99 47 114 101 97 108 10
> This is the address of register or bram 3506479104
> 0xD100C000 -> xengine/ad/imag
>
> Trying to decode address of
> 0xD100C000 -> xengine/ad/imag
> 13 9 48 120 68 49 48 48 67 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 97 100 47 105 109 97 103 10
> This is the address of register or bram 3506487296
> 0xD100E000 -> xengine/ad/real
>
> Trying to decode address of
> 0xD100E000 -> xengine/ad/real
> 13 9 48 120 68 49 48 48 69 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 97 100 47 114 101 97 108 10
> This is the address of register or bram 3506495488
> 0xD1010000 -> xengine/bb/real
>
> Trying to decode address of
> 0xD1010000 -> xengine/bb/real
> 13 9 48 120 68 49 48 49 48 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 98 98 47 114 101 97 108 10
> This is the address of register or bram 3506503680
> 0xD1012000 -> xengine/bc/imag
>
> Trying to decode address of
> 0xD1012000 -> xengine/bc/imag
> 13 9 48 120 68 49 48 49 50 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 98 99 47 105 109 97 103 10
> This is the address of register or bram 3506511872
> 0xD1014000 -> xengine/bc/real
>
> Trying to decode address of
> 0xD1014000 -> xengine/bc/real
> 13 9 48 120 68 49 48 49 52 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 98 99 47 114 101 97 108 10
> This is the address of register or bram 3506520064
> 0xD1016000 -> xengine/bd/imag
>
> Trying to decode address of
> 0xD1016000 -> xengine/bd/imag
> 13 9 48 120 68 49 48 49 54 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 98 100 47 105 109 97 103 10
> This is the address of register or bram 3506528256
> 0xD1018000 -> xengine/bd/real
>
> Trying to decode address of
> 0xD1018000 -> xengine/bd/real
> 13 9 48 120 68 49 48 49 56 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 98 100 47 114 101 97 108 10
> This is the address of register or bram 3506536448
> 0xD101A000 -> xengine/cc/real
>
> Trying to decode address of
> 0xD101A000 -> xengine/cc/real
> 13 9 48 120 68 49 48 49 65 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 99 99 47 114 101 97 108 10
> This is the address of register or bram 3506544640
> 0xD101C000 -> xengine/cd/imag
>
> Trying to decode address of
> 0xD101C000 -> xengine/cd/imag
> 13 9 48 120 68 49 48 49 67 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 99 100 47 105 109 97 103 10
> This is the address of register or bram 3506552832
> 0xD101E000 -> xengine/cd/real
>
> Trying to decode address of
> 0xD101E000 -> xengine/cd/real
> 13 9 48 120 68 49 48 49 69 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 99 100 47 114 101 97 108 10
> This is the address of register or bram 3506561024
> 0xD1020000 -> xengine/dd/real
>
> Trying to decode address of
> 0xD1020000 -> xengine/dd/real
> 13 9 48 120 68 49 48 50 48 48 48 48 32 45 62 32 120 101 110 103 105
> 110 101 47 100 100 47 114 101 97 108 10
> This is the address of register or bram 3506569216
> Grabbing spectrum number 1
> Sleeping in 1 for 2 Seconds
> This is the read address 3506446336
> num_pkts 9
> st_offset 0
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 127
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 254
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 381
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 508
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 635
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 762
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 889
> request_size 127
> this is the address 3506446336
> what is being written 6
> st_offset 1016
> request_size 8
> this is the address 3506446336
> what is being written 6
> length argument 71
> Traceback (most recent call last):
> File "plot_auto.py", line 74, in updatefig
> inputs[input] = brd.read_uint(bram_map[input], size=n_chans)
> File "/home/rolando/poco_arte/poco/ibob_serial.py", line 89, in
> read_uint
> out=struct.unpack('>%iL'%size,check)
> struct.error: unpack requires a string argument of length 4096
>
>
> Best Regards
>
> RP
>