Waziup / WaziGate

Waziup LoRa Edge gateway
21 stars 20 forks source link

list index out of range #59

Closed cdupont closed 4 years ago

cdupont commented 4 years ago

I switched back on my gateway today. This is what I got in the system logs:

2020-01-07T17:50:17.207439324Z Traceback (most recent call last):
2020-01-07T17:50:17.207567969Z   File "/app/data_acq/edgeCall.py", line 151, in 
2020-01-07T17:50:17.207600052Z     data = { data_array[i]: data_array[i+1] for i in range(0, len( data_array), 2)};
2020-01-07T17:50:17.207627291Z   File "/app/data_acq/edgeCall.py", line 151, in 
2020-01-07T17:50:17.207655155Z     data = { data_array[i]: data_array[i+1] for i in range(0, len( data_array), 2)};
2020-01-07T17:50:17.207681249Z IndexError: list index out of range
mojtaba-esk commented 4 years ago

We have changed it completely. No python anymore

cdupont commented 4 years ago

Cool. It was because I had a trailing slash: UID/MyDevice/TC/22.00/HUM/32.00/ I think the protocol should support additional slashes (at the end or anywhere). @j-forster

Anyway, as a key-value format, I think using only slashes as a separator is a bit confusing. It would have been better to define two separators; one between key and value, and one between pairs. For example: UID=MyDevice;TC=22.00;HUM=32.00. (just a thought)