joergmlpts / blood-pressure-monitor

Python application for Microlife's blood pressure monitors to download data and set the clock and ID via USB and Bluetooth.
MIT License
31 stars 3 forks source link

NoneType object is not subscriptable #4

Open Kryol62 opened 7 months ago

Kryol62 commented 7 months ago

On Ubuntu 22.04 I see for bpm_usb.py

Starting USB communication with Blood Pressure Monitor. Error: 'NoneType' object is not subscriptable

This happens on line 101: patient_id = self.get_patient_id(); How to resolve?

joergmlpts commented 7 months ago

I cannot reproduce this one; setting and getting the patient id works for me.

Generally, for USB there are two things to consider:

  1. Install the hid module with pip3 install hid and also install one of the required libraries; it did not work for me with Ubuntu's apt install python3-hid.
  2. Get it to work first running as root. Once USB communication works for root add a rule under /etc/udev/rules.d/ to get it to work for non-root users.

Hope this helps.