dmitryelj / RPi-P2000Receiver

P2000 paging autonomous receiver with LCD and browser access
16 stars 7 forks source link

Data thread stopped #17

Open djoey123 opened 4 years ago

djoey123 commented 4 years ago

Hi,

I got this error.

FLEX|2020-06-13 16:40:37|1600/2/K/A|10.029|002029568 001423381 001423001 001420999|ALN|B1 AMBU 18181 Weegje 3295CT 's-Gravendeel SGRAVD bon 71858 POST: { "body": "B1 AMBU 18181 Weegje 3295CT 's-Gravendeel SGRAVD bon 71858", "capcodes": [ "AMBU" ], "groupid": "001420999|ALN|B1", "is_posted": false, "priority": 3, "receivers": "AMBU", "sender": 0, "timereceived": 1592066437.2198057, "timestamp": "16:40:37|1600/2/K/A|10.029|002029568 001423381" } dataThreadFunc::Error in line: <class 'IndexError'> p2000.py 606 list index out of range Data thread stopped

Any idea why?

djoey123 commented 4 years ago

I see the format is something different then expected

djoey123 commented 4 years ago

line_data = line.split('|') flex = line_data[0] timestamp = line_data[1] message = line_data[6] groupid = line_data[3].strip() capcode = line_data[4] # line[43:52].strip()

This fixes for me :)