Topic | TypeError during connection with Python API

Home Forums Mooshimeter Support TypeError during connection with Python API

Viewing 4 reply threads
  • Author
    Posts
    • #14583 Reply
      Barney
      Guest

      Hi,

      Am experimenting with using the Python API but the following error keeps being thrown during the main_meter.connect() call:

      Traceback (most recent call last):
      File “example.py”, line 57, in <module>
      main_meter.connect()
      File “C:\Users\delphinus\repos\denebola\Mooshimeter-PythonAPI\Mooshimeter.py”, line 220, in connect
      self.meter_serout.enableNotify(True,tmp_cb)
      File “C:\Users\delphinus\repos\denebola\Mooshimeter-PythonAPI\BGWrapper.py”, line 58, in enableNotify
      self.p.enableNotify(self.uuid, enable)
      File “C:\Users\delphinus\repos\denebola\Mooshimeter-PythonAPI\BGWrapper.py”, line 149, in enableNotify
      raise
      TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType

      Has anyone else experienced this issue?

      Thanks,
      Barney

    • #14714 Reply
      Anonymous
      Guest

      Just in case any one needs to know…!

      A firmware update via the iPhone app seemed to sort the issue, although the packets seem to be arriving very intermittently, so I need to get to the bottom of that now.

      Thanks

    • #14715 Reply
      admin
      Keymaster

      Hi Barney,

      I looked at the error and corrected it. Check the master branch on the github repo.

      It looks like the script was having trouble enabling notifications for your meter because something went wrong in the characteristic discovery process. I’m not sure what would cause that. Please let me know if the issue keeps coming up and what changes.

      Thanks!
      ~James

    • #14741 Reply
      Anonymous
      Guest

      Thanks James, I’ll check it out and will let you know if it recurs.

      Also, you wouldn’t happen to know why the output to the screen seems slow (i.e. in the order of one sample per two seconds with both Ch.A and Ch.B activated)? I’ve not changed the default set-up values.

      Thanks again,
      Barney

    • #14759 Reply
      admin
      Keymaster

      Ah! Thanks for pointing that out.

      I looked at the Example.py script. See the lines that say:

      You can mess with those to change the sample rates. Right now it’s set to 125Hz, 256 samples (so about 1 sample/2seconds, just as you observed). sampling:rate 1 would give 250Hz, sampling:rate 2 would give 500Hz, etc. sampling:depth 2 gives buffer depth 128, etc. So if you change to

      That should give a sample every 0.5second
      ~James

Viewing 4 reply threads
Reply To: TypeError during connection with Python API
Your information:




This site is protected by reCaptcha and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.