Skip to content

Commit

Permalink
initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
karelv committed Mar 3, 2023
0 parents commit 75f9532
Show file tree
Hide file tree
Showing 278 changed files with 199,395 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/site-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy site to GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Install pandoc
run: sudo apt-get install -y pandoc
- name: Install cssnano
run: sudo npm install cssnano-cli --global
- name: Install terser
run: sudo npm install terser --global
- name: Install python dependencies
run: sudo pip install -r web-interface/requirements.txt
- name: Install arduino-cli
run: |
mkdir -p ~/.local/bin
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh
- name: Build distribution
run: make
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: dist/

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dist
*/build
web-interface/*.html
!web-interface/index.jinja2.html
!web-interface/google*.html
/firmware_list.md
*.min.js
*.min.css
!web-interface/assets/**/*.min.js
!web-interface/assets/**/*.min.css
web-interface/melexis-bulma.css
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 mlx-kva

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.PHONY: clean all dist arduino_trinkey_qt

DIST_DIR=dist


all: dist

arduino_trinkey_qt:
rm -f i2c-stick-arduino/i2c_stick_dispatcher.cpp
rm -f i2c-stick-arduino/i2c_stick_dispatcher.h
make -C i2c-stick-arduino arduino_install_boards arduino_install_libs arduino_trinkey_qt
echo "- [adafruit Trinkey RP2040 QT UF2-file](firmware/rp2040.rp2040.adafruit_trinkeyrp2040qt/melexis-i2c-stick-arduino.ino.uf2) -- [url](https://www.adafruit.com/product/5056)" >> firmware_list.md

dist: arduino_trinkey_qt
@-cp -fv firmware_list.md web-interface
make -C web-interface all
@mkdir -p ${DIST_DIR}/firmware
@cd i2c-stick-arduino/build/ && find -type f -name '*' -printf "mkdir -p ../../${DIST_DIR}/firmware/%h && cp -v '%h/%f' '../../${DIST_DIR}/firmware/%h/melexis-%f'\n" | sh && cd ../..

clean:
@rm -rfv ${DIST_DIR}
@rm -fv firmware.csv
3 changes: 3 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!*jpg
!*png
*.~vsdx
40 changes: 40 additions & 0 deletions doc/01_hardware_and_software.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Melexis I2C Stick -- Hardware & Software.

## Hardware

Our goto board is this MCU boards:

- <https://www.adafruit.com/product/5056> (Adafruit Trinkey QT2040)

But it is known to work as well on those boards:

- <https://www.adafruit.com/product/4500> (Adafruit nrf52 CLUE)
- <https://www.adafruit.com/product/4900> (Adafruit QT Py RP2040)
- <https://www.pjrc.com/teensy/> (Teensy)

This sketch requires a board with a fair amount of memory, as we support
multiple slaves as well the FIR array sensors.


## Software

### Block diagram.

![](./media/melexis-i2c-stick-fw-overview.webp)

### Other resources

Besides this Arduino sketch, you also can have a look at our non-contact temperature drivers:

- <https://github.com/melexis/mlx90614-library>
- <https://github.com/melexis/mlx90632-library>
- <https://github.com/melexis/mlx90640-library>
- <https://github.com/melexis/mlx90641-library>

Those are our released drivers.
They require you to implement a couple of I2C routines specific for the MCU you choose.

For Arduino, you will find here an example on how to implement those I2C routines.

It is recommended to start your project from the above linked github drivers to build your own
software, and use this Arduino project to get inspired. Especially the for the I2C routines and the functions within the sensor specific 'cmd' routines in the files `mlx<12345>_cmd.cpp/h`.
59 changes: 59 additions & 0 deletions doc/02_serial_interface_tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Melexis I2C Stick -- Serial Interface: Tasks.

## Tasks

Tasks are a single character requests, no need for `LF`
This is handy when working in a serial terminal.

### `;` - Go Continuous Task

Enable to continuous mode.

The firmware will continuously poll each sensor (which has an associated
driver) and display TA & TO as the data becomes available.

Send: `;`

Receive: `\\n;:continuous mode` + `LF`

### `!` - Stop Task

Stop the continuous mode, if it was started earlier.

Send: `!`

Receive: `\\n:interactive mode` + `LF`

Note: this is a single character command, no need for `LF`

### `>` -- Next active sensor Task

Select the next sensor on the bus as the active sensor.

Send: `>`

Receive: `\n>:5A:1,MLX90614` + `LF`

### `<` -- Previous active sensor Command

Select the previous sensor on the bus as the active sensor.

Send: `<`

Receive: `\n<:5A,1,MLX90614` + `LF`

### `?` -- help Task

Display help info about the tasks.

Send: `?`

Receive: `....` + `LF`

### `1` -- help Task

Alias for `?`-task.

### `5` -- refresh scan Task

Alias for `scan`-command. (see next chapter)
Loading

0 comments on commit 75f9532

Please sign in to comment.