callie-jones / bits-weather-dashboard

Smart Ski Slope system to display real time weather conditions on a user-friendly dashboard
Apache License 2.0
0 stars 1 forks source link

Generic USB Sensor Driver #10

Closed JackDinkel closed 6 years ago

JackDinkel commented 6 years ago

Create a USB sensor driver. Test on the thermometer until the new sensors arrive.

JackDinkel commented 6 years ago

I have fixed my issue reading data from the Thermometer. It turns out I was having a USB permissions issue, but solving it took quite a lot more effort than I hoped. Here is what worked in the end:

  1. Create a file called /etc/udev/rules.d/50-datalogger.rules
  2. Put the following in it:
    SUBSYSTEM !="usb_device", ACTION !="add", GOTO="datalogger_rules_end"
    SYSFS{idVendor} =="0c45", SYSFS{idProduct} =="7401", SYMLINK+="datalogger"
    MODE="0666", OWNER="jack", GROUP="root"
    LABEL="datalogger_rules_end"

    where idVendor and idProduct are obtained from lsusb, and OWNER is my username. This file will grant the necessary permissions for a single USB device.

  3. Reboot.

I can now use the pcsensor driver I found online. I am still experimenting with writing my own. No luck yet, but solving this issue gives me a lot of confidence.

JackDinkel commented 6 years ago

Tabling this. It is not needed.