Coder Social home page Coder Social logo

Decoder index out of range about ruuvitag-sensor HOT 9 CLOSED

ttu avatar ttu commented on May 18, 2024
Decoder index out of range

from ruuvitag-sensor.

Comments (9)

quulah avatar quulah commented on May 18, 2024

It may be a bit hard to tell what's wrong based on that. One interesting thing is that my own code's debug says that it last got data at 2019-02-11 08:38:31,679. I don't know what has been done for 6 hours. :)

I also intermittently get these:

2019-02-11 15:14:15,695 WARNING -       type_converters.py:193 -          from_hcipayload(): TODO: Unhandled GAP type, pos=35 type=0x0a len=2
2019-02-11 15:14:15,696 WARNING -       type_converters.py:194 -          from_hcipayload(): Data: 01 00 00 e2 e7 86 a1 41 2c 1c 02 01 19 07 03 be fe 26 fe 03 fe 0d ff 01 09 51 12 d7 13 ae bb 24 8c c2 bf 02 0a f6 
2019-02-11 15:14:15,697 WARNING -       type_converters.py:195 -          from_hcipayload(): POS : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 
2019-02-11 15:14:17,339 WARNING -       type_converters.py:193 -          from_hcipayload(): TODO: Unhandled GAP type, pos=35 type=0x0a len=2
2019-02-11 15:14:17,340 WARNING -       type_converters.py:194 -          from_hcipayload(): Data: 01 00 00 e2 e7 86 a1 41 2c 1c 02 01 19 07 03 be fe 26 fe 03 fe 0d ff 01 09 51 12 d7 13 ae bb 24 8c c2 bf 02 0a f6 

I'm not sure if they are related.

from ruuvitag-sensor.

ojousima avatar ojousima commented on May 18, 2024

I've noticed that running 2 BLE programs at the same time can cause corrupted data, for example if I run Noble (NodeJS BLE) and ruuvitag-sensor at the same time there's a load of hard-to-replicate bugs on both programs. Might be related?

from ruuvitag-sensor.

quulah avatar quulah commented on May 18, 2024

In my case, ruuvitag-sensor is the only BLE application running. However, I'm using the ruuvi_rx reactive wrapper implementation.

From the lack of data, looks like it has died again in the night. I'll take a look at it when I get back home and try to wrap things in a way that it doesn't stop completely or restarts when bad things happen.

from ruuvitag-sensor.

ttu avatar ttu commented on May 18, 2024

I was checking the code and when there is something wrong with the decoding it should stop handling next datas.

On error decode return none
https://github.com/ttu/ruuvitag-sensor/blob/master/ruuvitag_sensor/decoder.py#L162

And it is just then ignored
https://github.com/ttu/ruuvitag-sensor/blob/master/ruuvitag_sensor/ruuvi.py#L167

I'll try to update a new version of ruuvitag package this weekend and also merge changes to bleson branch and update it to use the latest version of Bleson and do related code changes.

from ruuvitag-sensor.

ttu avatar ttu commented on May 18, 2024

Version 0.12.0 released, code merged to bleson branch and bleson updated from 0.0.13 to version 0.0.15

@quulah Have you tried with "normal" Bluez version?

from ruuvitag-sensor.

quulah avatar quulah commented on May 18, 2024

Yes, I started with that, but had trouble with it since I run this in a Docker container. I think it was related to the usage of sudo with the hcitool commands. I could've probably put sudo in the container, but I tested the bleson branch and it worked, so I haven't looked back since. :)

from ruuvitag-sensor.

ttu avatar ttu commented on May 18, 2024

@quulah Thats nice. I really hope that Python will eventually get some working cross platform bluetooth solution (and will be extra happy if it will be Bleson).

Little bit off topic, but could also add Dockerfile to the repository. Did you have some extra settings for the image, or just some basic like this?

FROM python:3

ADD . /ruuvi
WORKDIR /ruuvi

RUN pip install -e .

CMD [ "python", "ruuvitag_sensor", "-s" ]

NOTE: I updated setup.py as process-dependecy-links was removed from pip

from ruuvitag-sensor.

quulah avatar quulah commented on May 18, 2024

I can try to whip up a Dockerfile in a pull request for this repository. And yeah, basically that's it for the Docker image. I'm putting in my own code too and ruuvitag-sensor is in a requirements.txt that gets read by pip.

I'm using arm32v7/ubuntu:bionic as the base, as Ubuntu happened to have a version of Python compiled with socket.AF_BLUETOOTH support for bleson.

I took a look at the code, as well as the changes, and looks like the merge didn't really change anything in the decoder.py. And as you said, that exception should have been grabbed.

I'm currently running the newer version, and there hasn't been any problems yet so I'll close this.

from ruuvitag-sensor.

ttu avatar ttu commented on May 18, 2024

@quulah great if you have time to do the Dockerfile 👍

I should also gather some feedback how this Bleson version is working and if there is no complains I could release a new version to pypi from this branch. Will open a new issue for that.

from ruuvitag-sensor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.