Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
data/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
2 changes: 1 addition & 1 deletion Documentation/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Note that the script might delete all data on the device and do a factory reset
UT330BUI
--------

This is a complete app to control the UT330B devices using the UT330 class. It's written using Bokeh 2.0.1. To run the software, go to the folder above the UT330BUI folder and type in: ::
This is a complete app to control the UT330B devices using the UT330 class. It's written using Bokeh 3.0.3. To run the software, go to the folder above the UT330BUI folder and type in: ::

bokeh serve UT330BUI --show

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# UT330B
Operating system independent controller for the Uni-Trend UT330B temperature and humidity logger.
Operating system independent controller for the Uni-Trend UT330 family of temperature and humidity loggers.

I've blogged about this software on my blog: https://blog.engora.com/2020/02/reverse-engineering-sensor.html

Expand All @@ -8,6 +8,8 @@ What the software does

The [Uni-Trend UT330B](https://www.uni-trend.com/html/product/Environmental/Environmental_Tester/UT330-USB/UT330B.html) is a battery-powered USB temperature and humidity logger. Off-the-shelf, it only comes with Windows control software. This project provides Python code to control the device from any operating system.

IT should work with other members of the UT330 family - and has been tested with at least UT330A and UT330B.

This project is a complete package, including software, a test script, a demo UI (written in Bokeh), and full documentation.

<img src="https://github.com/MikeWoodward/UT330B/blob/master/Documentation/chart.png"/>
Expand All @@ -22,7 +24,12 @@ Many thanks to [Philip Gladstone](https://github.com/pjsg) for his tremendous he
Installation notes
==================

The project uses uses pyserial __version 3.01 or later__. This version uses Bokeh version 2.0.1. See the Documentation section for instructions for how to use the software.
The project uses uses pyserial __version 3.01 or later__. This version uses Bokeh version 3.0.3. See the Documentation section for instructions for how to use the software.

The easiest is to simply use uv to run:
uv run bokeh serve UT330BUI --show

This must run with read/write access to the `/dev/ttyUSB0` device. By default on Ubuntu this device is in the `dialout` group, so simplest is to add your user to that group, restart, and then execute the above as yourself.

Oddities
========
Expand Down
2 changes: 1 addition & 1 deletion UT330BUI/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Imports
# -----------------------------------------------------------------------------
from bokeh.io import curdoc
from bokeh.models.widgets import Tabs
from bokeh.models import Tabs
from model.UT330 import UT330
from view.intro import Intro
from view.readdisplay import ReadDisplay
Expand Down
4 changes: 2 additions & 2 deletions UT330BUI/view/intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# %%---------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from bokeh.models.widgets import (Div, Panel)
from bokeh.models import (Div, TabPanel)
from bokeh.layouts import column


Expand Down Expand Up @@ -57,7 +57,7 @@ def __init__(self, controller):
self.layout = column(children=[self.logo,
self.description],
sizing_mode='stretch_both')
self.panel = Panel(child=self.layout, title='UT330B')
self.panel = TabPanel(child=self.layout, title='UT330B')

# %%
def setup(self):
Expand Down
8 changes: 4 additions & 4 deletions UT330BUI/view/readdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# %%---------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from bokeh.models.widgets import (Div, FileInput, Panel)
from bokeh.plotting import Figure
from bokeh.models import (Div, FileInput, TabPanel)
from bokeh.plotting import figure
from bokeh.layouts import column, row
from bokeh.models import ColumnDataSource, LinearAxis, Range1d

Expand Down Expand Up @@ -48,7 +48,7 @@ def __init__(self, controller):
sizing_mode='stretch_width')

# Chart to show temperature and/or humidity.
self.temphumidity = Figure(x_axis_type='datetime',
self.temphumidity = figure(x_axis_type='datetime',
title="Humidity & temperature by datetime",
x_axis_label='Datetime',
y_axis_label='Temperature (C)')
Expand Down Expand Up @@ -101,7 +101,7 @@ def __init__(self, controller):
width=250, height=80),
column(self.temphumidity, sizing_mode='stretch_both')],
sizing_mode='stretch_both')
self.panel = Panel(child=self.layout, title='Read & display')
self.panel = TabPanel(child=self.layout, title='Read & display')

# %%
def setup(self):
Expand Down
4 changes: 2 additions & 2 deletions UT330BUI/view/readsave.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Imports
# -----------------------------------------------------------------------------
import os
from bokeh.models.widgets import (Button, Div, Panel)
from bokeh.models import (Button, Div, TabPanel)
from bokeh.layouts import column, row
import pandas as pd

Expand Down Expand Up @@ -102,7 +102,7 @@ def __init__(self, controller):
self.write_to_disk, self.erase_data,
self.disconnect)],
sizing_mode="stretch_both")
self.panel = Panel(child=self.layout,
self.panel = TabPanel(child=self.layout,
title='Read & save')

# %%
Expand Down
4 changes: 2 additions & 2 deletions UT330BUI/view/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Imports
# -----------------------------------------------------------------------------
import datetime
from bokeh.models.widgets import (Button, Div, Panel, Select, TextInput)
from bokeh.models import (Button, Div, TabPanel, Select, TextInput)
from bokeh.layouts import column, row


Expand Down Expand Up @@ -194,7 +194,7 @@ def __init__(self, controller):
self.write_offsets)
],
sizing_mode='stretch_both')
self.panel = Panel(child=self.layout, title='Settings')
self.panel = TabPanel(child=self.layout, title='Settings')

# %%
def setup(self):
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[project]
name = "ut330"
version = "0.1.0"
description = "Operating system independent controller for the Uni-Trend UT330 family of temperature and humidity loggers."
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"bokeh>=3.0.3",
"numpy<1.24.0",
"pandas>=2.1.0",
"pyserial>=3.01",
]
Loading