Topic | Connection stuck after handshaking / Python-API

Home Forums Mooshimeter Support Connection stuck after handshaking / Python-API

This topic contains 3 replies, has 3 voices, and was last updated by  James 6 months, 2 weeks ago.

  • Author
    Posts
  • #16509 Reply

    vincent21
    Participant

    Hi support team,

    I am trying to use the Mooshimeter (firmware 1477971088) via BLED112 on a RaspberryPI 2B (rasbian env).
    I cloned the master branch of the python API but when running the Example.py script the procedure gets stuck at some point (see below):

    17:EB:CB:19:9E:68: -49 1BC5FFA0-0200-62AB-E411-F254E005DBD4
    Connected to 68:9E:19:CB:EB:17
    Interval: 24ms
    Service Groups:
    0018
    0118
    D4DB05E0-54F2-11E4-AB62-0002A0FFC51B
    1: 2800
    2: 2803
    3: 2A00
    4: 2803
    5: 2A01
    6: 2803
    7: 2A02
    8: 2803
    9: 2A03
    10: 2803
    11: 2A04
    12: 2800
    13: 2803
    14: 2A05
    15: 2902
    16: 2800
    17: 2803
    18: 1BC5FFA1-0200-62AB-E411-F254E005DBD4
    19: 2901
    20: 2803
    21: 1BC5FFA2-0200-62AB-E411-F254E005DBD4
    22: 2902
    23: 2901
    Received out of order packet!
    Expected: 1
    Got : 126
    Packet 0
    Packet 1
    Packet 2
    Packet 3
    Packet 4
    Packet 5
    Packet 6
    Packet 7
    Packet 8
    Packet 9
    Packet 10
    Packet 11
    Packet 12
    Packet 13
    Packet 14
    Packet 15
    Packet 16
    Packet 17
    Packet 18
    Packet 19
    Packet 20
    Packet 21
    PLAIN:
    PLAIN:ADMIN
    0:VAL_U32:CRC32
    1:VAL_BIN:TREE
    2:VAL_STR:DIAGNOSTIC
    3:VAL_U8:PCB_VERSION
    4:VAL_STR:NAME
    5:VAL_U32:TIME_UTC
    6:VAL_U16:TIME_UTC_MS
    7:VAL_FLT:BAT_V
    8:CHOOSER:REBOOT
    PLAIN:NORMAL
    PLAIN:SHIPMODE
    PLAIN:SAMPLING
    9:CHOOSER:RATE
    PLAIN:125
    PLAIN:250
    PLAIN:500
    PLAIN:1000
    PLAIN:2000
    PLAIN:4000
    PLAIN:8000
    10:CHOOSER:DEPTH
    PLAIN:32
    PLAIN:64
    PLAIN:128
    PLAIN:256
    11:CHOOSER:TRIGGER
    PLAIN:OFF
    PLAIN:SINGLE
    PLAIN:CONTINUOUS
    PLAIN:LOG
    12:VAL_U8:ON
    13:VAL_U16:INTERVAL
    14:VAL_U8:STATUS
    15:VAL_U8:POLLDIR
    PLAIN:INFO
    16:VAL_U16:INDEX
    17:VAL_U32:END_TIME
    18:VAL_U32:N_BYTES
    PLAIN:STREAM
    19:VAL_U16:INDEX
    20:VAL_U32:OFFSET
    21:VAL_BIN:DATA
    PLAIN:CH1
    22:CHOOSER:MAPPING
    PLAIN:CURRENT
    PLAIN:10
    PLAIN:TEMP
    PLAIN:350
    LINK:SHARED
    23:VAL_U8:RANGE_I
    24:CHOOSER:ANALYSIS
    PLAIN:MEAN
    PLAIN:RMS
    PLAIN:BUFFER
    25:VAL_FLT:VALUE
    26:VAL_FLT:OFFSET
    27:VAL_BIN:BUF
    28:VAL_U8:BUF_BPS
    29:VAL_FLT:BUF_LSB2NATIVE
    PLAIN:CH2
    30:CHOOSER:MAPPING
    PLAIN:VOLTAGE
    PLAIN:60
    PLAIN:600
    PLAIN:TEMP
    PLAIN:350
    LINK:SHARED
    31:VAL_U8:RANGE_I
    32:CHOOSER:ANALYSIS
    PLAIN:MEAN
    PLAIN:RMS
    PLAIN:BUFFER
    33:VAL_FLT:VALUE
    34:VAL_FLT:OFFSET
    35:VAL_BIN:BUF
    36:VAL_U8:BUF_BPS
    37:VAL_FLT:BUF_LSB2NATIVE
    38:CHOOSER:SHARED
    PLAIN:AUX_V
    PLAIN:0.1
    PLAIN:0.3
    PLAIN:1.2
    PLAIN:RESISTANCE
    PLAIN:1000.0
    PLAIN:10000.0
    PLAIN:100000.0
    PLAIN:1000000.0
    PLAIN:10000000.0
    PLAIN:DIODE
    PLAIN:1.2
    39:VAL_FLT:REAL_PWR
    Packet 22
    0:VAL_U32:CRC32:343497802 default handler caught: 343497802
    Packet 23
    9:CHOOSER:RATE default handler caught: 0
    Packet 24
    14:VAL_U8:STATUS default handler caught: 1
    Packet 25
    10:CHOOSER:DEPTH default handler caught: 3
    Packet 26
    11:CHOOSER:TRIGGER default handler caught: 2
    Packet 27
    22:CHOOSER:MAPPING default handler caught: 0
    Packet 28
    23:VAL_U8:RANGE_I default handler caught: 0
    Packet 29
    14:VAL_U8:STATUS default handler caught: 1
    Packet 30
    30:CHOOSER:MAPPING default handler caught: 0
    Packet 31
    5:VAL_U32:TIME_UTC default handler caught: 4260
    6:VAL_U16:TIME_UTC_MS default handler caught: 563
    25:VAL_FLT:VALUE default handler caught: -6.25054017291e-05
    33:VAL_FLT:VALUE default handler caught: -0.000787646742538
    underflow
    Packet 32
    39:VAL_FLT:REAL_PWR default handler caught: 3.02227576299e-08
    Packet 33
    5:VAL_U32:TIME_UTC default handler caught: 4262
    6:VAL_U16:TIME_UTC_MS default handler caught: 815
    25:VAL_FLT:VALUE default handler caught: -6.73135073157e-05
    33:VAL_FLT:VALUE default handler caught: -0.000525097828358
    underflow
    Packet 34
    39:VAL_FLT:REAL_PWR default handler caught: 3.26735190015e-08
    Packet 35
    5:VAL_U32:TIME_UTC default handler caught: 4265
    6:VAL_U16:TIME_UTC_MS default handler caught: 70
    25:VAL_FLT:VALUE default handler caught: -6.25054017291e-05
    33:VAL_FLT:VALUE default handler caught: -0.000262548914179
    underflow
    Packet 36
    39:VAL_FLT:REAL_PWR default handler caught: 2.01731591432e-08
    Packet 37
    5:VAL_U32:TIME_UTC default handler caught: 4267
    6:VAL_U16:TIME_UTC_MS default handler caught: 323
    25:VAL_FLT:VALUE default handler caught: -6.25054017291e-05
    33:VAL_FLT:VALUE default handler caught: -0.000525097828358
    underflow
    Packet 38
    39:VAL_FLT:REAL_PWR default handler caught: 1.24510464161e-08
    Packet 39
    7:VAL_FLT:BAT_V default handler caught: 2.82087898254
    Packet 40
    14:VAL_U8:STATUS default handler caught: 1
    Packet 41
    5:VAL_U32:TIME_UTC default handler caught: 4269
    6:VAL_U16:TIME_UTC_MS default handler caught: 575
    25:VAL_FLT:VALUE default handler caught: -7.69297257648e-05
    33:VAL_FLT:VALUE default handler caught: -0.000525097828358
    underflow
    Packet 42
    39:VAL_FLT:REAL_PWR default handler caught: 2.86645267522e-08
    Packet 43
    5:VAL_U32:TIME_UTC default handler caught: 4271
    6:VAL_U16:TIME_UTC_MS default handler caught: 826
    25:VAL_FLT:VALUE default handler caught: -7.21216201782e-05
    33:VAL_FLT:VALUE default handler caught: -0.000262548914179
    underflow
    Packet 44
    39:VAL_FLT:REAL_PWR default handler caught: 1.40487248501e-08
    Packet 45
    5:VAL_U32:TIME_UTC default handler caught: 4274
    6:VAL_U16:TIME_UTC_MS default handler caught: 80
    25:VAL_FLT:VALUE default handler caught: -6.73135073157e-05
    33:VAL_FLT:VALUE default handler caught: -0.000525097828358
    underflow
    Packet 46
    39:VAL_FLT:REAL_PWR default handler caught: 2.90639459166e-08
    Packet 47
    5:VAL_U32:TIME_UTC default handler caught: 4276
    6:VAL_U16:TIME_UTC_MS default handler caught: 333
    25:VAL_FLT:VALUE default handler caught: -6.73135073157e-05
    33:VAL_FLT:VALUE default handler caught: -0.000525097828358
    underflow
    Packet 48
    39:VAL_FLT:REAL_PWR default handler caught: 2.22245013504e-08
    Packet 49
    7:VAL_FLT:BAT_V default handler caught: 2.81815433502
    Packet 50
    14:VAL_U8:STATUS default handler caught: 1
    Packet 51
    5:VAL_U32:TIME_UTC default handler caught: 4278
    6:VAL_U16:TIME_UTC_MS default handler caught: 583
    25:VAL_FLT:VALUE default handler caught: -6.73135073157e-05
    33:VAL_FLT:VALUE default handler caught: -0.000262548914179
    underflow
    Packet 52
    39:VAL_FLT:REAL_PWR default handler caught: 1.28849837466e-08
    Packet 53
    5:VAL_U32:TIME_UTC default handler caught: 4280
    6:VAL_U16:TIME_UTC_MS default handler caught: 835
    25:VAL_FLT:VALUE default handler caught: -5.76972961426e-05
    33:VAL_FLT:VALUE default handler caught: -0.000262548914179
    underflow
    Packet 54
    39:VAL_FLT:REAL_PWR default handler caught: 7.72211361522e-09
    Packet 55
    5:VAL_U32:TIME_UTC default handler caught: 4283
    6:VAL_U16:TIME_UTC_MS default handler caught: 88
    25:VAL_FLT:VALUE default handler caught: -6.25054017291e-05
    33:VAL_FLT:VALUE default handler caught: -0.000262548914179
    underflow
    Packet 56
    39:VAL_FLT:REAL_PWR default handler caught: 1.97293594795e-08
    Packet 57
    5:VAL_U32:TIME_UTC default handler caught: 4285
    6:VAL_U16:TIME_UTC_MS default handler caught: 340
    25:VAL_FLT:VALUE default handler caught: -6.25054017291e-05
    33:VAL_FLT:VALUE default handler caught: -0.000262548914179
    underflow
    Packet 58
    39:VAL_FLT:REAL_PWR default handler caught: 4.59086102467e-09
    Packet 59
    5:VAL_U32:TIME_UTC default handler caught: 4287
    6:VAL_U16:TIME_UTC_MS default handler caught: 591
    25:VAL_FLT:VALUE default handler caught: -6.25054017291e-05
    33:VAL_FLT:VALUE default handler caught: -0.000262548914179
    underflow
    Packet 60
    39:VAL_FLT:REAL_PWR default handler caught: 8.04756794537e-09
    Packet 61
    7:VAL_FLT:BAT_V default handler caught: 2.81906247139
    Packet 62
    14:VAL_U8:STATUS default handler caught: 1
    Packet 63

    After that point, nothing else appends. Also I checked the batteries, and I tried to push the reset button but non of these worked.
    Any insight on how I can fix it?
    Thanks

  • #19054 Reply

    Wei LUO

    I am experiencing the same problems when running the Example.py. Have you found the solutions to this yet? Thanks.

    Regards
    Wei

  • #19426 Reply

    John

    Hi all,
    I’m experiencing the same problem with firmware 1477971088.
    Does anyone have a solution yet?
    Thanks,
    John

  • #19489 Reply

    James
    Keymaster

    Hi guys,

    I think I talked to Wei and John over email and tracked the issue down to the fact that a heartbeat was not being sent from the PC side.

    The Mooshimeter will automatically disconnect after about 20 seconds if it does not receive any new commands or requests from the master. This feature is to get around an Android bug where Android would maintain a connection to the Mooshimeter but not share that connection with the app, effectively making the meter unusable until the user rebooted their phone.

    The iOS, Android and Python interfaces all ask the meter for its PCB version every 10 seconds as a heartbeat.

    Hope this is useful to future readers.
    ~James

Reply To: Connection stuck after handshaking / Python-API
Your information: